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/17 17:53:49 UTC

[GitHub] [airflow] Taragolis commented on a diff in pull request #27095: Allow session properties for trino connection

Taragolis commented on code in PR #27095:
URL: https://github.com/apache/airflow/pull/27095#discussion_r997353425


##########
airflow/providers/trino/hooks/trino.py:
##########
@@ -145,6 +147,7 @@ def get_conn(self) -> Connection:
             # type: ignore[func-returns-value]
             isolation_level=self.get_isolation_level(),
             verify=_boolify(extra.get('verify', True)),
+            session_properties=ast.literal_eval(session_properties) if session_properties else None,

Review Comment:
   I don't think it even make sense to deserialise `extra` because in Connection (airflow core) this field expected as JSON Object  or otherwise it parse an empty object
   
   https://github.com/apache/airflow/blob/d370362d147ecbbcb699acea3aa33f0be5e24c16/airflow/models/connection.py#L396-L410



##########
airflow/providers/trino/hooks/trino.py:
##########
@@ -145,6 +147,7 @@ def get_conn(self) -> Connection:
             # type: ignore[func-returns-value]
             isolation_level=self.get_isolation_level(),
             verify=_boolify(extra.get('verify', True)),
+            session_properties=ast.literal_eval(session_properties) if session_properties else None,

Review Comment:
   I don't think it even make sense to deserialise `extra` because in Connection (airflow core) this field expected as JSON Object  or otherwise it parse as empty object
   
   https://github.com/apache/airflow/blob/d370362d147ecbbcb699acea3aa33f0be5e24c16/airflow/models/connection.py#L396-L410



-- 
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