potiuk commented on a change in pull request #22416:
URL: https://github.com/apache/airflow/pull/22416#discussion_r831882640
##########
File path: airflow/providers/presto/hooks/presto.py
##########
@@ -27,6 +28,24 @@
from airflow.configuration import conf
from airflow.hooks.dbapi import DbApiHook
from airflow.models import Connection
+from airflow.utils.operator_helpers import AIRFLOW_VAR_NAME_FORMAT_MAPPING,
DEFAULT_FORMAT_PREFIX
+
+
+def generate_presto_client_info() -> str:
+ """Return json string with dag_id, task_id, execution_date and
try_number"""
+ context_var = {
+ format_map['default'].replace(DEFAULT_FORMAT_PREFIX, ''):
os.environ.get(
+ format_map['env_var_format'], ''
+ )
+ 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'],
Review comment:
You should have rn _id here as well.
##########
File path: airflow/providers/presto/hooks/presto.py
##########
@@ -27,6 +28,24 @@
from airflow.configuration import conf
from airflow.hooks.dbapi import DbApiHook
from airflow.models import Connection
+from airflow.utils.operator_helpers import AIRFLOW_VAR_NAME_FORMAT_MAPPING,
DEFAULT_FORMAT_PREFIX
+
+
+def generate_presto_client_info() -> str:
+ """Return json string with dag_id, task_id, execution_date and
try_number"""
+ context_var = {
+ format_map['default'].replace(DEFAULT_FORMAT_PREFIX, ''):
os.environ.get(
+ format_map['env_var_format'], ''
+ )
+ 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'],
Review comment:
You should have ruin _id here as well.
--
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]