From 92d4f4247f9e915a4a16ba1a49f085384eb580cb Mon Sep 17 00:00:00 2001 From: GoldenAnpu Date: Tue, 17 Dec 2024 00:45:27 +0100 Subject: [PATCH] Refactor dataset ID handling to allow for optional integer conversion and improve environment variable parsing --- src/globals.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/globals.py b/src/globals.py index ee958ec..0aea0cf 100644 --- a/src/globals.py +++ b/src/globals.py @@ -26,7 +26,9 @@ TEAM_ID = int(os.environ['context.teamId']) WORKSPACE_ID = int(os.environ['context.workspaceId']) PROJECT_ID = int(os.environ['modal.state.slyProjectId']) -DATASET_ID = int(os.environ.get('modal.state.slyDatasetId', None)) +DATASET_ID = os.environ.get('modal.state.slyDatasetId', None) +if DATASET_ID is not None: + DATASET_ID = int(DATASET_ID) CHANGE_RESOLUTION = bool(strtobool(os.environ.get('modal.state.changeResolution', 'false'))) TARGET_HEIGHT = int(os.environ.get('modal.state.targetResolutionHeight'), 1280) TARGET_WIDTH = int(os.environ.get('modal.state.targetResolutionWidth'), 720)