Lcrs123 commented on issue #51016:
URL: https://github.com/apache/airflow/issues/51016#issuecomment-2935097031

   > I don't think we want people to overwrite the serializer for a primitive.
   
   I think the developer's goal usually isn't to change the seralizer for a 
primitive itself it's just to define de/serialize methods for his custom type 
that inherits from a primitive and have airflow respect those. 
   
   I still haven't found a solution for a class we have that inherits from str, 
other than removing the inheritance and manually defining all used str methods 
again, since airflow will always see first that it's an instance of a primitive 
and follow the path for the default serializers.
   
   If you're not careful, once it get's to deserializing, it seems to work ok, 
until you try to call any method you defined in your class and realize that 
it's not really an instance of it, but just a regular string.
   
   As it stand's today, airflow doesn't support the serialization and 
deserialization of custom types that inherit from primitives. 
   
   I understand that maybe this goes a little beyond the scope of this issue 
and that it may have other effects, but I think this is a common use case that 
can catch others by surprise, specially once it get's to deserializing.


-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to