From c186152a44e50e2f5130a8c35724504489bacbce Mon Sep 17 00:00:00 2001 From: Tatiana Al-Chueyr Date: Tue, 15 Oct 2024 14:24:16 +0100 Subject: [PATCH] Fix pre-commit checks (#247) Address all the feedback that is given when running: pre-commit run --all-files --- .pre-commit-config.yaml | 1 + tests/fixtures/dag_factory.yml | 2 +- tests/fixtures/dag_factory_variables_as_arguments.yml | 2 +- tests/fixtures/invalid_yaml.yml | 2 +- tests/fixtures/mydocfile.md | 2 +- tests/test_dagbuilder.py | 1 + 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7c8b3ecc..6c2ac29e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,6 +17,7 @@ repos: - id: check-yaml args: - --unsafe + exclude: 'tests/fixtures/dag_factory.yml|examples/invalid.yaml|tests/fixtures/invalid_yaml.yml' - id: debug-statements - id: end-of-file-fixer - id: mixed-line-ending diff --git a/tests/fixtures/dag_factory.yml b/tests/fixtures/dag_factory.yml index 70b469ed..a27a9f09 100644 --- a/tests/fixtures/dag_factory.yml +++ b/tests/fixtures/dag_factory.yml @@ -66,4 +66,4 @@ example_dag4: tasks: task_1: bash_command: !join ['echo ', *arg2] - operator: airflow.operators.bash_operator.BashOperator \ No newline at end of file + operator: airflow.operators.bash_operator.BashOperator diff --git a/tests/fixtures/dag_factory_variables_as_arguments.yml b/tests/fixtures/dag_factory_variables_as_arguments.yml index 4964a19d..ac1730ba 100644 --- a/tests/fixtures/dag_factory_variables_as_arguments.yml +++ b/tests/fixtures/dag_factory_variables_as_arguments.yml @@ -32,4 +32,4 @@ example_dag: dependencies: [task_1] variables_as_arguments : [ {"variable":"var1","attribute":"bash_command"} - ] \ No newline at end of file + ] diff --git a/tests/fixtures/invalid_yaml.yml b/tests/fixtures/invalid_yaml.yml index 22a955ff..55f097c3 100644 --- a/tests/fixtures/invalid_yaml.yml +++ b/tests/fixtures/invalid_yaml.yml @@ -22,4 +22,4 @@ example_dag: task_3: operator: airflow.operators.bash_operator.BashOperator bash_command: 'echo 3' - dependencies: [task_1] \ No newline at end of file + dependencies: [task_1] diff --git a/tests/fixtures/mydocfile.md b/tests/fixtures/mydocfile.md index e07dea4f..66b581fb 100644 --- a/tests/fixtures/mydocfile.md +++ b/tests/fixtures/mydocfile.md @@ -70,4 +70,4 @@ Frugilegas idem progenuit habebat fortissime lateque foci pignora, nec resumit quam Atrides. Viscera sua Paphon violenta naresque *esse* totas **crimine resonantia** vulneret ubi lecti omnia. Sua ingens ubi fecit ait est indigestaque quas haberet da *aerias iaculum nulloque* fluctibus comites cognata, et. Ora -**intrat damna ante** Poemenis annos, et creatis Dianae. Uno lacertis levem? \ No newline at end of file +**intrat damna ante** Poemenis annos, et creatis Dianae. Uno lacertis levem? diff --git a/tests/test_dagbuilder.py b/tests/test_dagbuilder.py index 35098295..a1291ae3 100644 --- a/tests/test_dagbuilder.py +++ b/tests/test_dagbuilder.py @@ -492,6 +492,7 @@ def test_build(): if version.parse(AIRFLOW_VERSION) >= version.parse("1.10.8"): assert actual["dag"].tags == ["tag1", "tag2"] + def test_get_dag_params_dag_with_task_group(): td = dagbuilder.DagBuilder("test_dag", DAG_CONFIG_TASK_GROUP, DEFAULT_CONFIG) expected = {