jason810496 commented on code in PR #53821:
URL: https://github.com/apache/airflow/pull/53821#discussion_r2366195899
##########
providers/elasticsearch/src/airflow/providers/elasticsearch/log/es_task_handler.py:
##########
@@ -606,6 +584,7 @@ class ElasticsearchRemoteLogIO(LoggingMixin): # noqa: D101
offset_field: str = "offset"
write_to_es: bool = False
base_log_folder: Path = attrs.field(converter=Path)
+ log_id_template: str =
"{dag_id}-{task_id}-{run_id}-{map_index}-{try_number}"
Review Comment:
Would it be better to get from `conf` instead of hard coded here?
##########
providers/elasticsearch/tests/unit/elasticsearch/log/test_es_task_handler.py:
##########
@@ -70,9 +76,10 @@ def get_ti(dag_id, task_id, logical_date,
create_task_instance):
class TestElasticsearchTaskHandler:
DAG_ID = "dag_for_testing_es_task_handler"
TASK_ID = "task_for_testing_es_log_handler"
+ RUN_ID = "run_for_testing_es_log_handler"
LOGICAL_DATE = datetime(2016, 1, 1)
- LOG_ID = f"{DAG_ID}-{TASK_ID}-2016-01-01T00:00:00+00:00-1"
- JSON_LOG_ID =
f"{DAG_ID}-{TASK_ID}-{ElasticsearchTaskHandler._clean_date(LOGICAL_DATE)}-1"
+ LOG_ID = f"{DAG_ID}-{TASK_ID}-{RUN_ID}--1-1"
Review Comment:
nit: How about using str format to show the LOG_ID for better readability?
```suggestion
LOG_ID = f"{DAG_ID}-{TASK_ID}-{RUN_ID}-{MAP_INDEX}-{TRY_NUM}"
```
--
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]