-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
CDK: Add base pydantic model for connector config and schemas #8485
Conversation
|
f2cfb49
to
0b7674e
Compare
@@ -186,6 +185,7 @@ def _read_incremental( | |||
for record_counter, record_data in enumerate(records, start=1): | |||
yield self._as_airbyte_record(stream_name, record_data) | |||
stream_state = stream_instance.get_updated_state(stream_state, record_data) | |||
checkpoint_interval = stream_instance.state_checkpoint_interval |
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.
this fixes issue with dynamic behaviour of state_checkpoint_interval (may change after read call)
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.
Really nice.
/publish-cdk dry-run=false
|
…ehq#8485) * add base spec model * fix usage of state_checkpoint_interval in case it is dynamic * add schema base models, fix spelling, signatures and polishing Co-authored-by: Eugene Kulak <kulak.eugene@gmail.com>
What
When we use pydantic model instead of spec.json we often duplicate the same piece of logic every time. It would be nice to have some common base model provided by CDK that will:
How
Define
config.BaseConfig
andsources.utils.schema_models.BaseSchemaModel
classes that can be used instead ofpydantic.BaseModel
Recommended reading order
x.java
y.python
🚨 User Impact 🚨
Doesn't change existing behavior. Existing connectors need an update to start using the piece of code added in this PR.
Pre-merge Checklist
Expand the relevant checklist and delete the others.