Skip to content

Commit

Permalink
[docs] fix deps call in dbt_definitions_with_downstream (#25462)
Browse files Browse the repository at this point in the history
missed this in `AssetKey` change to disallow iteration 

also fixes up issues from
#24265

## How I Tested These Changes

pytest
examples/docs_beta_snippets/docs_beta_snippets_tests/test_all_files_load.py
  • Loading branch information
alangenfeld authored Oct 23, 2024
1 parent 9d73b20 commit 4ce255b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import dagster as dg
from dagster_k8s import PipesK8sClient

@dg.gasset
import dagster as dg


@dg.asset
def k8s_pod_asset(
context: dg.AssetExecutionContext,
pipes_k8s_client: PipesK8sClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def raw_customers(context: dg.AssetExecutionContext) -> None:

# Create a schema named raw
connection.execute("create schema if not exists raw")

# Create/replace table named raw_customers
connection.execute(
"create or replace table raw.raw_customers as select * from data"
Expand All @@ -42,7 +41,7 @@ def dbt_models(context: dg.AssetExecutionContext, dbt: DbtCliResource):
compute_kind="python",
# Defines the dependency on the customers model,
# which is represented as an asset in Dagster
deps=get_asset_key_for_model([dbt_models], "customers"),
deps=[get_asset_key_for_model([dbt_models], "customers")],
)
# highlight-end
def customer_histogram(context: dg.AssetExecutionContext):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def dbt_models(context: dg.AssetExecutionContext, dbt: DbtCliResource):
compute_kind="python",
# Defines the dependency on the customers model,
# which is represented as an asset in Dagster
deps=get_asset_key_for_model([dbt_models], "customers"),
deps=[get_asset_key_for_model([dbt_models], "customers")],
)
def customer_histogram(context: dg.AssetExecutionContext):
# Read the contents of the customers table into a Pandas DataFrame
Expand Down
1 change: 1 addition & 0 deletions examples/docs_beta_snippets/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ deps =
-e ../../python_modules/libraries/dagster-gcp
-e ../../python_modules/libraries/dagster-dbt
-e ../../python_modules/libraries/dagster-pandas
-e ../../python_modules/libraries/dagster-k8s
integrations: -e ../../python_modules/libraries/dagster-databricks
integrations: -e ../../python_modules/libraries/dagster-postgres
integrations: -e ../../python_modules/libraries/dagster-fivetran
Expand Down

1 comment on commit 4ce255b

@github-actions
Copy link

@github-actions github-actions bot commented on 4ce255b Oct 23, 2024

Choose a reason for hiding this comment

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

Deploy preview for dagster-docs-beta ready!

✅ Preview
https://dagster-docs-beta-grrmajnmg-elementl.vercel.app

Built with commit 4ce255b.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.