Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix dbt-core breaking our task runner #895

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions piperider_cli/dbt/list_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,16 @@ def __init__(self):
"dependencies": None,
}

if dbt_version >= '1.6.2':
# Since dbt-core v1.6.2 'dbt_cloud' is required in RuntimeConfig
def has_field(field_name):
return field_name in {f.name for f in fields(RuntimeConfig)}

if has_field('dbt_cloud'):
data['dbt_cloud'] = None

found_restrict_access = any(field.name == 'restrict_access' for field in fields(RuntimeConfig))
found_packages_specified_path = any(field.name == 'packages_specified_path' for field in fields(RuntimeConfig))
if found_restrict_access:
if has_field('restrict_access'):
data['restrict_access'] = False

if found_packages_specified_path:
if has_field('packages_specified_path'):
data['packages_specified_path'] = "packages.yml"

super().__init__(args=None, **data)
Expand Down
1 change: 1 addition & 0 deletions tests/test_dbt_integeration.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def test_list_all_resources_16(self):
"seed.jaffle_shop.raw_customers",
"seed.jaffle_shop.raw_orders",
"seed.jaffle_shop.raw_payments",
"semantic_model.jaffle_shop.orders",
"test.jaffle_shop.accepted_values_int_order_payments_pivoted_status__placed__shipped__completed__return_pending__returned.0ccdff53e8",
"test.jaffle_shop.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3",
"test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad",
Expand Down
Loading