-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
🎉 New Source: Gutendex API [low-code CDK] #18075
Conversation
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.
Some commments! thanks for the contribution
sort: | ||
type: string | ||
description: (Optional) Use this to sort books - ascending for Project Gutenberg ID numbers from lowest to highest, descending for IDs highest to lowest, or popular (the default) for most popular to least popular by number of downloads. | ||
pattern: ^(ascending|descending|popular)$ | ||
examples: | ||
- ascending | ||
- descending | ||
- popular |
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.
Why this is a parameter in the configuration and not used to make the connector incremental?
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.
sort
is a query parameter that is used to sort the results. I'm not exactly sure how that can be used to make the connector incremental.
After going through the API response, what I noticed is that it only returns a maximum of 32 books per response (even though the total books are more than that) and for the next 32 records, we need to make a request with a query param of page=2
and so on.
So, in order to read data about all the books, I implemented pagination by using a DefaultPaginator to read each and every record, instead of just the first 32 records.
Attaching a video demonstrating the same (the parameters I chose in config.json returned 147 books - I purposely formed a query that returned a small number of books to make the video short - and all the 147 records were read. Similarly, all the records are read even if the query returns 50000+ books - thanks to DefaultPaginator)
Gutendex.Controller.with.Pagination.mp4
airbyte-integrations/connectors/source-gutendex/source_gutendex/spec.yaml
Show resolved
Hide resolved
airbyte-integrations/connectors/source-gutendex/source_gutendex/spec.yaml
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-gutendex/source_gutendex/schemas/results.json
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-gutendex/source_gutendex/schemas/results.json
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-gutendex/source_gutendex/gutendex.yaml
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-gutendex/source_gutendex/gutendex.yaml
Outdated
Show resolved
Hide resolved
c4188b2
to
ddd2e98
Compare
/test connector=connectors/source-gutendex
Build PassedTest summary info:
|
/publish connector=connectors/source-gutendex
if you have connectors that successfully published but failed definition generation, follow step 4 here |
@RealChrisSean another one :) |
WOOO congrats! |
* Initial commit for source-gutendex * Clean up unnecessary code * solve conflict * Fix schema, Rename results_stream to books_stream * Add parameters in gutendex.md, change doc url to official Airbyte url * Add pagination, read each and every record instead of just 32 * Add bootstrap.md, add badge in builds.md * add source definition to airbyte-config * auto-bump connector version Co-authored-by: marcosmarxm <marcosmarxm@gmail.com> Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
What
How
Using the low-code CDK.
Recommended reading order
docs\integrations\sources\gutendex.md
airbyte-integrations\connectors\source-gutendex\source_gutendex\spec.yaml
airbyte-integrations\connectors\source-gutendex\source_gutendex\gutendex.yaml
airbyte-integrations\connectors\source-gutendex\source_gutendex\schemas\results.json
🚨 User Impact 🚨
None. No breaking changes.
Pre-merge Checklist
Community member or Airbyter
airbyte_secret
- No secrets/authorization required./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
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/publish
command described hereTests
Unit
Integration
Acceptance