fix(Amazon Seller Partner): Fix daterange in DatetimeBasedCursor
an…
#55238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Solves:
https://github.com/airbytehq/oncall/issues/7481 (Source: Amazon Seller Partner - Start Date and End Date not being considered/Incorrect state)
#55170 (Source: amazon-seller-partner - list_financial_events: Reduce max days apart to 14 days)
How
For (Source: Amazon Seller Partner - Start Date and End Date not being considered/Incorrect state)
We found that the
end_datetime
defaults to now_utc(). This fix changes these instances to check forreplication_end_date
first before using the defaultnow_utc()
value.Example of one instance:
updated to:
This should check for
replication_end_date
and then default to now_utc () if one is not found. Similar instances were switched to this format for easier readability.For (Source: amazon-seller-partner—list_financial_events: Reduce the maximum number of days apart to 14 days)
The maximum value listed in the API is 180 days, but in practical use, 14 is the maximum.
After further review, we found these other streams that would face this:
list_financial_event_groups
list_financial_events
This, however, can vary from user to user, so instead. We've implemented an optional configurable value:
financial_events_step
in the spec. Which is enabled in the manifest by adding:This should define the size of each connector's time window to slice the data range between
start_datetime
andend_datetime
for these streams.In the spec for this, we've set the default value to 14 and used ENUM to prevent users from selecting options outside the hard-coded API limits.
Review guide
User Impact
Can this PR be safely reverted and rolled back?