Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No serialization of nested pipelines? #1679

Open
jonaslenz opened this issue Sep 5, 2024 · 0 comments
Open

No serialization of nested pipelines? #1679

jonaslenz opened this issue Sep 5, 2024 · 0 comments

Comments

@jonaslenz
Copy link

I try to create a pipeline for a package, including steps for several resources. I want to save the pipeline to be reused later on, but nested steps can not be serialized when calling to_json().
I wonder if one could recursevly call the serialization, or if it is not intended to save nested pipelines as json.

To reproduce:

from frictionless import steps, Pipeline

# create a nested pipeline
pipeline = Pipeline(
    steps= 
    [
     steps.resource_transform(
         name='name',
         steps=[
             steps.field_add(name="fieldadded"),
             steps.table_normalize(),
             ]
         )
     ]
)

# serialization to descriptor works
descriptor_ser = pipeline.to_descriptor()

# nested steps remain unserialized 
descriptor_ser['steps'][0]['steps'][0]
print(type(descriptor_ser['steps'][0]['steps'][0]))

# serialization fails for json export
pipeline.to_json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant