-
Notifications
You must be signed in to change notification settings - Fork 8
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: add version with dataclasses #91
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change looks good but airbyte_protocol_dataclasses
deserves a readme explaining that it's just an alternate implementation of the protocol in python using dataclasses because they have less performance overhead than pydantic
"Topic :: Scientific/Engineering", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"License :: OSI Approved :: MIT License", | ||
# Python Version Support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.10 too, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added up to 3.11
--input "$ROOT_DIR/$YAML_DIR/$filename_wo_ext.yaml" \ | ||
--output "$ROOT_DIR/$OUTPUT_DIR/$filename_wo_ext.py" \ | ||
--output-model-type dataclasses.dataclass \ | ||
--target-python-version 3.10 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we target 3.8 since that's the minimum version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave 3.8 support sincee 3.8 and 3.10 version are identical.
What
Follow up airbytehq/airbyte#44026
Generate another version of the python protocol, by generating dataclasses instead of
pydantic.v2
BaseModel
.Resolving https://github.com/airbytehq/airbyte-internal-issues/issues/8945
Reason: increase python CDK performance in airbytehq/airbyte#44026
Note
Dataclass version will have different package name :
airbyte_protocol_dataclasses
, so we can import bothpydantic
anddataclasses
versions at the same timeHow
Use
datamodel-codegen
to create the models from jsonschema, with flag--output-model-type dataclasses.dataclass