Skip to content

Commit b1caade

Browse files
authored
Merge pull request #106 from dbt-labs/feature/flags-for-compare
2 parents e31d412 + 7387924 commit b1caade

5 files changed

Lines changed: 11 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dbt-jobs-as-code"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
description = "A CLI to allow defining dbt Cloud jobs as code"
55
authors = ["dbt Labs <info@dbtlabs.com>"]
66
license = "Apache License 2.0"

src/dbt_jobs_as_code/schemas/job.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class JobDefinition(BaseModel):
3838
description: str = ""
3939
state: int = 1
4040
run_compare_changes: bool = False
41+
compare_changes_flags: str = "--select state:modified"
4142
# we don't want to enforce the list in case we add more, but still want to get those in the JSON schema
4243
job_type: str = Field(
4344
json_schema_extra={"enum": ["scheduled", "merge", "ci", "other"]},

src/dbt_jobs_as_code/schemas/load_job_schema.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,7 @@
178178
"$ref": "#/$defs/Settings"
179179
},
180180
"execution": {
181-
"allOf": [
182-
{
183-
"$ref": "#/$defs/Execution"
184-
}
185-
],
181+
"$ref": "#/$defs/Execution",
186182
"default": {
187183
"timeout_seconds": 0
188184
}
@@ -253,6 +249,11 @@
253249
"title": "Run Compare Changes",
254250
"type": "boolean"
255251
},
252+
"compare_changes_flags": {
253+
"default": "--select state:modified",
254+
"title": "Compare Changes Flags",
255+
"type": "string"
256+
},
256257
"job_type": {
257258
"default": "scheduled",
258259
"enum": [

tests/exporter/test_export.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_export_jobs_yml(capsys):
4848
on_merge: false
4949
description: ''
5050
run_compare_changes: false
51+
compare_changes_flags: --select state:modified
5152
job_type: scheduled
5253
triggers_on_draft_pr: false
5354
job_completion_trigger_condition:

tests/loader/test_loader.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"jobs": {
88
"job1": {
99
"account_id": 43791,
10+
"compare_changes_flags": "--select state:modified",
1011
"custom_environment_variables": [],
1112
"dbt_version": None,
1213
"deferring_environment_id": None,
@@ -45,6 +46,7 @@
4546
},
4647
"job2": {
4748
"account_id": 43791,
49+
"compare_changes_flags": "--select state:modified",
4850
"custom_environment_variables": [
4951
{
5052
"display_value": None,

0 commit comments

Comments
 (0)