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

VersionedSchema -> ObjectSchema #583

Merged
merged 8 commits into from
Jan 29, 2019
Merged

VersionedSchema -> ObjectSchema #583

merged 8 commits into from
Jan 29, 2019

Conversation

jlowin
Copy link
Member

@jlowin jlowin commented Jan 28, 2019

Thanks for contributing to Prefect!

Please describe your work and make sure your PR:

  • adds new tests (if appropriate)
  • updates CHANGELOG.md (if appropriate)
  • updates docstrings for any new functions or function arguments, including docs/outline.toml for API reference docs (if appropriate)

What does this PR change?

  • Removes VersionedSchema. The intent of this class was to create an explicit way of managing schemas across various versions of Prefect, allowing any Prefect version to work with objects from any other version. Unfortunately, it required too much work. To implement cross-version serialization, every single object would have to be reissued for any version of Prefect that introduced a schema change. Instead, we take out the versioning features and continue to use this base class (renamed ObjectSchema) for its useful automatic-deserialization functionality. We leave the __version__ field in place as a useful bit of information
  • Adds tests to make sure the current versions of Prefect can handle objects generated by old versions of Prefect (these should be updated appropriately)
  • Prefect serialization now handle unknown fields gracefully (by ignoring them), ensuring that old versions of Prefect can handle objects generated by new versions of Prefect. Closes Make sure old versions of serializers ignore new fields #582

Why is this PR important?

Once flows are deployed, the version of Prefect used by the Flow may differ from versions of Prefect it communicates with. It's important that objects can be exchanged between the two versions no matter what.

Rather than rely on VersionedSchema to do version introspection, we will do it in the object deserializers
@joshmeek
Copy link

Handling unknowns gracefully by just ignoring them is excellent life advice that extends far beyond the Prefect library.

@jlowin jlowin changed the title Objectschema VersionedSchema -> ObjectSchema Jan 28, 2019
joshmeek
joshmeek previously approved these changes Jan 28, 2019
Copy link

@joshmeek joshmeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, wait on @cicdw input for merging

Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made two absolutely trivial suggested changes (spelling), otherwise this looks good to me!

Co-Authored-By: jlowin <153965+jlowin@users.noreply.github.com>
Co-Authored-By: jlowin <153965+jlowin@users.noreply.github.com>
@jlowin
Copy link
Member Author

jlowin commented Jan 29, 2019

Two spelling errors on "older"... can't be a coincidence.

My keyboard is out to get me.

@jlowin jlowin merged commit fdc7aa3 into master Jan 29, 2019
@jlowin jlowin deleted the objectschema branch January 29, 2019 03:16
cicdw pushed a commit that referenced this pull request Nov 5, 2021
Create sqlite db on startup if it does not exist
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

Successfully merging this pull request may close these issues.

None yet

3 participants