-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Describe the bug
What if you want to delete the job from both yml and dbt cloud. Is that possible?
I only see unlink and deactivate jobs, which seems like it will still remain in dbt cloud.
https://github.com/dbt-labs/dbt-jobs-as-code#unlink
When testing, setting jobs to an empty list or dict resulted in an error.
To Reproduce
Steps to reproduce the behavior:
Say we have a jobs file as follows:
jobs:
run_unit_tests:
account_id: "{{ account_id }}"
project_id: "{{ project_id }}"
environment_id: "{{ environment_id }}"
name: Run Unit Tests
settings:
target_name: default
threads: 4
execution:
timeout_seconds: 0
run_generate_sources: false
execute_steps:
- dbt test -s test_type:unit
generate_docs: false
schedule:
cron: "* * * * *"
triggers:
github_webhook: false
job_type: ci
and that job is deployed etc on dbt Cloud and I now want to delete that job, how do I go about that via jobs as code? I tried the below:
jobs: {}
and
jobs: []
but for both a receive an index error:
account_id=list(defined_jobs)[0].account_id,
~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
This was returned when performing dbt-jobs-as-code validate
Expected behavior
Future state would be able to support the absence of jobs. If we deleted the jobs file then ran plan/sync, it would not perform any actions as there is no jobs file, this would then cause what’s on dbt cloud and what is defined at the repo to be out of sync. Ideally, if there was a job definition before that exists on dbt Cloud, and now there is no longer one (represented by the file being deleted and/or an empty dict being set for jobs
key) then it should be reflected on dbt Cloud
Desktop (please complete the following information):
- OS [e.g. iOS]:
- dbt Core Version [e.g. 1.3.1]:
dbt-jobs-as-code
Version [e.g. 1.0.0]:
Additional context
Add any other context about the problem here.