ashb commented on a change in pull request #15581:
URL: https://github.com/apache/airflow/pull/15581#discussion_r633368587
##########
File path: airflow/hooks/dbapi.py
##########
@@ -166,30 +166,51 @@ def run(self, sql, autocommit=False, parameters=None):
:type autocommit: bool
:param parameters: The parameters to render the SQL query with.
:type parameters: dict or iterable
+ :param handler: The result handler which is called after each
statement.
+ :type handler: Callable which gets a cursor object.
Review comment:
```suggestion
:type handler: callable
```
Type should be a bare type, not a description
##########
File path: airflow/hooks/dbapi.py
##########
@@ -166,30 +166,51 @@ def run(self, sql, autocommit=False, parameters=None):
:type autocommit: bool
:param parameters: The parameters to render the SQL query with.
:type parameters: dict or iterable
+ :param handler: The result handler which is called after each
statement.
Review comment:
```suggestion
:param handler: The result handler which is called with the result
of each statement.
```
##########
File path: tests/providers/oracle/operators/test_oracle.py
##########
@@ -40,5 +40,7 @@ def test_execute(self, mock_run):
task_id=task_id,
)
operator.execute(context=context)
-
- mock_run.assert_called_once_with(sql, autocommit=autocommit,
parameters=parameters)
+ assert len(mock_run.mock_calls) == 1
+ assert mock_run.mock_calls[0].args[1] == sql
Review comment:
Oh, `.args` doesn't exist on Py3.6
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]