Hello! I am using data classes for the flow confi...
# ask-metaflow
g
Hello! I am using data classes for the flow config (to keep code concise). I am able to persist, pass it to other steps and even see it in the UI with the default card. However when using metadata - step.task.data it throws error like this
Copy code
AttributeError: Can't get attribute 'Config' on <module '__main__'>
Is this expected behaviour?
1
v
if you use custom classes as artifacts, those classes need to be available in the environment where you access artifacts e.g in a notebook
if you run tasks on Kubernetes or on Batch, you can access and extract the custom modules through
run.code
. In general if it’s easy to avoid custom classes, it’s easier to deal with native types (e.g namedtuples or dicts instead of custom data classes). Native types are always reproducible without any special actions Custom classes work but working with them requires a bit extra effort
thankyou 1
(note that this is standard Python behavior, nothing Metaflow-specific)
g
Makes perfect sense, thank you!
👍 1