When registering a custom `TypeTransformer` w/ the...
# flytekit
r
When registering a custom
TypeTransformer
w/ the
TypeEngine
, does the module need to be explicitly imported by one of the files containing workflows or tasks in order for it to be picked up? Based on the example of the
NumpyArrayTransformer
it seemed like it, but not sure where that needs to be declared
For context, I was attempting to add a transformer to support
collections.abc.Sequence[T]
as a valid type, and was previously hitting this error:
Copy code
ValueError: Generic Type <class 'collections.abc.Sequence'> not supported currently in Flytekit.
y
yes, it does… because we figured if people were writing a type transformer, they’d also be writing a type.
and when the user imported the type, then that would trigger the transformer loading as well.
but this doesn’t include the case where the type and the transformer are in different libraries
👍 1
to mitigate this issue you can use flytekite’s auto loading plugin behavior.
that is, if you add this entrypoint to your setup.py, then any
import flytekit
would trigger it as well.
does that make sense.
r
Yep that makes sense -- we'll need to figure out a slightly different way to do that since we're using Bazel
https://github.com/flyteorg/flyte/issues/2823 (cc @Ketan (kumare3) @Eduardo Apolinario (eapolinario) based on our earlier discussion)
e
Great, thank you. We're going to prioritize this for the upcoming release.
🙏 1
156 Views