Skip to content

Commit

Permalink
Add dbt 1.7 support to list task
Browse files Browse the repository at this point in the history
Signed-off-by: Wei-Chun, Chang <[email protected]>
  • Loading branch information
wcchang1115 committed Nov 21, 2023
1 parent b12584d commit 76b3c01
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions piperider_cli/dbt/list_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def load_full_manifest(target_path: str, project_dir: str = None):
register_adapter(runtime_config)

v = dbt_version
if v == '1.5' or v == '1.6':
if v == '1.5' or v == '1.6' or v == '1.7':

Check warning on line 37 in piperider_cli/dbt/list_task.py

View check run for this annotation

Codecov / codecov/patch

piperider_cli/dbt/list_task.py#L37

Added line #L37 was not covered by tests
return ManifestLoader.get_full_manifest(
runtime_config, write_perf_info=False
)
Expand All @@ -56,7 +56,7 @@ def load_manifest(manifest: Dict):
if v == '1.5':
return _load_manifest_version_15(manifest)

if v == '1.6':
if v == '1.6' or v == '1.7':
return _load_manifest_version_16(manifest)

raise NotImplementedError(f'dbt-core version: {v} is not supported')
Expand Down Expand Up @@ -260,7 +260,7 @@ def _get_v15_runtime_config(flags):
setattr(flags, "target", None)

v = dbt_version
if v == '1.5' or v == '1.6':
if v == '1.5' or v == '1.6' or v == '1.7':

Check warning on line 263 in piperider_cli/dbt/list_task.py

View check run for this annotation

Codecov / codecov/patch

piperider_cli/dbt/list_task.py#L263

Added line #L263 was not covered by tests
return _get_v15_runtime_config(flags)
elif v == '1.4':
return _get_v14_runtime_config(flags)
Expand Down Expand Up @@ -357,6 +357,13 @@ def has_field(field_name):
if has_field('packages_specified_path'):
data['packages_specified_path'] = "packages.yml"

# dbt 1.7
if has_field('semantic_models'):
data['semantic_models'] = {}

Check warning on line 362 in piperider_cli/dbt/list_task.py

View check run for this annotation

Codecov / codecov/patch

piperider_cli/dbt/list_task.py#L362

Added line #L362 was not covered by tests

if has_field('saved_queries'):
data['saved_queries'] = {}

Check warning on line 365 in piperider_cli/dbt/list_task.py

View check run for this annotation

Codecov / codecov/patch

piperider_cli/dbt/list_task.py#L365

Added line #L365 was not covered by tests

super().__init__(args=None, **data)

def validate(self):
Expand Down

0 comments on commit 76b3c01

Please sign in to comment.