feat: Implement support for Incremental Table on Typeform's FormResponses table#18492
Merged
Conversation
marianogappa
commented
Jul 8, 2024
| @property | ||
| def resolver(self): | ||
| return FormResponsesResolver(table=self) | ||
| return self._resolver |
Contributor
Author
There was a problem hiding this comment.
This is a dangerous anti-pattern we should be aware of. It was creating a brand new resolver every time the property was being referenced (note that by adding @property, you don't call resolver(), but just resolver).
There was a problem hiding this comment.
@marianogappa What's the risk of this usage, out of curiosity? Is there a performance hit?
Contributor
Author
There was a problem hiding this comment.
@dkeyer-twilio oh sorry, I should have been more clear. There's no performance issue.
resolverhere is acting as agetter, and one doesn't expect a getter to create a brand new object.- Objects are stateful. One wouldn't normally expect to set some state on an object and then not have it later.
- In this case, the
.sync()method callsresolver.set_state_client(...), and this method would erase that state.
I think this pattern causes very unintuitive behaviour. I certainly lost an hour on it.
hermanschaaf
approved these changes
Jul 8, 2024
Contributor
|
Approved, but some tests are failing (seems to be due to the introduction of forced keyword arguments) |
kodiakhq Bot
pushed a commit
that referenced
this pull request
Jul 9, 2024
🤖 I have created a release *beep* *boop* --- ## [1.5.0](plugins-source-typeform-v1.4.3...plugins-source-typeform-v1.5.0) (2024-07-09) ### Features * Implement support for Incremental Table on Typeform's FormResponses table ([#18492](#18492)) ([5127370](5127370)) ### Bug Fixes * **deps:** Update dependency cloudquery-plugin-sdk to v0.1.28 ([#18509](#18509)) ([e1cf3ad](e1cf3ad)) * **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.12.0 ([#18448](#18448)) ([a5850e1](a5850e1)) * Fix pagination logic for responses on Typeform plugin. ([#18479](#18479)) ([d0923b0](d0923b0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #18490
Implements support for Incremental Table on Typeform's FormResponses table.
Bumps plugin-sdk-python, which enables Python clients to use a StateClient.
Before:
✓ Code/test-typeform-postgres-sync $ cli sync cloudquery-config ⏱ 10:35:07 Loading spec(s) from cloudquery-config Starting sync for: typeform (grpc@localhost:7777) -> [postgresql (cloudquery/postgresql@v8.0.7)] Sync completed successfully. Resources: 457, Errors: 0, Warnings: 0, Time: 2Enable PR
After:
✓ Code/test-typeform-postgres-sync $ cli sync cloudquery-config ⏱ 10:35:19 Loading spec(s) from cloudquery-config Starting sync for: typeform (grpc@localhost:7777) -> [postgresql (cloudquery/postgresql@v8.0.7)] Sync completed successfully. Resources: 20, Errors: 0, Warnings: 0, Time: 1s