Skip to content

Commit

Permalink
refactor(dbt): rename test_dagster_metadata to `test_dagster_meta_c…
Browse files Browse the repository at this point in the history
…onfig`
  • Loading branch information
rexledesma committed Feb 1, 2024
1 parent 7685c72 commit 43ed711
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "test_dagster_metadata"
name: "test_dagster_meta_config"

config-version: 2
version: "0.1"
Expand All @@ -24,7 +24,7 @@ seeds:
node_color: "#cd7f32"

models:
test_dagster_metadata:
test_dagster_meta_config:
materialized: table
staging:
materialized: view
Expand Down

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
manifest_path = Path(__file__).joinpath("..", "sample_manifest.json").resolve()
manifest = json.loads(manifest_path.read_bytes())

test_dagster_metadata_manifest_path = (
test_dagster_meta_config_manifest_path = (
Path(__file__)
.joinpath("..", "dbt_projects", "test_dagster_metadata", "manifest.json")
.joinpath("..", "dbt_projects", "test_dagster_meta_config", "manifest.json")
.resolve()
)
test_dagster_metadata_manifest = json.loads(test_dagster_metadata_manifest_path.read_bytes())
test_dagster_meta_config_manifest = json.loads(test_dagster_meta_config_manifest_path.read_bytes())

test_python_interleaving_manifest_path = (
Path(__file__)
Expand Down Expand Up @@ -415,7 +415,7 @@ def get_partition_mapping(
return partition_mapping

@dbt_assets(
manifest=test_dagster_metadata_manifest,
manifest=test_dagster_meta_config_manifest,
dagster_dbt_translator=CustomizedDagsterDbtTranslator(),
partitions_def=DailyPartitionsDefinition(start_date="2023-10-01"),
)
Expand Down Expand Up @@ -526,7 +526,7 @@ def my_dbt_assets():


def test_dbt_meta_auto_materialize_policy() -> None:
@dbt_assets(manifest=test_dagster_metadata_manifest)
@dbt_assets(manifest=test_dagster_meta_config_manifest)
def my_dbt_assets():
...

Expand All @@ -538,7 +538,7 @@ def my_dbt_assets():


def test_dbt_meta_freshness_policy() -> None:
@dbt_assets(manifest=test_dagster_metadata_manifest)
@dbt_assets(manifest=test_dagster_meta_config_manifest)
def my_dbt_assets():
...

Expand All @@ -552,7 +552,7 @@ def my_dbt_assets():


def test_dbt_meta_asset_key() -> None:
@dbt_assets(manifest=test_dagster_metadata_manifest)
@dbt_assets(manifest=test_dagster_meta_config_manifest)
def my_dbt_assets():
...

Expand All @@ -570,7 +570,7 @@ def my_dbt_assets():


def test_dbt_config_group() -> None:
@dbt_assets(manifest=test_dagster_metadata_manifest)
@dbt_assets(manifest=test_dagster_meta_config_manifest)
def my_dbt_assets():
...

Expand All @@ -590,7 +590,7 @@ def my_dbt_assets():


def test_dbt_with_downstream_asset_via_definition():
@dbt_assets(manifest=test_dagster_metadata_manifest)
@dbt_assets(manifest=test_dagster_meta_config_manifest)
def my_dbt_assets():
...

Expand All @@ -604,7 +604,7 @@ def downstream_of_dbt():


def test_dbt_with_downstream_asset():
@dbt_assets(manifest=test_dagster_metadata_manifest)
@dbt_assets(manifest=test_dagster_meta_config_manifest)
def my_dbt_assets():
...

Expand All @@ -620,7 +620,9 @@ def downstream_of_dbt():
def test_dbt_with_custom_resource_key() -> None:
dbt_resource_key = "my_custom_dbt_resource_key"

@dbt_assets(manifest=test_dagster_metadata_manifest, required_resource_keys={dbt_resource_key})
@dbt_assets(
manifest=test_dagster_meta_config_manifest, required_resource_keys={dbt_resource_key}
)
def my_dbt_assets(context: AssetExecutionContext):
dbt = getattr(context.resources, dbt_resource_key)

Expand All @@ -630,7 +632,9 @@ def my_dbt_assets(context: AssetExecutionContext):
[my_dbt_assets],
resources={
dbt_resource_key: DbtCliResource(
project_dir=os.fspath(test_dagster_metadata_manifest_path.joinpath("..").resolve())
project_dir=os.fspath(
test_dagster_meta_config_manifest_path.joinpath("..").resolve()
)
)
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

manifest_path = (
Path(__file__)
.joinpath("..", "dbt_projects", "test_dagster_metadata", "manifest.json")
.joinpath("..", "dbt_projects", "test_dagster_meta_config", "manifest.json")
.resolve()
)
manifest = json.loads(manifest_path.read_bytes())
Expand Down

0 comments on commit 43ed711

Please sign in to comment.