The GitHub Actions job "Tests" on airflow.git has failed.
Run started by GitHub user potiuk (triggered by potiuk).

Head commit for run:
0010596c56f7f8b9607e8d98622fb7c1b7edff71 / Ephraim Anierobi 
<[email protected]>
Fix serialization inconsistency in classic Operators (#47870)

* Fix serialization inconsistency in classic Operators

Fix inconsistent serialization in classic Operators

Problem:
- Classic operators serialization was inconsistently including `_operator_name` 
and `label` keys
- This inconsistency caused unnecessary versioning due to dictionary key 
differences
- The dag processor uses LazyDeserializedDAG, where the serialization process 
went through
  SerializedDAG.from_dict before creating the versioning hash. This is where 
the _operator_name and label
  are added for classic operators.
- Other times, SerializedDag.to_dict is used in SerializedDagModel init to 
create versioning hash. In this
  case, the label and _operator_name are not included.

Changes:
- Removed automatic addition of `label` during deserialization (legacy field 
for pre-TaskGroup data)
- Initialized _operator_name to None in SerializedBaseOperator constructor
- Added null check before comparing operator_name with task_type in 
_serialize_node to
  avoid having None as operator_name in classic operator serialization. The 
task_type
  and operator_name is always the same so we chose to keep the task_type.
- Improved task_group's task_to_dict method to handle null operator_name values
- Added test to verify serialization consistency between to_dict and from_dict 
operations

This change helps stabilize versioning of classic operators by removing 
unnecessary
fields from the serialized representation.

* fixup! Fix serialization inconsistency in classic Operators

* op.operator_name now defaults to task_type so no need checking if 
op.operator_name

Report URL: https://github.com/apache/airflow/actions/runs/13917714046

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to