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

Create a pipeline schema #141

Open
isra17 opened this issue Feb 21, 2022 · 0 comments
Open

Create a pipeline schema #141

isra17 opened this issue Feb 21, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@isra17
Copy link
Member

isra17 commented Feb 21, 2022

Right now we parse each individual parameters, check if it's a dataclass and then create a schema for it. It would be simpler and more robust if we created a schema for all the pipeline parameters and loaded it with the message arguments at once. This would avoid workaround to support extra type at the parameter level (See https://github.com/Flared/saturn/pull/139/files).

ie:

@classmethod
def instancify_args(args: dict[str, object], pipeline: Callable) -> dict[str, object]:
  pipeline_schema = cls.schema_for_pipeline(pipeline)
  return dataclasses.asdict(pipeline_schema.load(args))

This way we let desert deal with optionals, dict, etc.

@isra17 isra17 added the enhancement New feature or request label Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant