millin commented on a change in pull request #15469:
URL: https://github.com/apache/airflow/pull/15469#discussion_r618497591
##########
File path: airflow/providers/elasticsearch/log/es_task_handler.py
##########
@@ -129,10 +129,14 @@ def _group_logs_by_host(logs):
key = getattr(log, 'host', 'default_host')
grouped_logs[key].append(log)
- # return items sorted by timestamp.
- result = sorted(grouped_logs.items(), key=lambda kv: getattr(kv[1][0],
'message', '_'))
+ # return items sorted by asctime.
+ def sorter(log):
+ return getattr(log, 'asctime', '_')
- return result
+ for host_logs in grouped_logs.values():
+ host_logs.sort(key=sorter)
Review comment:
I'm not very familiar with ElasticSearch, I'll try to research
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]