kazanzhy commented on code in PR #25299:
URL: https://github.com/apache/airflow/pull/25299#discussion_r930317248
##########
airflow/providers/apache/pinot/hooks/pinot.py:
##########
@@ -275,7 +275,7 @@ def get_uri(self) -> str:
endpoint = conn.extra_dejson.get('endpoint', 'query/sql')
return f'{conn_type}://{host}/{endpoint}'
- def get_records(self, sql: str, parameters: Optional[Union[Iterable,
Mapping]] = None) -> Any:
+ def get_records(self, sql: Union[str, List[str]], parameters:
Optional[Any] = None, **kwargs) -> Any:
Review Comment:
I spent a lot of time trying to find out the type of `parameters` parameter.
In OracleHook.callproc() we have the `len(parameters)` situation, therefore
it type is `parameters: Optional[Union[List, Dict]]`.
But for the other cases, this parameter is passing to many `.execute()`
methods and it's hard to figure out what types these libraries allow.
For example in SQLAlchemy in a few places, there is the following comment.
```
:param parameters: Dictionary, tuple, or list of parameters being
passed to the ``execute()`` or ``executemany()`` method of the
DBAPI ``cursor``
```
Based on this information I decided to generalize it to `parameters:
Optional[Union[Iterable, Mapping]]`. Probably, it might be `Union[Sequence,
Mapping]`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]