ferruzzi commented on code in PR #27043:
URL: https://github.com/apache/airflow/pull/27043#discussion_r1001065846
##########
airflow/providers/asana/hooks/asana.py:
##########
@@ -27,6 +28,34 @@
from airflow.hooks.base import BaseHook
Review Comment:
I want to say that this is the second time I see you using this and it
should maybe live in airflow.hooks.base as a shared helper method. Is there a
reason not to do it that way?
##########
airflow/providers/asana/hooks/asana.py:
##########
@@ -39,8 +68,21 @@ def __init__(self, conn_id: str = default_conn_name, *args,
**kwargs) -> None:
super().__init__(*args, **kwargs)
self.connection = self.get_connection(conn_id)
extras = self.connection.extra_dejson
- self.workspace = extras.get("extra__asana__workspace") or None
- self.project = extras.get("extra__asana__project") or None
+ self.workspace = self._get_field(extras, "workspace") or None
+ self.project = self._get_field(extras, "project") or None
+
Review Comment:
Similarly here, maybe _get_field should live in BaseHook? It would make the
future cleanup easier.
--
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]