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

fix cdk bug to send legacy format if connector overrides read() #16566

Merged
merged 3 commits into from
Sep 10, 2022

Conversation

brianjlai
Copy link
Contributor

@brianjlai brianjlai commented Sep 10, 2022

What

For connectors like source-faker that override the read() function, they might not be able to support the new list based format that state arrives in. To guard against this, we should continue to send the old format for these types of connectors.

How

While reading in state from source.py we can determine if the connector directly overrides the read function using vars(self.__class__). In that case, we continue to send the flat state object instead of state in the new format

Tested against source-faker which implements its own read() which receives the old state format

@brianjlai brianjlai requested a review from a team as a code owner September 10, 2022 00:22
@github-actions github-actions bot added the CDK Connector Development Kit label Sep 10, 2022
Copy link
Contributor

@evantahler evantahler left a comment

Choose a reason for hiding this comment

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

Thanks!!

# send state in the old format for these connectors, but once all have been upgraded, this block can be removed
# vars(self.__class__) checks if the current class directly overrides the read() function
if "read" in vars(self.__class__):
return state_obj
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should log something warning the connector developer to do… something soon

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, i think i'll jot this down to follow up and add this to the next checkin of per-stream. not sure the best way of surfacing it, maybe a logger message, but not really something we should be surfacing to customers viewing logs

@brianjlai
Copy link
Contributor Author

brianjlai commented Sep 10, 2022

/publish-cdk dry-run=true

🕑 https://github.com/airbytehq/airbyte/actions/runs/3026166663
https://github.com/airbytehq/airbyte/actions/runs/3026166663

@brianjlai
Copy link
Contributor Author

brianjlai commented Sep 10, 2022

/publish-cdk dry-run=false

🕑 https://github.com/airbytehq/airbyte/actions/runs/3026192101
https://github.com/airbytehq/airbyte/actions/runs/3026192101

@brianjlai brianjlai merged commit 037e8ed into master Sep 10, 2022
@brianjlai brianjlai deleted the brian/fix_legacy_format_for_read_override branch September 10, 2022 01:09
robbinhan pushed a commit to robbinhan/airbyte that referenced this pull request Sep 29, 2022
…ytehq#16566)

* fix cdk bug to send legacy format if connector overrides read()

* fix comment

* update changelog and setup.py
jhammarstedt pushed a commit to jhammarstedt/airbyte that referenced this pull request Oct 31, 2022
…ytehq#16566)

* fix cdk bug to send legacy format if connector overrides read()

* fix comment

* update changelog and setup.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants