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

PHO-95: holdings with nil enum match any htitems #297

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

aelkiss
Copy link
Member

@aelkiss aelkiss commented Jan 12, 2024

Background

A partner reported that an OCLC number they hold did not appear to match any items in HathiTrust in their "ETAS overlap report".

Whether a holding matches a cluster (i.e. one or more catalog records sharing a set of equivalent OCNs) or a HathiTrust item is dependent on context.

This behavior is complex and confusing because it was replicated from the old holdings system without a comprehensive review of the requirements (that is, the requirements were taken to be the observed behavior of the old system.)

https://hathitrust.atlassian.net/browse/HT-2726
https://hathitrust.atlassian.net/browse/HT-2727

Changing the behavior overall is out of scope here (either changing the behavior for the ETAS overlap report so that it includes cases where no enum matches, or my preferred option of doing away with enum-based matching entirely as we do with serials)

See also the investigation and notes on https://hathitrust.atlassian.net/jira/core/projects/TTO/board?groupBy=status&selectedIssue=TTO-168

This change

This change allows holdings with nil normalized enumeration (n_enum) to match HathiTrust items. This appears to be an unanticipated case with the data, but does not change the underlying semantics of matching. Such holdings/items will match and appear in the ETAS overlap report.

Separately, we should determine whether the data loading process is unexpectedly loading nil values for n_enum, or if this is a byproduct of data from the old system.

Because the cost report and production overlap table already consider such cases to match via organizations_with_holdings_but_no_matches, this should only affect the ETAS overlap report -- that is, the items/holdings already match for the cost report and production holdings table.

While we probably don't want nil n_enum, there is data with that, and it
should still match.
@coveralls
Copy link

Coverage Status

coverage: 95.034% (+0.02%) from 95.012%
when pulling 815b05b on PHO-95-match-nil-enum
into 8398573 on main.

@aelkiss aelkiss requested a review from moseshll January 12, 2024 22:30
expect(overlap.matching_holdings.count).to eq(1)
end

it "finds holdings with nil enum" do
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the new test; the other changes here are just trying to make it a bit more clear what's going on.

@aelkiss aelkiss marked this pull request as ready for review January 12, 2024 22:35
Copy link
Contributor

@moseshll moseshll left a comment

Choose a reason for hiding this comment

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

Ran fine, no red flags once I got my head wrapped around the fact that blank? was legitimately being provided by ActiveSupport.

@aelkiss aelkiss merged commit 1ece8c5 into main Jan 15, 2024
1 check passed
@aelkiss aelkiss deleted the PHO-95-match-nil-enum branch January 15, 2024 17:33
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.

3 participants