potiuk commented on code in PR #70790:
URL: https://github.com/apache/airflow/pull/70790#discussion_r3694379364


##########
providers/opensearch/src/airflow/providers/opensearch/log/os_task_handler.py:
##########
@@ -103,12 +103,12 @@ def _format_error_detail(error_detail: Any) -> str | None:
 
 
 def _build_log_fields(hit_dict: dict[str, Any]) -> dict[str, Any]:
-    """Filter an OpenSearch hit to ``TASK_LOG_FIELDS`` and ensure 
compatibility with StructuredLogMessage."""
-    fields = {k: v for k, v in hit_dict.items() if k.lower() in 
TASK_LOG_FIELDS or k == "@timestamp"}
+    """Filter an ES hit to ``TASK_LOG_FIELDS`` and ensure compatibility with 
StructuredLogMessage."""

Review Comment:
   This file is the OpenSearch handler, so the docstring should keep naming 
OpenSearch — `main` has "Filter an OpenSearch hit" here. Looks like it came 
across with the copy from the elasticsearch side.
   
   ```suggestion
       """Filter an OpenSearch hit to ``TASK_LOG_FIELDS`` and ensure 
compatibility with StructuredLogMessage."""
   ```
   
   I'll push this one myself so you don't need another round-trip.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



-- 
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]

Reply via email to