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

🐛 Source Recharge: change cursor_field from created_at on updated_at #6149

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ tests:
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/streams_with_output_records_catalog.json"
timeout_seconds: 1200
incremental:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/streams_with_output_records_catalog.json"
future_state_path: "integration_tests/abnormal_state.json"
cursor_paths:
addresses: [ "created_at" ]
timeout_seconds: 900
full_refresh:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
timeout_seconds: 1200
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"addresses": {
"created_at": "2050-05-18T00:00:00"
"updated_at": "2050-05-18T00:00:00"
},
"charges": {
"created_at": "2050-05-18T00:00:00"
"updated_at": "2050-05-18T00:00:00"
},
"customers": {
"created_at": "2050-05-18T00:00:00"
"updated_at": "2050-05-18T00:00:00"
},
"discounts": {
"created_at": "2050-05-18T00:00:00"
"updated_at": "2050-05-18T00:00:00"
},
"onetimes": {
"created_at": "2050-05-18T00:00:00"
"updated_at": "2050-05-18T00:00:00"
},
"orders": {
"created_at": "2050-05-18T00:00:00"
"updated_at": "2050-05-18T00:00:00"
},
"subscriptions": {
"created_at": "2050-05-18T00:00:00"
"updated_at": "2050-05-18T00:00:00"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
"name": "charges",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
Expand All @@ -42,25 +42,25 @@
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
"name": "discounts",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
Expand All @@ -78,25 +78,25 @@
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
"name": "orders",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
Expand Down Expand Up @@ -124,12 +124,12 @@
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
"name": "charges",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
Expand All @@ -42,38 +42,38 @@
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
"name": "discounts",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
"name": "orders",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
},
{
"stream": {
Expand Down Expand Up @@ -101,12 +101,12 @@
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created_at"],
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["created_at"]
"cursor_field": ["updated_at"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-e ../../bases/source-acceptance-test
-e .
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"addresses": {
"created_at": "2021-04-02T00:00:00"
"updated_at": "2021-04-02T00:00:00"
},
"charges": {
"created_at": "2021-04-02T00:00:00"
"updated_at": "2021-04-02T00:00:00"
},
"customers": {
"created_at": "2021-04-02T00:00:00"
"updated_at": "2021-04-02T00:00:00"
},
"discounts": {
"created_at": "2021-04-02T00:00:00"
"updated_at": "2021-04-02T00:00:00"
},
"onetimes": {
"created_at": "2021-04-02T00:00:00"
"updated_at": "2021-04-02T00:00:00"
},
"orders": {
"created_at": "2021-04-02T00:00:00"
"updated_at": "2021-04-02T00:00:00"
},
"subscriptions": {
"created_at": "2021-04-02T00:00:00"
"updated_at": "2021-04-02T00:00:00"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_stream_data(self, response_data: Any) -> List[dict]:

class IncrementalRechargeStream(RechargeStream, ABC):

cursor_field = "created_at"
cursor_field = "updated_at"

def __init__(self, start_date, **kwargs):
super().__init__(**kwargs)
Expand Down
6 changes: 6 additions & 0 deletions docs/integrations/sources/recharge.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ The Recharge connector should gracefully handle Recharge API limitations under n

Please read [How to generate your API token](https://support.rechargepayments.com/hc/en-us/articles/360008829993-ReCharge-API-).

## Changelog

| Version | Date | Pull Request | Subject |
| :------ | :-------- | :----- | :------ |
| 0.1.2 | 2021-09-?? | [??](https://github.com/airbytehq/airbyte/pull/??) | Change `cursor_field` for Incremental streams |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| 0.1.2 | 2021-09-?? | [??](https://github.com/airbytehq/airbyte/pull/??) | Change `cursor_field` for Incremental streams |
| 0.1.2 | 2021-09-17 | [6149](https://github.com/airbytehq/airbyte/pull/6149) | Change `cursor_field` for Incremental streams |

|