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 as empty object
   
   
https://github.com/apache/airflow/blob/d370362d147ecbbcb699acea3aa33f0be5e24c16/airflow/models/connection.py#L396-L410
   
   Instead of 
   ```json
   {
     "catalog": "hive", 
     "protocol": "https", 
     "session_properties": 
"{'hive.insert_existing_partitions_behavior':'OVERWRITE', 
'scale_writers':'true','task_writer_count':'1','writer_min_size':'32MB'}"
   }
   ```
   user should provide 
   
   ```json
   {
     "catalog": "hive", 
     "protocol": "https", 
     "session_properties": {
       "hive.insert_existing_partitions_behavior": "OVERWRITE", 
       "scale_writers": true, 
       "task_writer_count": 1, 
       "writer_min_size": "32MB"
     }
   }
   ```
   



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

Reply via email to