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

feat: new dataclasses version of python protocol, temporarily alongside pydantic version #80

Closed
wants to merge 15 commits into from

Conversation

erohmensing
Copy link
Contributor

@erohmensing erohmensing commented Jun 7, 2024

What

Generate a second version of the python protocol, by generating dataclasses instead of pydantic models. Publish this class to airbyte_protocol_models_dc, a temporary package.

How

Publish 2 packages side by side for now. This gives us the ability to see how things go in production without doing a hard cutover, and migrate pieces off of the pydantic version incrementally (the CDK first).

We are still using datamodel-codegen to create the models from jsonschema, but we use a different output type and an updated version of the library for generation.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @erohmensing and the rest of your teammates on Graphite Graphite

@erohmensing erohmensing changed the title generate dataclasses version of python protocol feat: new dataclasses version of python protocol, temporarily alongside pydantic version Jun 10, 2024
@erohmensing erohmensing requested a review from natikgadzhi June 10, 2024 15:49
@erohmensing erohmensing marked this pull request as ready for review June 10, 2024 15:49
Copy link

@natikgadzhi natikgadzhi left a comment

Choose a reason for hiding this comment

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

I haven't tested this, but it looks great. Let's merge and ship this!

docker run --rm \
--volume "${ROOT_DIR}:/${ROOT_DIR_NAME}" \
--workdir "/${ROOT_DIR_NAME}" \
python:3.8 "/${ROOT_DIR_NAME}/protocol-models/bin/generate-python-dataclasses.sh"

Choose a reason for hiding this comment

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

Should we use 3.10 here? Not sure if that would change anything at all.

@@ -0,0 +1,19 @@
Copyright (c) 2020 Airbyte

Choose a reason for hiding this comment

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

Suggested change
Copyright (c) 2020 Airbyte
Copyright (c) 2024 Airbyte

"License :: OSI Approved :: MIT License",
# Python Version Support
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.8",

Choose a reason for hiding this comment

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

Nit: We could add more python versions.

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.

2 participants