jhgoebbert commented on code in PR #62121:
URL: https://github.com/apache/airflow/pull/62121#discussion_r2872191021
##########
airflow-core/src/airflow/config_templates/airflow_local_settings.py:
##########
@@ -279,35 +279,29 @@ def _default_conn_name_from(mod_path, hook_name):
)
remote_task_handler_kwargs = {}
elif ELASTICSEARCH_HOST:
- ELASTICSEARCH_END_OF_LOG_MARK: str =
conf.get_mandatory_value("elasticsearch", "END_OF_LOG_MARK")
- ELASTICSEARCH_FRONTEND: str =
conf.get_mandatory_value("elasticsearch", "frontend")
+ from airflow.providers.elasticsearch.log.es_task_handler import
ElasticsearchRemoteLogIO
+
ELASTICSEARCH_WRITE_STDOUT: bool = conf.getboolean("elasticsearch",
"WRITE_STDOUT")
ELASTICSEARCH_WRITE_TO_ES: bool = conf.getboolean("elasticsearch",
"WRITE_TO_ES")
ELASTICSEARCH_JSON_FORMAT: bool = conf.getboolean("elasticsearch",
"JSON_FORMAT")
- ELASTICSEARCH_JSON_FIELDS: str =
conf.get_mandatory_value("elasticsearch", "JSON_FIELDS")
ELASTICSEARCH_TARGET_INDEX: str =
conf.get_mandatory_value("elasticsearch", "TARGET_INDEX")
ELASTICSEARCH_HOST_FIELD: str =
conf.get_mandatory_value("elasticsearch", "HOST_FIELD")
ELASTICSEARCH_OFFSET_FIELD: str =
conf.get_mandatory_value("elasticsearch", "OFFSET_FIELD")
+ ELASTICSEARCH_LOG_ID_TEMPLATE: str =
conf.get_mandatory_value("elasticsearch", "LOG_ID_TEMPLATE")
+
+ REMOTE_TASK_LOG = ElasticsearchRemoteLogIO(
+ host=ELASTICSEARCH_HOST,
+ target_index=ELASTICSEARCH_TARGET_INDEX,
+ write_stdout=ELASTICSEARCH_WRITE_STDOUT,
+ write_to_es=ELASTICSEARCH_WRITE_TO_ES,
+ offset_field=ELASTICSEARCH_OFFSET_FIELD,
+ host_field=ELASTICSEARCH_HOST_FIELD,
+ base_log_folder=BASE_LOG_FOLDER,
+ delete_local_copy=delete_local_copy,
+ json_format=ELASTICSEARCH_JSON_FORMAT,
+ log_id_template=ELASTICSEARCH_LOG_ID_TEMPLATE,
+ )
Review Comment:
The constructor of `ElasticsearchTaskHandler` requires `json_fields` to be
set here
https://github.com/apache/airflow/blob/main/providers/elasticsearch/src/airflow/providers/elasticsearch/log/es_task_handler.py#L169
It seems to me as if this is missing here.
--
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]