Skip to content

Source S3: StreamReader and Cursor fixes - #29505

Merged
Catherine Noll (clnoll) merged 2 commits into
masterfrom
source-s3-state-msg-backwards-compatibility
Aug 17, 2023
Merged

Source S3: StreamReader and Cursor fixes#29505
Catherine Noll (clnoll) merged 2 commits into
masterfrom
source-s3-state-msg-backwards-compatibility

Conversation

@clnoll

Copy link
Copy Markdown
Contributor

Fixes a couple of issues identified during end-to-end testing of the state message conversion:

  • _running_migration and _v3_migration_start_datetime were not guaranteed to be set on the S3 cursor so I gave them default values on __init__. Alexandre Girard (@girarda) does it surprise you at all that they weren't set before being accessed?
  • boto3 returns timezone-aware timestamps, but we need them to be timezone-naive, so I cast to UTC then strip the timezone from the LastModified timestamp.
  • A cursor fix that wasn't affecting any tests but was inaccurate.

@github-actions

Copy link
Copy Markdown
Contributor

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.


def __init__(self, stream_config: FileBasedStreamConfig, **_: Any):
super().__init__(stream_config)
self._running_migration = False

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

re: am I surprised they were accessed before being set?
A little bit, but in hindsight, it makes sense since set_initial_state isn't called on full refresh runs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Q: do you know if this was only a problem for full refresh?

either way, the fix looks good

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was happening in incremental syncs, too, but during the first run (before there is a state).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the 3 changes make sense to me. thanks for fixing! :shipit:

@octavia-squidington-iii

Copy link
Copy Markdown
Collaborator

source-s3 test report (commit d3b164d896) - ❌

⏲️ Total pipeline duration: 13mn33s

Step Result
Validate airbyte-integrations/connectors/source-s3/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-s3 docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-s3 test

@clnoll
Catherine Noll (clnoll) force-pushed the source-s3-state-msg-backwards-compatibility branch from d3b164d to 7dc7b3b Compare August 17, 2023 09:30
@octavia-squidington-iii Octavia Squidington III (octavia-squidington-iii) added the area/documentation Improvements or additions to documentation label Aug 17, 2023
@octavia-squidington-iii

Copy link
Copy Markdown
Collaborator

source-s3 test report (commit 7dc7b3b458) - ✅

⏲️ Total pipeline duration: 13mn40s

Step Result
Validate airbyte-integrations/connectors/source-s3/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-s3 docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-s3 test

@clnoll
Catherine Noll (clnoll) merged commit fe005ca into master Aug 17, 2023
@clnoll
Catherine Noll (clnoll) deleted the source-s3-state-msg-backwards-compatibility branch August 17, 2023 10:48
Harry Touloupas (harrytou) pushed a commit to KYVENetwork/airbyte that referenced this pull request Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/s3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants