SamWheating commented on a change in pull request #18394:
URL: https://github.com/apache/airflow/pull/18394#discussion_r712581445
##########
File path: airflow/models/connection.py
##########
@@ -308,7 +311,7 @@ def get_hook(self):
"Could not import %s when discovering %s %s", hook_class_name,
hook_name, package_name
)
raise
- return hook_class(**{conn_id_param: self.conn_id})
+ return hook_class(**{conn_id_param: self.conn_id}, **hook_params)
Review comment:
I think my suggested changes are actually incorrect - `conn_id_param` is
a variable, not a `"conn_id_param"` string.
The dict unpacking allows the parameter passed to `hook_class()` to change,
since the Hooks all take different parameters to define the connection they
should be using (`gcp_conn_id`, `aws_conn_id`, `airbyte_conn_id`, etc).
Sorry for the confusion, but you should ignore my initial suggestion and
return this code to its original state 😄
--
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]