Skip to content

Commit

Permalink
Bump mypy from 0.942 to 0.961 (dbt-labs#5337)
Browse files Browse the repository at this point in the history
* 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](python/mypy@v0.942...v0.961)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add automated changelog yaml from template

* Fixed deprecated abstractclassmethod caught by new version of mypy

* Fixed deprecated abstractclassmethod not caught by mypy

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Github Build Bot <buildbot@fishtownanalytics.com>
Co-authored-by: Ian Knox <ian.knox@dbtlabs.com>
  • Loading branch information
3 people authored and Axel Goblet committed Sep 16, 2022
1 parent 69aa265 commit 6a88ed6
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .changes/unreleased/Dependencies-20220607-000925.yaml
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 2 additions & 1 deletion core/dbt/adapters/base/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
27 changes: 18 additions & 9 deletions core/dbt/adapters/base/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,14 @@ 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!")

@abc.abstractclassmethod
@classmethod
@abc.abstractmethod
def is_cancelable(cls) -> bool:
raise NotImplementedException("`is_cancelable` is not implemented for this adapter!")

Expand Down Expand Up @@ -734,7 +736,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!")
Expand Down Expand Up @@ -780,7 +783,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.
Expand All @@ -791,7 +795,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.
Expand All @@ -802,7 +807,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.
Expand All @@ -815,7 +821,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.
Expand All @@ -828,7 +835,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.
Expand All @@ -839,7 +847,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.
Expand Down
3 changes: 2 additions & 1 deletion core/dbt/adapters/sql/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion core/dbt/deps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion core/dbt/parser/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ flake8
flaky
freezegun==0.3.12
ipdb
mypy==0.942
mypy==0.961
pip-tools
pre-commit
pytest
Expand Down

0 comments on commit 6a88ed6

Please sign in to comment.