-
Notifications
You must be signed in to change notification settings - Fork 2
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
add reports to detect existence of cocina property in dros and collections #4245
Conversation
eb9102b
to
eb7d041
Compare
# > arrays when using the lax mode. To avoid surprising results, we recommend | ||
# > using the .** accessor only in the strict mode. | ||
JSONB_PATH = 'strict $.**.groupedValue ? (@.size() > 0)' # when property is array | ||
# JSONB_PATH = 'strict $.**.contributor.type' # when property is a string - maybe keep size check to avoid empty 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.
cruft?
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.
no - when property is an array vs when property is a string
# > and each of its elements, while the .HR accessor automatically unwraps | ||
# > arrays when using the lax mode. To avoid surprising results, we recommend | ||
# > using the .** accessor only in the strict mode. | ||
JSONB_PATH = 'strict $.**.groupedValue ? (@.size() > 0)' # when property is array |
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.
So... report on any non-empty grouped 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.
So... report on any non-empty grouped values?
yes - that's what this report is doing - reporting on non-empty occurrences of groupedValue
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.
Awesome.
# > arrays when using the lax mode. To avoid surprising results, we recommend | ||
# > using the .** accessor only in the strict mode. | ||
JSONB_PATH = 'strict $.**.contributor.parallelContributor ? (@.size() > 0)' # when property is array | ||
# JSONB_PATH = 'strict $.**.contributor.type' # when property is a string - maybe keep size check to avoid empty 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.
Cruft?
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.
same as above: one for array property, one for string.
# > and each of its elements, while the .HR accessor automatically unwraps | ||
# > arrays when using the lax mode. To avoid surprising results, we recommend | ||
# > using the .** accessor only in the strict mode. | ||
JSONB_PATH = 'strict $.**.contributor.parallelContributor ? (@.size() > 0)' # when property is array |
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.
I'm trying to square the names of the reports of this PR with these JSON paths. This seems narrower than "report on occurrences of a property." Intended or oversight or a misunderstanding on my part?
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.
I used a generic name for the report so Arcadia knows what the report does in the abstract so she will use it when she wants to do a run.
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.
kk
eb7d041
to
f0b0cb6
Compare
Why was this change made? 🤔
How was this change tested? 🤨
I ran reports for sul-dlss/cocina-models/issues/532 and for #4244 with this, and found some data with #4244 ...
⚡ ⚠ If this change has cross service impact, including data writes to shared file systems, run integration tests and/or test in [stage|qa] environment, in addition to specs. ⚡