Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

[CT-1583][Feature] Utilize new way of providing manifest for tasks #127

Closed
Tracked by #6356
ChenyuLInx opened this issue Dec 2, 2022 · 2 comments
Closed
Tracked by #6356

Comments

@ChenyuLInx
Copy link
Contributor

ChenyuLInx commented Dec 2, 2022

Once dbt-labs/dbt-core#6357 is done, we should be able to refactor any logic in dbt server that leverage create_task function in lib.py underneath to use core API directly . The goal would be replace the hard coded conditions with a call to the high level API and maybe some customized logic for dbt-server.

if task_name == "run":
dbt_service.dbt_run(path, args, manifest)
elif task_name == "seed":
dbt_service.dbt_seed(path, args, manifest)
elif task_name == "test":
dbt_service.dbt_test(path, args, manifest)
elif task_name == "build":
dbt_service.dbt_build(path, args, manifest)
elif task_name == "snapshot":
dbt_service.dbt_snapshot(path, args, manifest)
elif task_name == "run_operation":
dbt_service.dbt_run_operation(path, args, manifest)
else:
raise RuntimeException("Not an actual task")

def dbt_run(project_path, args, manifest):
config = create_dbt_config(project_path, args)
task = create_task("run", args, manifest, config)
return task.run()
def dbt_test(project_path, args, manifest):
config = create_dbt_config(project_path, args)
task = create_task("test", args, manifest, config)
return task.run()
def dbt_list(project_path, args, manifest):
config = create_dbt_config(project_path, args)
task = create_task("list", args, manifest, config)
return task.run()
def dbt_seed(project_path, args, manifest):
config = create_dbt_config(project_path, args)
task = create_task("seed", args, manifest, config)
return task.run()
def dbt_build(project_path, args, manifest):
config = create_dbt_config(project_path, args)
task = create_task("build", args, manifest, config)
return task.run()
def dbt_run_operation(project_path, args, manifest):
config = create_dbt_config(project_path, args)
task = create_task("run_operation", args, manifest, config)
return task.run()
def dbt_snapshot(project_path, args, manifest):
config = create_dbt_config(project_path, args)
task = create_task("snapshot", args, manifest, config)
return task.run()

Acceptance Criteria
The listed code paths are no longer being used, so they should be deleted.

@ChenyuLInx ChenyuLInx changed the title [Feature] Utilize new way of providing manifest for tasks [CT-1583][Feature] Utilize new way of providing manifest for tasks Dec 2, 2022
@ChenyuLInx
Copy link
Contributor Author

Code listed above should no-longer in active call path, we should be able to just remove them

@ChenyuLInx
Copy link
Contributor Author

Gonna cover this in dbt-labs/dbt-core#7093

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant