Skip to content

Commit

Permalink
Merge pull request #400 from DalgoT4D/hotfix-migration
Browse files Browse the repository at this point in the history
block names are cleaned on prefect side & we might get a mistmach;
  • Loading branch information
fatchat authored Dec 29, 2023
2 parents 65e0af6 + 8e14b33 commit a76a6ef
Showing 1 changed file with 5 additions and 9 deletions.
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

0 comments on commit a76a6ef

Please sign in to comment.