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

MultipleObjectsReturned on GTIN search #3721

Open
Jongmassey opened this issue Oct 20, 2022 · 1 comment
Open

MultipleObjectsReturned on GTIN search #3721

Jongmassey opened this issue Oct 20, 2022 · 1 comment

Comments

@Jongmassey
Copy link
Collaborator

via this sentry entry and this slack thread - when there are multiple AMPPs for a given GTIN, a MultipleObjectsReturned error is thrown

@Jongmassey
Copy link
Collaborator Author

Digging into this using google bigquery - it seems that there are duplicate records based on GTIN in dmd.gtin. Therefore, when searching for AMPPs by GTIN, a query may return multiple AMPPs, which violates the expected behaviour of .get() to return only one item.

For some of these duplicates, only one of the duplicated rows has a NULL enddt - so when searching for the current GTIN info then there would be no duplicates. However, for some GTINs there are multiple rows with NULL enddts.

The test fixtures and probably some of the tests will need updating to account for this, as they do not currently reflect this duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant