NiklasBeierl commented on code in PR #23136:
URL: https://github.com/apache/airflow/pull/23136#discussion_r872299155
##########
airflow/providers/elasticsearch/log/es_task_handler.py:
##########
@@ -153,7 +153,17 @@ def _group_logs_by_host(self, logs):
grouped_logs = defaultdict(list)
for log in logs:
key = getattr(log, self.host_field, 'default_host')
- grouped_logs[key].append(log)
+
+ try:
+ grouped_logs[key].append(log)
+ except TypeError as e:
+ if not isinstance(key, Hashable):
+ raise ValueError("The host field in all log records needs
to be hashable. "
+ "If you are using filebeat, read here: "
+
"https://github.com/apache/airflow/issues/15613#issuecomment-1104487752") from e
Review Comment:
Get your point, just got set up with breeze to write some proper
documentation.
I have a question:
`airflow.providers.elasticsearch.log.es_task_handler.ElasticsearchTaskHandler`
has `offset_field` and `host_field` paramaters in its constructor. I have a
hard time figuring out where these are being set / come from. Are they
configurable?
--
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]