Skip to content

Commit

Permalink
Merge pull request #570 from laughingman7743/fix_type_hints
Browse files Browse the repository at this point in the history
Fix type hints
  • Loading branch information
laughingman7743 authored Dec 28, 2024
2 parents 2ca949b + 5b20fcf commit b8fac65
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyathena/async_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _collect_result_set(self, query_id: str) -> AthenaResultSet:
def execute(
self,
operation: str,
parameters: Optional[Dict[str, Any]] = None,
parameters: Optional[Union[Dict[str, Any], List[str]]] = None,
work_group: Optional[str] = None,
s3_staging_dir: Optional[str] = None,
cache_size: Optional[int] = 0,
Expand Down
5 changes: 4 additions & 1 deletion pyathena/pandas/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ def execute(
return self

def executemany(
self, operation: str, seq_of_parameters: List[Optional[Dict[str, Any]]], **kwargs
self,
operation: str,
seq_of_parameters: List[Optional[Union[Dict[str, Any], List[str]]]],
**kwargs,
) -> None:
for parameters in seq_of_parameters:
self.execute(operation, parameters, **kwargs)
Expand Down
5 changes: 4 additions & 1 deletion pyathena/spark/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ def close(self) -> None:
self._terminate_session()

def executemany(
self, operation: str, seq_of_parameters: List[Optional[Dict[str, Any]]], **kwargs
self,
operation: str,
seq_of_parameters: List[Optional[Union[Dict[str, Any], List[str]]]],
**kwargs,
) -> None:
raise NotSupportedError

Expand Down
2 changes: 1 addition & 1 deletion pyathena/sqlalchemy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class _HashableDict(dict): # type: ignore
def __hash__(self):
def __hash__(self): # type: ignore
return hash(tuple(sorted(self.items())))

0 comments on commit b8fac65

Please sign in to comment.