diff --git a/.github/scripts/verify_version.py b/.github/scripts/verify_version.py index 5d39fb4b5..851034297 100755 --- a/.github/scripts/verify_version.py +++ b/.github/scripts/verify_version.py @@ -9,6 +9,7 @@ Exits 0 on match, 1 on mismatch, 2 on usage error. """ + from __future__ import annotations import re diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index faa7832f8..402e67158 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: @@ -38,7 +38,7 @@ repos: args: - '--all' - repo: 'https://github.com/pycqa/isort' - rev: 5.13.2 + rev: 9.0.0a3 hooks: - id: isort args: @@ -50,7 +50,7 @@ repos: - '--python-version' - '39' - repo: 'https://github.com/psf/black' - rev: 24.8.0 + rev: 26.5.1 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: v2.1.0 hooks: - id: mypy args: diff --git a/tests/functional/adapter/dbt/test_caching.py b/tests/functional/adapter/dbt/test_caching.py index 70d3b9286..429bdbe5e 100644 --- a/tests/functional/adapter/dbt/test_caching.py +++ b/tests/functional/adapter/dbt/test_caching.py @@ -12,12 +12,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 3891fb5ee..1283a6c02 100644 --- a/tests/functional/adapter/dbt/test_hooks.py +++ b/tests/functional/adapter/dbt/test_hooks.py @@ -196,8 +196,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, @@ -211,8 +210,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 c3b1ab53c..078010d6c 100644 --- a/tests/functional/adapter/dbt/test_persist_docs.py +++ b/tests/functional/adapter/dbt/test_persist_docs.py @@ -3,11 +3,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 c85e99f9c..540e42aa5 100644 --- a/tests/functional/adapter/dbt/test_relations.py +++ b/tests/functional/adapter/dbt/test_relations.py @@ -8,12 +8,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 c239cfda2..54927b879 100644 --- a/tests/functional/adapter/dbt/test_simple_seed.py +++ b/tests/functional/adapter/dbt/test_simple_seed.py @@ -163,12 +163,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 @@ -176,12 +174,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 @@ -208,12 +204,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 @@ -228,12 +222,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 @@ -260,12 +252,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 @@ -273,12 +263,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 120f30d9f..6cd2ec926 100644 --- a/tests/functional/adapter/dbt/test_utils.py +++ b/tests/functional/adapter/dbt/test_utils.py @@ -364,12 +364,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 12ba675b4..c972e9a05 100644 --- a/tests/functional/adapter/mssql/test_index.py +++ b/tests/functional/adapter/mssql/test_index.py @@ -106,9 +106,7 @@ ) """ -index_count = ( - base_validation - + """ +index_count = base_validation + """ select index_type, count(*) index_count @@ -118,11 +116,8 @@ schema_name='{schema_name}' group by index_type """ -) -other_index_count = ( - base_validation - + """ +other_index_count = base_validation + """ SELECT * FROM @@ -133,7 +128,6 @@ table_view='{schema_name}.{table_name}' """ -) class TestIndex: diff --git a/tests/functional/adapter/mssql/test_reserved_keywords_schema.py b/tests/functional/adapter/mssql/test_reserved_keywords_schema.py index daa83a4cb..ed944df6b 100644 --- a/tests/functional/adapter/mssql/test_reserved_keywords_schema.py +++ b/tests/functional/adapter/mssql/test_reserved_keywords_schema.py @@ -31,8 +31,7 @@ def project_config_update(self): @pytest.fixture(scope="class") def macros(self): - return { - "generate_schema_name.sql": """ + return {"generate_schema_name.sql": """ {% macro generate_schema_name(custom_schema_name, node) -%} {%- if custom_schema_name -%} {{ custom_schema_name | trim }} @@ -40,8 +39,7 @@ def macros(self): {{ target.schema }} {%- endif -%} {%- endmacro %} -""" - } +"""} @pytest.fixture(autouse=True, scope="class") def cleanup_schema(self, project):