Add avro parser to s3 source - #12602
Conversation
…byte into add-avro-parser-to-s3-source
George Claireaux (Phlair)
left a comment
There was a problem hiding this comment.
This is excellent, thank you so much for contributing! 🚀
Most of my comments are minor code optimisations, the main change blocking approval is on supporting nested data types (see my review comment for more details).
# Conflicts: # docs/integrations/sources/s3.md
George Claireaux (Phlair)
left a comment
There was a problem hiding this comment.
Looking excellent, thanks for making the changes!
I've pushed some small additions to enable acceptance tests and update docs.
|
/test connector=connectors/source-s3
|
|
/publish connector=connectors/source-s3
|
|
^ weird, the tests passed in |
|
/publish connector=connectors/source-s3
|
* added MVP avro parser running fine locally * added unit tests for avro * added wip state of avro integration test setup * deleted unused files * added avro specific config path * fixed comments. Added nested record support, simplify code and minor fixes * bumped version + docs update * Added working acceptance tests + format * auto-bump connector version Co-authored-by: George Claireaux <george@claireaux.co.uk> Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
What
This PR aims to add support for avro files for the S3 source. There is currently a limitation to only support avro files with records and not records nested in records
How
The
fastavropackage is used to read the avro files with the included schema. The data types in the schema are converted to comply with json standard data types.I use a generator to yield over the records in the file to save memory.
Both schema and rows use the abstract methods from the super class (
get_inferred_schema&stream_records)Recommended reading order
avro_parser.pyavro_spec.pytest_avro_parser.pyspec.pystream.pyacceptance-test-config.ymlspec.jsonsetup.py🚨 User Impact 🚨
No breaking changes
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret./gradlew :airbyte-integrations:connectors:<name>:integrationTest.README.mdbootstrap.md. See description and examplesdocs/SUMMARY.mddocs/integrations/<source or destination>/<name>.mdincluding changelog. See changelog exampledocs/integrations/README.mdairbyte-integrations/builds.mdAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>command is passing/publishcommand described hereUpdating a connector
Community member or Airbyter
airbyte_secret./gradlew :airbyte-integrations:connectors:<name>:integrationTest.README.mdbootstrap.md. See description and examplesdocs/integrations/<source or destination>/<name>.mdincluding changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>command is passing/publishcommand described hereConnector Generator
-scaffoldin their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplatesthen checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.