Asif Imran
04/26/2023, 8:09 PMDAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT
is automagically available in cloud deployment. I am running hybrid (cloud + aws). Noticed that its not being set. At least the following is not working as expected
def get_current_env():
# this is a global variable set by Dagster itself
is_branch_deployment = os.getenv("DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT") == 1
assert is_branch_deployment is not None, "DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT not set"
return "branch" if is_branch_deployment else "prod"
i.e always returning prod
😬chris
04/26/2023, 8:27 PMAsif Imran
04/26/2023, 8:30 PMchris
04/26/2023, 8:45 PMAsif Imran
04/26/2023, 8:48 PMDAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT=1
is (not surprisingly) serialized as '1'
inside the job. Therefore I need to cast it as integer or compare to == '1'
. Time to call it a daychris
04/26/2023, 9:44 PM