-
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
Source Amazon Seller Partner: GET_SELLER_FEEDBACK_DATA normalize header field names #9212
Conversation
test results
|
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.
Thank @lizdeika for the fixes!
I have a stability concern with the workaround you found. Let me know what you think about my suggestions.
I confirm that acceptance tests are passing in our CI, and I regret that our sandbox account does not have enough data to be able to detect the bug you found with "real-life" data. Maybe we can share on Slack some suggestions on how we could set this up to be more robust.
# and skip the original header with next() | ||
@staticmethod | ||
def parse_document(document): | ||
reader = csv.DictReader(StringIO(document), delimiter="\t", fieldnames=SellerFeedbackReports.NORMALIZED_FIELD_NAMES) |
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.
This is a working workaround but not 100% safe if Amazon changes the structure of the CSV file. And I'm not sure that this API has versioning that could allow us to avoid these breaking changes.
Do you think you could raise an error if the length of NORMALIZED_FIELD_NAMES
is different from the number of columns in the CSV file?
Do you have access to all the localized values? It could make the normalization safer by applying a mapping between localized and normalized values.
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.
Yes with amazon seller partner apis there is no certainty at all :D
Agreed with error raising on column count mismatch.
But mapping values is almost impossible, values are random, are not guaranteed to be the same tomorrow and I do not have access to all possible marketplaces to get them anyway.
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.
@alafanechere added header field count error raising on count mismatch
…_FEEDBACK_DATA-normalize-headers-field-names
Thank you @lizdeika for the error handling and this nice fix. Just merged! |
What
Examples:
A1PA6795UKMFR9
DE
:A1RKKUPIHCS9HS
ES
:A1AM78C64UM0Y8
MX
:etc.
How
Luckily columns come in the same order in all marketplaces.
We pass fieldnames to DictReader so we always have the same header field names.
Fix date formats
Recommended reading order
🚨 User Impact 🚨
Pre-merge Checklist
Updating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including 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./publish
command described here