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/04/19 00:06:21 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #23061: Make presto and trino compatible with airflow 2.1

uranusjr commented on code in PR #23061:
URL: https://github.com/apache/airflow/pull/23061#discussion_r852494679


##########
airflow/providers/presto/hooks/presto.py:
##########
@@ -47,14 +47,8 @@ def generate_presto_client_info() -> str:
         )
         for format_map in AIRFLOW_VAR_NAME_FORMAT_MAPPING.values()
     }
-    task_info = {
-        'dag_id': context_var['dag_id'],
-        'task_id': context_var['task_id'],
-        'execution_date': context_var['execution_date'],
-        'try_number': context_var['try_number'],
-        'dag_run_id': context_var['dag_run_id'],
-        'dag_owner': context_var['dag_owner'],
-    }
+    task_info_keys = ['dag_id', 'task_id', 'execution_date', 'try_number', 'dag_run_id', 'dag_owner']
+    task_info = {k: context_var.get(k, '') for k in task_info_keys}

Review Comment:
   Let’s only use `get` for `try_number` (which is causing the issue, other keys all exist from what I know). This makes debugging 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: commits-unsubscribe@airflow.apache.org

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