uranusjr commented on code in PR #40478:
URL: https://github.com/apache/airflow/pull/40478#discussion_r1669833018


##########
airflow/serialization/serialized_objects.py:
##########
@@ -259,6 +259,40 @@ def decode_dataset_condition(var: dict[str, Any]) -> 
BaseDataset:
     raise ValueError(f"deserialization not implemented for DAT {dat!r}")
 
 
+def encode_outlet_event_accessor(var: OutletEventAccessor) -> dict[str, Any]:
+    raw_key = var._raw_key
+    if isinstance(raw_key, Dataset):
+        serialized_raw_key = {"__type": DAT.DATASET, "uri": raw_key.uri, 
"extra": raw_key.extra}
+    elif isinstance(raw_key, DatasetAlias):
+        serialized_raw_key = {"__type": DAT.DATASET_ALIAS, "name": 
raw_key.name}
+    elif isinstance(raw_key, str):
+        serialized_raw_key = {"__type": "str", "value": raw_key}

Review Comment:
   Do we need to do this? I think if we implement decoding correctly, this can 
just be a plain string not wrapped in a dict.



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