From c4a232531c46f1e33293360cf1e3a3ac7432a61a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 00:09:00 +0000 Subject: [PATCH 1/4] Bump mypy from 0.942 to 0.961 Bumps [mypy](https://github.com/python/mypy) from 0.942 to 0.961. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.942...v0.961) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 1b53a802ee1..d99190d5753 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,7 +4,7 @@ flake8 flaky freezegun==0.3.12 ipdb -mypy==0.942 +mypy==0.961 pip-tools pre-commit pytest From 5b9bfb6b9872a42dfae18c0edfa9621836013056 Mon Sep 17 00:00:00 2001 From: Github Build Bot Date: Tue, 7 Jun 2022 00:09:28 +0000 Subject: [PATCH 2/4] Add automated changelog yaml from template --- .changes/unreleased/Dependencies-20220607-000925.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changes/unreleased/Dependencies-20220607-000925.yaml diff --git a/.changes/unreleased/Dependencies-20220607-000925.yaml b/.changes/unreleased/Dependencies-20220607-000925.yaml new file mode 100644 index 00000000000..80095fc6f46 --- /dev/null +++ b/.changes/unreleased/Dependencies-20220607-000925.yaml @@ -0,0 +1,7 @@ +kind: Dependencies +body: "Bump mypy from 0.942 to 0.961" +time: 2022-06-07T00:09:25.000000-05:00 +custom: + Author: dependabot[bot] + Issue: "4904" + PR: "5337" From 2729093328d771c5ba139966b0fadb77e78fa75a Mon Sep 17 00:00:00 2001 From: Ian Knox Date: Tue, 5 Jul 2022 14:20:24 -0500 Subject: [PATCH 3/4] Fixed deprecated abstractclassmethod caught by new version of mypy --- core/dbt/adapters/base/impl.py | 24 ++++++++++++++++-------- core/dbt/deps/base.py | 3 ++- core/dbt/parser/base.py | 3 ++- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/core/dbt/adapters/base/impl.py b/core/dbt/adapters/base/impl.py index aef00e80d4b..7024b64a537 100644 --- a/core/dbt/adapters/base/impl.py +++ b/core/dbt/adapters/base/impl.py @@ -439,7 +439,8 @@ def date_function(cls) -> str: """Get the date function used by this adapter's database.""" raise NotImplementedException("`date_function` is not implemented for this adapter!") - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def is_cancelable(cls) -> bool: raise NotImplementedException("`is_cancelable` is not implemented for this adapter!") @@ -734,7 +735,8 @@ def drop_schema(self, relation: BaseRelation): raise NotImplementedException("`drop_schema` is not implemented for this adapter!") @available - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def quote(cls, identifier: str) -> str: """Quote the given identifier, as appropriate for the database.""" raise NotImplementedException("`quote` is not implemented for this adapter!") @@ -780,7 +782,8 @@ def quote_seed_column(self, column: str, quote_config: Optional[bool]) -> str: # Conversions: These must be implemented by concrete implementations, for # converting agate types into their sql equivalents. ### - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def convert_text_type(cls, agate_table: agate.Table, col_idx: int) -> str: """Return the type in the database that best maps to the agate.Text type for the given agate table and column index. @@ -791,7 +794,8 @@ def convert_text_type(cls, agate_table: agate.Table, col_idx: int) -> str: """ raise NotImplementedException("`convert_text_type` is not implemented for this adapter!") - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def convert_number_type(cls, agate_table: agate.Table, col_idx: int) -> str: """Return the type in the database that best maps to the agate.Number type for the given agate table and column index. @@ -802,7 +806,8 @@ def convert_number_type(cls, agate_table: agate.Table, col_idx: int) -> str: """ raise NotImplementedException("`convert_number_type` is not implemented for this adapter!") - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def convert_boolean_type(cls, agate_table: agate.Table, col_idx: int) -> str: """Return the type in the database that best maps to the agate.Boolean type for the given agate table and column index. @@ -815,7 +820,8 @@ def convert_boolean_type(cls, agate_table: agate.Table, col_idx: int) -> str: "`convert_boolean_type` is not implemented for this adapter!" ) - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def convert_datetime_type(cls, agate_table: agate.Table, col_idx: int) -> str: """Return the type in the database that best maps to the agate.DateTime type for the given agate table and column index. @@ -828,7 +834,8 @@ def convert_datetime_type(cls, agate_table: agate.Table, col_idx: int) -> str: "`convert_datetime_type` is not implemented for this adapter!" ) - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def convert_date_type(cls, agate_table: agate.Table, col_idx: int) -> str: """Return the type in the database that best maps to the agate.Date type for the given agate table and column index. @@ -839,7 +846,8 @@ def convert_date_type(cls, agate_table: agate.Table, col_idx: int) -> str: """ raise NotImplementedException("`convert_date_type` is not implemented for this adapter!") - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def convert_time_type(cls, agate_table: agate.Table, col_idx: int) -> str: """Return the type in the database that best maps to the agate.TimeDelta type for the given agate table and column index. diff --git a/core/dbt/deps/base.py b/core/dbt/deps/base.py index bd8af68c3a8..1557b0d7a35 100644 --- a/core/dbt/deps/base.py +++ b/core/dbt/deps/base.py @@ -103,7 +103,8 @@ def get_subdirectory(self): class UnpinnedPackage(Generic[SomePinned], BasePackage): - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def from_contract(cls, contract): raise NotImplementedError diff --git a/core/dbt/parser/base.py b/core/dbt/parser/base.py index 5e04a3b2a94..2ff77fede5b 100644 --- a/core/dbt/parser/base.py +++ b/core/dbt/parser/base.py @@ -112,7 +112,8 @@ def __init__( manifest=manifest, config=root_project, component="alias" ) - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def get_compiled_path(cls, block: ConfiguredBlockType) -> str: pass From da6dc6fa7449e5146a6087cf42422a5a8fdb2bad Mon Sep 17 00:00:00 2001 From: Ian Knox Date: Tue, 5 Jul 2022 14:23:15 -0500 Subject: [PATCH 4/4] Fixed deprecated abstractclassmethod not caught by mypy --- core/dbt/adapters/base/connections.py | 3 ++- core/dbt/adapters/base/impl.py | 3 ++- core/dbt/adapters/sql/connections.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/dbt/adapters/base/connections.py b/core/dbt/adapters/base/connections.py index 4fd3c4f8fe4..ec446d5baee 100644 --- a/core/dbt/adapters/base/connections.py +++ b/core/dbt/adapters/base/connections.py @@ -166,7 +166,8 @@ def cancel_open(self) -> Optional[List[str]]: "`cancel_open` is not implemented for this adapter!" ) - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def open(cls, connection: Connection) -> Connection: """Open the given connection on the adapter and return it. diff --git a/core/dbt/adapters/base/impl.py b/core/dbt/adapters/base/impl.py index 7024b64a537..18d3af5ebff 100644 --- a/core/dbt/adapters/base/impl.py +++ b/core/dbt/adapters/base/impl.py @@ -434,7 +434,8 @@ def cache_renamed( ### # Abstract methods for database-specific values, attributes, and types ### - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def date_function(cls) -> str: """Get the date function used by this adapter's database.""" raise NotImplementedException("`date_function` is not implemented for this adapter!") diff --git a/core/dbt/adapters/sql/connections.py b/core/dbt/adapters/sql/connections.py index 681a5a96f14..08cd07dbf8b 100644 --- a/core/dbt/adapters/sql/connections.py +++ b/core/dbt/adapters/sql/connections.py @@ -77,7 +77,8 @@ def add_query( return connection, cursor - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def get_response(cls, cursor: Any) -> AdapterResponse: """Get the status of the cursor.""" raise dbt.exceptions.NotImplementedException(