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

block names are cleaned on prefect side & we might get a mistmach; #400

Merged
merged 1 commit into from
Dec 29, 2023
Merged
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
14 changes: 5 additions & 9 deletions ddpui/management/commands/run-tasks-migrate-cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,7 @@ def migrate_transformation_blocks(self, org: Org):
if old_block.block_name.endswith("git-pull"): # its a git pull block
task = Task.objects.filter(slug=TASK_GITPULL).first()
else: # its one of the dbt core block
old_cmd = old_block.block_name.split(f"{old_block.dbt_target_schema}-")[
-1
]
old_cmd = "dbt-" + str(old_block.command)
task = Task.objects.filter(slug__endswith=old_cmd).first()

if not task:
Expand Down Expand Up @@ -807,9 +805,8 @@ def migrate_org_pipelines(self, org: Org):
continue

elif dataflow_blk.opb.block_type == DBTCORE:
old_cmd = dataflow_blk.opb.block_name.split(
f"{dataflow_blk.opb.dbt_target_schema}-"
)[-1]
old_cmd = "dbt-" + str(dataflow_blk.opb.command)

task = Task.objects.filter(slug__endswith=old_cmd).first()
if not task:
self.failures.append(
Expand Down Expand Up @@ -997,9 +994,8 @@ def migrate_org_pipelines(self, org: Org):
): # its a git pull block
task = Task.objects.filter(slug=TASK_GITPULL).first()
else: # its one of the dbt core block
old_cmd = org_prefect_blk.block_name.split(
f"{org_prefect_blk.dbt_target_schema}-"
)[-1]
old_cmd = "dbt-" + str(org_prefect_blk.command)

task = Task.objects.filter(slug__endswith=old_cmd).first()

if not task:
Expand Down