Skip to content

Commit

Permalink
Fix dbt-core breaking our task runner
Browse files Browse the repository at this point in the history
Signed-off-by: Ching Yi, Chan <[email protected]>
  • Loading branch information
qrtt1 committed Oct 5, 2023
1 parent 9fcacbb commit 6c4b54f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
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

0 comments on commit 6c4b54f

Please sign in to comment.