sjyangkevin commented on issue #56215:
URL: https://github.com/apache/airflow/issues/56215#issuecomment-3349619739

   I just had a deeper look into the codebase and the document. I think the 
change to function signature for the registered deserializers might not break 
the custom `deserialize` call. Meanwhile, I am trying to set up an example and 
test it. Below is my finding and feel free to correct me (or I might correct 
myself after running a concrete example). It would also be helpful if you had a 
breaking custom deserializer example (or a sample DAG) and I can take this to 
troubleshoot as well.
   
   ### 1. The function signature of the deserialize method
   
https://github.com/apache/airflow/blob/a6506f2b4681a0eceddfc68f82ebaa51c7cb85bc/airflow-core/src/airflow/serialization/serde.py#L196
   
   ### 2. The registered deserializer, where the `cls` is passed instead of 
`classname`.
   
https://github.com/apache/airflow/blob/9d4447d2784e560551b8d870e485fc24994858c9/airflow-core/src/airflow/serialization/serde.py#L265-L267
   
   ### 3. If the data being passed has a custom deserializer, and does not 
match to any registered deserializer, the following will be used
   
https://github.com/apache/airflow/blob/9d4447d2784e560551b8d870e485fc24994858c9/airflow-core/src/airflow/serialization/serde.py#L272-L274
   
   If a custom deserialization is needed and if the class that the data belongs 
to doesn't match to any registered deserializers. The case 3 should be invoked. 
In this case, `getattr(cls, "deserialize")` gets the `deserialize` method from 
the class, taking the official document, the `deserialize` method from the 
`Foo` class 
(https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/serializers.html#airflow-object).
   
   
https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/serializers.html#registered
 for me looks more like an example shows how the serializer/deserializer is 
registered in airflow, but not the instruction for defining a custom 
serializer/deserializer in user code. However, this need to be updated to 
reflect the latest changes.
   
   I will follow up back to this issue once I get my environment built and able 
to run tests.


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