Skip to content

Commit

Permalink
Fix regression issues
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 efeab0c commit 951c2d2
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions piperider_cli/dbt/list_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def truncate_relation(self, relation: BaseRelation) -> None:
pass

def rename_relation(
self, from_relation: BaseRelation, to_relation: BaseRelation
self, from_relation: BaseRelation, to_relation: BaseRelation
) -> None:
pass

Expand All @@ -168,7 +168,7 @@ def expand_column_types(self, goal: BaseRelation, current: BaseRelation) -> None
pass

def list_relations_without_caching(
self, schema_relation: BaseRelation
self, schema_relation: BaseRelation
) -> List[BaseRelation]:
pass

Expand Down Expand Up @@ -348,15 +348,18 @@ def __init__(self):
"project_env_vars": {},
"cli_vars": {},
"dependencies": None,
"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:
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

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 Expand Up @@ -474,9 +477,9 @@ def list_resources_data_from_manifest(manifest: Manifest, select: tuple = None,


def compare_models_between_manifests(
base_manifest: Manifest,
altered_manifest: Manifest,
include_downstream: bool = False,
base_manifest: Manifest,
altered_manifest: Manifest,
include_downstream: bool = False,
):
task = _DbtListTask()
task.manifest = altered_manifest
Expand Down Expand Up @@ -517,8 +520,8 @@ def compare_models_between_manifests(


def list_modified_with_downstream(
base_manifest: Manifest,
altered_manifest: Manifest,
base_manifest: Manifest,
altered_manifest: Manifest,
):
task = _DbtListTask()
task.manifest = altered_manifest
Expand Down Expand Up @@ -556,8 +559,8 @@ def list_modified_with_downstream(


def list_changes_in_unique_id(
base_manifest: Manifest,
target_manifest: Manifest, show_modified_only=False) -> List[Dict[str, str]]:
base_manifest: Manifest,
target_manifest: Manifest, show_modified_only=False) -> List[Dict[str, str]]:
task = _DbtListTask()
task.manifest = target_manifest

Expand Down

0 comments on commit 951c2d2

Please sign in to comment.