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

SFR-2285: Fix has part item build #420

Merged
merged 2 commits into from
Oct 28, 2024
Merged

Conversation

kylevillegas93
Copy link
Contributor

@kylevillegas93 kylevillegas93 commented Oct 25, 2024

Description

  • Extends the number of items by the maximum number in the has_part list of the record.

Testing

  • Tested against a record in QA that failed to cluster due to an index out of range error

https://drb-qa.nypl.org/work/b21b52f1-e6f1-4363-8737-c708616b71b3

Copy link
Contributor

@mitri-slory mitri-slory left a comment

Choose a reason for hiding this comment

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

This is a good catch to fixing this method. I have one question though which is why would the length of the has_part list not be sufficient enough to catch all the items. Are there cases like in the test record above where the length misses one of the items in the has_part array?

@kylevillegas93
Copy link
Contributor Author

@mitri-slory great question. There are cases where the indices of the has_part array do not align with the number of parts. So for instance, there may be two parts but the indices are 2 and 3. In this case we would only be extending the array by 2 but we get an IndexOutOfBounds exception because of the has_part indices are greater than what we extended the array by.

@kylevillegas93 kylevillegas93 merged commit 97a2c83 into main Oct 28, 2024
1 check passed
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 this pull request may close these issues.

2 participants