SamWheating commented on a change in pull request #18431:
URL: https://github.com/apache/airflow/pull/18431#discussion_r714217459
##########
File path: airflow/sensors/sql.py
##########
@@ -58,21 +61,22 @@ class SqlSensor(BaseSensorOperator):
ui_color = '#7c7287'
def __init__(
- self, *, conn_id, sql, parameters=None, success=None, failure=None,
fail_on_empty=False, **kwargs
+ self, *, conn_id, sql, parameters=None, success=None, failure=None,
fail_on_empty=False, hook_params={}, **kwargs
):
self.conn_id = conn_id
self.sql = sql
self.parameters = parameters
self.success = success
self.failure = failure
self.fail_on_empty = fail_on_empty
+ self.hook_params = hook_params
super().__init__(**kwargs)
def _get_hook(self):
conn = BaseHook.get_connection(self.conn_id)
allowed_conn_type = {
- 'google_cloud_platform',
+ 'gcpbigquery',
Review comment:
I think that if this were the case then it might be easier to
instantiate the hook and then check if its a subclass of `dbApiHook` using
something like
```python
conn = BaseHook.get_connection(self.conn_id)
hook = conn.get_hook(self.hook_params)
if issubclass(hook, DbApiHook):
....
```
So maybe this is isn't supported for all DbApiHooks? Let me see if the
original PR which added this offered any explanation.
--
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]