Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracks progress for package creation, upload and kickoff #2935

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
5 changes: 5 additions & 0 deletions flytekit/loggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
LOGGING_DEV_ENV_VAR = "FLYTE_SDK_DEV_LOGGING_LEVEL"
LOGGING_FMT_ENV_VAR = "FLYTE_SDK_LOGGING_FORMAT"
LOGGING_RICH_FMT_ENV_VAR = "FLYTE_SDK_RICH_TRACEBACKS"
FLYTEKIT_DISPLAY_PROGRESS_ENV_VAR = "FLYTE_SDK_DISPLAY_PROGRESS"

# By default, the root flytekit logger to debug so everything is logged, but enable fine-tuning
logger = logging.getLogger("flytekit")
Expand Down Expand Up @@ -186,5 +187,9 @@ def get_level_from_cli_verbosity(verbosity: int) -> int:
return logging.DEBUG


def is_display_progress_enabled() -> bool:
return os.getenv(FLYTEKIT_DISPLAY_PROGRESS_ENV_VAR, False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider type conversion for env var

The os.getenv() call for FLYTEKIT_DISPLAY_PROGRESS_ENV_VAR should specify the type for the default value as str to match environment variable type. Consider using os.getenv(FLYTEKIT_DISPLAY_PROGRESS_ENV_VAR, 'false').lower() == 'true' for proper boolean conversion.

Code suggestion
Check the AI-generated fix before applying
Suggested change
return os.getenv(FLYTEKIT_DISPLAY_PROGRESS_ENV_VAR, False)
return os.getenv(FLYTEKIT_DISPLAY_PROGRESS_ENV_VAR, 'false').lower() == 'true'

Code Review Run #941fb7


Is this a valid issue, or was it incorrectly flagged by the Agent?

  • it was incorrectly flagged



# Default initialization
initialize_global_loggers()
Loading
Loading