Skip to content

Commit

Permalink
change dbt target resolution take 2 (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
alangenfeld authored Aug 12, 2024
1 parent 67bf118 commit d0abda0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 5 additions & 7 deletions hooli-demo-assets/hooli_demo_assets/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@


def get_env():
if os.getenv("DAGSTER_CLOUD_DEPLOYMENT_NAME", "") == "data-eng-prod":
return "PROD"
if os.getenv("DAGSTER_IS_DEV_CLI"):
return "LOCAL"
# default to BRANCH so we use that in github CI
return "BRANCH"

if os.getenv("DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT", "") == "1":
return "BRANCH"
if os.getenv("DAGSTER_CLOUD_DEPLOYMENT_NAME", "") == "data-eng-prod":
return "PROD"
return "LOCAL"

# Path for duckdb connection - needed for local dev
current_file_path = Path(__file__)
Expand Down
9 changes: 5 additions & 4 deletions hooli_data_eng/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@


def get_env():
if os.getenv("DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT", "") == "1":
return "BRANCH"
if os.getenv("DAGSTER_CLOUD_DEPLOYMENT_NAME", "") == "data-eng-prod":
return "PROD"
return "LOCAL"
if os.getenv("DAGSTER_IS_DEV_CLI"):
return "LOCAL"
# default to BRANCH so we use that in github CI
return "BRANCH"


dbt_project_path = Path(__file__).parent.parent.joinpath("dbt_project")
Expand All @@ -19,4 +20,4 @@ def get_env():
state_path="target/slim_ci",
target=get_env(),
)
dbt_project.prepare_if_dev()
dbt_project.prepare_if_dev()

0 comments on commit d0abda0

Please sign in to comment.