<#6183 [BUG] Support for user-defined dataclass tr...
# flytekit
c
#6183 [BUG] Support for user-defined dataclass transformers broke in 1.14.0 Issue created by eapolinario Describe the bug Users should be able to register a type transformer for a dataclass hierarchy and expect that such type transformer is used by flytekit to handle objects of that hierarchy. For example, suppose we have this hierarchy, notice the type transformer being registered at the bottom:
Copy code
@dataclass
    class ParentDC:
        ...

    @dataclass
    class ChildDC(ParentDC):
        ...

    class ParentDCTransformer(TypeTransformer[ParentDC]):
        def __init__(self):
            super().__init__("ParentDC Transformer", ParentDC)
       ...


    # Register a type transformer for the parent dataclass
    TypeEngine.register(ParentDCTransformer())
This means that flytekit should be able to use
ParentDCTransformer
to handle instances of both
ParentDC
and
ChildDC
. Keep in mind that we're omitting the definition of
ParentDCTransformer
. This was the case in flytekit<1.14.0. However, flyteorg/flytekit#2815 introduced a regression in which objects of type
ChildDC
are now handled by flytekit dataclass transformer. Expected behavior flytekit users should be able to define custom dataclass type transformers. Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? • Yes Have you read the Code of Conduct? • Yes flyteorg/flyte