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

add reports to detect existence of cocina property in dros and collections #4245

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

ndushay
Copy link
Contributor

@ndushay ndushay commented Sep 22, 2022

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. ⚡

# > 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
Copy link
Member

Choose a reason for hiding this comment

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

cruft?

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Cruft?

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

kk

@mjgiarlo mjgiarlo merged commit e590a02 into main Sep 28, 2022
@mjgiarlo mjgiarlo deleted the property-existence-reports branch September 28, 2022 15:41
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