diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 96d12849..e9e9aa87 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: python3.10 repos: - repo: 'https://github.com/pre-commit/pre-commit-hooks' - rev: v4.6.0 + rev: v6.0.0 hooks: - id: check-yaml args: @@ -21,7 +21,7 @@ repos: - id: mixed-line-ending - id: check-docstring-first - repo: 'https://github.com/adrienverge/yamllint' - rev: v1.35.1 + rev: v1.38.0 hooks: - id: yamllint args: @@ -32,13 +32,13 @@ repos: hooks: - id: absolufy-imports - repo: 'https://github.com/hadialqattan/pycln' - rev: v2.5.0 + rev: v2.6.0 hooks: - id: pycln args: - '--all' - repo: 'https://github.com/pycqa/isort' - rev: 5.13.2 + rev: 7.0.0 hooks: - id: isort args: @@ -50,7 +50,7 @@ repos: - '--python-version' - '39' - repo: 'https://github.com/psf/black' - rev: 24.8.0 + rev: 26.1.0 hooks: - id: black args: @@ -66,7 +66,7 @@ repos: - '--check' - '--diff' - repo: 'https://github.com/pycqa/flake8' - rev: 7.1.1 + rev: 7.3.0 hooks: - id: flake8 args: @@ -78,7 +78,7 @@ repos: stages: - manual - repo: 'https://github.com/pre-commit/mirrors-mypy' - rev: v1.11.1 + rev: v1.19.1 hooks: - id: mypy args: diff --git a/tests/functional/adapter/dbt/test_caching.py b/tests/functional/adapter/dbt/test_caching.py index 1374ed60..30b29857 100644 --- a/tests/functional/adapter/dbt/test_caching.py +++ b/tests/functional/adapter/dbt/test_caching.py @@ -11,12 +11,10 @@ class TestCachingLowercaseModel(BaseCachingLowercaseModel): pass -@pytest.mark.skip( - reason=""" +@pytest.mark.skip(reason=""" Fails because of case sensitivity. MODEL is coereced to model which fails the test as it sees conflicting naming - """ -) + """) class TestCachingUppercaseModel(BaseCachingUppercaseModel): pass diff --git a/tests/functional/adapter/dbt/test_hooks.py b/tests/functional/adapter/dbt/test_hooks.py index 9daaaa51..fa4ce4e3 100644 --- a/tests/functional/adapter/dbt/test_hooks.py +++ b/tests/functional/adapter/dbt/test_hooks.py @@ -195,8 +195,7 @@ def project_config_update(self): "models": { "test": { "hooked": { - "post-hook": [ - """ + "post-hook": [""" insert into {{this.schema}}.on_model_hook select test_state, '{{ target.dbname }}' as target_dbname, @@ -210,8 +209,7 @@ def project_config_update(self): '{{ run_started_at }}' as run_started_at, '{{ invocation_id }}' as invocation_id, '{{ thread_id }}' as thread_id - from {{ ref('post') }}""".strip() - ], + from {{ ref('post') }}""".strip()], } }, } diff --git a/tests/functional/adapter/dbt/test_persist_docs.py b/tests/functional/adapter/dbt/test_persist_docs.py index d0b0fdce..ebb0c940 100644 --- a/tests/functional/adapter/dbt/test_persist_docs.py +++ b/tests/functional/adapter/dbt/test_persist_docs.py @@ -2,11 +2,9 @@ from dbt.tests.adapter.persist_docs.test_persist_docs import BasePersistDocs -@pytest.mark.skip( - reason=""" +@pytest.mark.skip(reason=""" Persisted docs are not implemented in SQLServer. Could be implemented with sp_addextendedproperty - """ -) + """) class TestPersistDocs(BasePersistDocs): pass diff --git a/tests/functional/adapter/dbt/test_relations.py b/tests/functional/adapter/dbt/test_relations.py index 45ebe161..1cd292b6 100644 --- a/tests/functional/adapter/dbt/test_relations.py +++ b/tests/functional/adapter/dbt/test_relations.py @@ -7,12 +7,10 @@ class TestChangeRelationTypeValidator(BaseChangeRelationTypeValidator): pass -@pytest.mark.xfail( - reason=""" +@pytest.mark.xfail(reason=""" Test fails as its not passing Use[] properly. `Use[None]` is called, should be `User[TestDB]` Unclear why the macro doens't pass it properly. - """ -) + """) class TestDropSchemaNamed(BaseDropSchemaNamed): pass diff --git a/tests/functional/adapter/dbt/test_simple_seed.py b/tests/functional/adapter/dbt/test_simple_seed.py index 78fc0f5e..8c0ff980 100644 --- a/tests/functional/adapter/dbt/test_simple_seed.py +++ b/tests/functional/adapter/dbt/test_simple_seed.py @@ -162,12 +162,10 @@ def test_simple_seed_with_disabled(self, clear_test_schema, project): check_table_does_not_exist(project.adapter, "seed_disabled") check_table_does_exist(project.adapter, "seed_tricky") - @pytest.mark.skip( - reason=""" + @pytest.mark.skip(reason=""" Running all the tests in the same schema causes the tests to fail as they all share the same schema across the tests - """ - ) + """) def test_simple_seed_selection(self, clear_test_schema, project): results = run_dbt(["seed", "--select", "seed_enabled"]) assert len(results) == 1 @@ -175,12 +173,10 @@ def test_simple_seed_selection(self, clear_test_schema, project): check_table_does_not_exist(project.adapter, "seed_disabled") check_table_does_not_exist(project.adapter, "seed_tricky") - @pytest.mark.skip( - reason=""" + @pytest.mark.skip(reason=""" Running all the tests in the same schema causes the tests to fail as they all share the same schema across the tests - """ - ) + """) def test_simple_seed_exclude(self, clear_test_schema, project): results = run_dbt(["seed", "--exclude", "seed_enabled"]) assert len(results) == 1 @@ -207,12 +203,10 @@ def clear_test_schema(self, project): project.run_sql(f"drop view if exists {project.test_schema}.seed_tricky") project.run_sql(f"drop schema if exists {project.test_schema}") - @pytest.mark.skip( - reason=""" + @pytest.mark.skip(reason=""" Running all the tests in the same schema causes the tests to fail as they all share the same schema across the tests - """ - ) + """) def test_simple_seed_with_disabled(self, clear_test_schema, project): results = run_dbt(["seed"]) assert len(results) == 2 @@ -227,12 +221,10 @@ def test_simple_seed_selection(self, clear_test_schema, project): check_table_does_not_exist(project.adapter, "seed_disabled") check_table_does_not_exist(project.adapter, "seed_tricky") - @pytest.mark.skip( - reason=""" + @pytest.mark.skip(reason=""" Running all the tests in the same schema causes the tests to fail as they all share the same schema across the tests - """ - ) + """) def test_simple_seed_exclude(self, clear_test_schema, project): results = run_dbt(["seed", "--exclude", "seed_enabled"]) assert len(results) == 1 @@ -259,12 +251,10 @@ def clear_test_schema(self, project): project.run_sql(f"drop view if exists {project.test_schema}.seed_tricky") project.run_sql(f"drop schema if exists {project.test_schema}") - @pytest.mark.skip( - reason=""" + @pytest.mark.skip(reason=""" Running all the tests in the same schema causes the tests to fail as they all share the same schema across the tests - """ - ) + """) def test_simple_seed_with_disabled(self, clear_test_schema, project): results = run_dbt(["seed"]) assert len(results) == 2 @@ -272,12 +262,10 @@ def test_simple_seed_with_disabled(self, clear_test_schema, project): check_table_does_not_exist(project.adapter, "seed_disabled") check_table_does_exist(project.adapter, "seed_tricky") - @pytest.mark.skip( - reason=""" + @pytest.mark.skip(reason=""" Running all the tests in the same schema causes the tests to fail as they all share the same schema across the tests - """ - ) + """) def test_simple_seed_selection(self, clear_test_schema, project): results = run_dbt(["seed", "--select", "seed_enabled"]) assert len(results) == 1 diff --git a/tests/functional/adapter/dbt/test_utils.py b/tests/functional/adapter/dbt/test_utils.py index b5ec8d30..42377414 100644 --- a/tests/functional/adapter/dbt/test_utils.py +++ b/tests/functional/adapter/dbt/test_utils.py @@ -349,12 +349,10 @@ class TestStringLiteral(BaseStringLiteral): pass -@pytest.mark.skip( - reason=""" +@pytest.mark.skip(reason=""" comment here about why this is skipped. https://github.com/dbt-labs/dbt-adapters/blob/f1987d4313cc94bac9906963dff1337ee0bffbc6/dbt/include/global_project/macros/adapters/timestamps.sql#L39 - """ -) + """) class TestCurrentTimestamps(BaseCurrentTimestamps): pass diff --git a/tests/functional/adapter/mssql/test_index.py b/tests/functional/adapter/mssql/test_index.py index 9b9588a7..f4c25484 100644 --- a/tests/functional/adapter/mssql/test_index.py +++ b/tests/functional/adapter/mssql/test_index.py @@ -105,9 +105,7 @@ ) """ -index_count = ( - base_validation - + """ +index_count = base_validation + """ select index_type, count(*) index_count @@ -117,11 +115,8 @@ schema_name='{schema_name}' group by index_type """ -) -other_index_count = ( - base_validation - + """ +other_index_count = base_validation + """ SELECT * FROM @@ -132,7 +127,6 @@ table_view='{schema_name}.{table_name}' """ -) class TestIndex: