kaxil commented on code in PR #74923:
URL: https://github.com/apache/airflow/pull/74923#discussion_r4341794733
##########
providers/google/src/airflow/providers/google/cloud/log/cloud_logging_task_handler.py:
##########
@@ -279,14 +285,36 @@ def escape_label_value(value: str) -> str:
key: f"labels.{escape_label_key(key)}={escape_label_value(value)}"
for key, value in ti_labels.items()
}
+ if ti_labels.get(LABEL_MAP_INDEX) == "0":
+ # Earlier provider releases wrote no ``map_index`` label for map
index 0.
+ label_conditions[LABEL_MAP_INDEX] = (
+ f"({label_conditions[LABEL_MAP_INDEX]} OR NOT
labels.{LABEL_MAP_INDEX}:*)"
+ )
ti_id_condition = label_conditions.pop(LABEL_TI_ID, None)
# Before 3.4 a cleared task instance gets a new id, which can differ
from the id its logs were written under.
- if ti_id_condition and AIRFLOW_V_3_4_PLUS:
+ match_ti_id = bool(ti_id_condition) and AIRFLOW_V_3_4_PLUS
Review Comment:
The query language docs say string comparisons with `=` ignore letter case,
and this PR switches Airflow 3 reads from `logical_date` to `labels.run_id=`.
So when `match_ti_id` is false, two runs of a Dag whose `run_id`s differ only
in case would read each other's lines. An anchored regex match for `run_id`
(`=~` is case-sensitive), like the `log_path` branch does, or a line under
known limitations would cover it.
--
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]