Skip to content

🐛 Source Recharge: Add sort_by to guarantee the records are in ASC order #35982

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

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-recharge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ See `sample_files/sample_config.json` for a sample config file.
poetry run source-recharge spec
poetry run source-recharge check --config secrets/config.json
poetry run source-recharge discover --config secrets/config.json
poetry run source-recharge read --config secrets/config.json --catalog sample_files/configured_catalog.json
poetry run source-recharge read --config secrets/config.json --catalog integration_tests/configured_catalog.json
```

### Running unit tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
connectorBuildOptions:
baseImage: docker.io/airbyte/python-connector-base:1.1.0@sha256:bd98f6505c6764b1b5f99d3aedc23dfc9e9af631a62533f60eb32b1d3dbab20c
definitionId: 45d2e135-2ede-49e1-939f-3e3ec357a65e
dockerImageTag: 1.1.5
dockerImageTag: 1.1.6
dockerRepository: airbyte/source-recharge
githubIssueLabel: source-recharge
icon: recharge.svg
Expand Down
56 changes: 28 additions & 28 deletions airbyte-integrations/connectors/source-recharge/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "1.1.5"
version = "1.1.6"
name = "source-recharge"
description = "Source implementation for Recharge."
authors = [ "Airbyte <[email protected]>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def request_params(
else:
params.update(
{
"sort_by": "updated_at-asc",
"updated_at_min": (stream_slice or {}).get("start_date", self._start_date),
"updated_at_max": (stream_slice or {}).get("end_date", self._start_date),
}
Expand All @@ -134,6 +135,7 @@ def request_params(
) -> MutableMapping[str, Any]:
params = {
"limit": self.limit,
"sort_by": "updated_at-asc",
"updated_at_min": (stream_slice or {}).get("start_date", self._start_date),
"updated_at_max": (stream_slice or {}).get("end_date", self._start_date),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ def test_next_page_token(self, config, stream_cls, cursor_response, requests_moc
None,
{},
{"start_date": "2020-01-01T00:00:00Z", "end_date": "2020-02-01T00:00:00Z"},
{"limit": 250, "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
{"limit": 250, "sort_by": "updated_at-asc", "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
),
(Metafields, {"cursor": "12353"}, {"updated_at": "2030-01-01"}, {}, {"limit": 250, "owner_resource": None, "cursor": "12353"}),
(
Products,
None,
{},
{"start_date": "2020-01-01T00:00:00Z", "end_date": "2020-02-01T00:00:00Z"},
{"limit": 250, "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
{"limit": 250, "sort_by": "updated_at-asc", "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
),
(Shop, None, {}, {}, {}),
],
Expand Down Expand Up @@ -275,7 +275,7 @@ def test_next_page_token(self, config, stream_cls, cursor_response, requests_moc
None,
{},
{"start_date": "2020-01-01T00:00:00Z", "end_date": "2020-02-01T00:00:00Z"},
{"limit": 250, "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
{"limit": 250, "sort_by": "updated_at-asc", "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
),
(
Charges,
Expand All @@ -289,14 +289,14 @@ def test_next_page_token(self, config, stream_cls, cursor_response, requests_moc
None,
{},
{"start_date": "2020-01-01T00:00:00Z", "end_date": "2020-02-01T00:00:00Z"},
{"limit": 250, "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
{"limit": 250, "sort_by": "updated_at-asc", "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
),
(
Discounts,
None,
{},
{"start_date": "2020-01-01T00:00:00Z", "end_date": "2020-02-01T00:00:00Z"},
{"limit": 250, "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
{"limit": 250, "sort_by": "updated_at-asc", "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
),
(
Onetimes,
Expand All @@ -310,21 +310,21 @@ def test_next_page_token(self, config, stream_cls, cursor_response, requests_moc
None,
{},
{"start_date": "2020-01-01T00:00:00Z", "end_date": "2020-02-01T00:00:00Z"},
{"limit": 250, "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
{"limit": 250, "sort_by": "updated_at-asc", "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
),
(
OrdersModernApi,
None,
{},
{"start_date": "2020-01-01T00:00:00Z", "end_date": "2020-02-01T00:00:00Z"},
{"limit": 250, "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
{"limit": 250, "sort_by": "updated_at-asc", "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
),
(
Subscriptions,
None,
{},
{"start_date": "2020-01-01T00:00:00Z", "end_date": "2020-02-01T00:00:00Z"},
{"limit": 250, "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
{"limit": 250, "sort_by": "updated_at-asc", "updated_at_min": "2020-01-01T00:00:00Z", "updated_at_max": "2020-02-01T00:00:00Z"},
),
],
)
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/recharge.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ The Recharge connector should gracefully handle Recharge API limitations under n

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:------------------------------------------------------------------------------------------|
| 1.1.6 | 2024-03-12 | [35982](https://github.com/airbytehq/airbyte/pull/35982) | Added additional `query param` to guarantee the records are in `asc` order |
| 1.1.5 | 2024-02-12 | [35182](https://github.com/airbytehq/airbyte/pull/35182) | Manage dependencies with Poetry. |
| 1.1.4 | 2024-02-02 | [34772](https://github.com/airbytehq/airbyte/pull/34772) | Fix airbyte-lib distribution |
| 1.1.3 | 2024-01-31 | [34707](https://github.com/airbytehq/airbyte/pull/34707) | Added the UI toggle `Use 'Orders' Deprecated API` to switch between `deprecated` and `modern` api versions for `Orders` stream |
Expand Down