Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump mypy from 0.942 to 0.961 #5337

Merged
merged 4 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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