Skip to content

Commit

Permalink
make updates from running linters and typecheckers
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Apr 26, 2024
1 parent 70e2e00 commit b7e3cec
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dbt/adapters/spark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
from dbt.include import spark

Plugin = AdapterPlugin(
adapter=SparkAdapter, credentials=SparkCredentials, include_path=spark.PACKAGE_PATH # type: ignore
adapter=SparkAdapter, credentials=SparkCredentials, include_path=spark.PACKAGE_PATH
)
2 changes: 1 addition & 1 deletion dbt/adapters/spark/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SparkColumn(dbtClassMixin, Column):
def translate_type(cls, dtype: str) -> str:
return dtype

def can_expand_to(self: Self, other_column: Self) -> bool: # type: ignore
def can_expand_to(self: Self, other_column: Self) -> bool:
"""returns True if both columns are strings"""
return self.is_string() and other_column.is_string()

Expand Down
6 changes: 3 additions & 3 deletions dbt/adapters/spark/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ class SparkConnectionMethod(StrEnum):
@dataclass
class SparkCredentials(Credentials):
host: Optional[str] = None
schema: Optional[str] = None # type: ignore
schema: Optional[str] = None
method: SparkConnectionMethod = None # type: ignore
database: Optional[str] = None # type: ignore
database: Optional[str] = None
driver: Optional[str] = None
cluster: Optional[str] = None
endpoint: Optional[str] = None
Expand Down Expand Up @@ -568,7 +568,7 @@ def open(cls, connection: Connection) -> Connection:
return connection

@classmethod
def data_type_code_to_name(cls, type_code: Union[type, str]) -> str: # type: ignore
def data_type_code_to_name(cls, type_code: Union[type, str]) -> str:
"""
:param Union[type, str] type_code: The sql to execute.
* type_code is a python type (!) in pyodbc https://github.com/mkleehammer/pyodbc/wiki/Cursor#description, and a string for other spark runtimes.
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/spark/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def convert_time_type(cls, agate_table: agate.Table, col_idx: int) -> str:
def convert_datetime_type(cls, agate_table: agate.Table, col_idx: int) -> str:
return "timestamp"

def quote(self, identifier: str) -> str: # type: ignore
def quote(self, identifier: str) -> str:
return "`{}`".format(identifier)

def _get_relation_information(self, row: agate.Row) -> RelationInfo:
Expand Down
1 change: 1 addition & 0 deletions tests/unit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Note that all imports should be inside the functions to avoid import/mocking
issues.
"""

import string
import os
from unittest import mock
Expand Down

0 comments on commit b7e3cec

Please sign in to comment.