You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/21 06:05:21 UTC

[GitHub] [airflow] dstandish commented on a diff in pull request #27043: Allow and prefer non-prefixed extra fields for AsanaHook

dstandish commented on code in PR #27043:
URL: https://github.com/apache/airflow/pull/27043#discussion_r1001400016


##########
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:
   yeah i considered that, and it is appealing, but I reasoned that it's not practical because there are frequently subtleties to the way that these params are gotten, idiosyncrasies that require little differences from one provider to another.  some of them are done in the same way, but some not. and, it's just backcompat so, do we really want to add a new method to base hook for deprecated backcompat?  further, even if we did add this to base hook now, we would not be able to use it until provider min version has this method (which would be a while).  alternatively, eventually we could either standardize with appropriate deprecation signaling and make the breaking change for the ones that handle it differently.  another option is we could just get rid of the backcompat altogether, but this would force a lot of users to change their connections, and i don't think we should because of the negative experience for users.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org