🐛 Handle "or" behavior for specified metric types #890
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this commit, when you provided an explicit
metric_type=total_item_requests
you would get back the various datatypes that had been seeded in the database.
When you'd provide the
metric_type=searches_platform
you would see theDataType for the
Platform
(and not the Article nor Book data types).When you'd provide ``metric_type=searches_platform|total_item_requests
you would only get the
Platform` data type.The expected behavior is you would get the
Article
,Book
, andPlatform
data types.This commit remedies that behavior. Note, dear reader, that the test
case only has
article
in the given date range.See the Sushi Docs:
Copied text from Issue
In https://pittir.commons-archive.org/api/sushi/r51/reports/pr?begin_date=2023-06&end_date=2023-07&metric_type=total_item_requests , the output includes:
The for the same timeframe, https://pittir.commons-archive.org/api/sushi/r51/reports/pr?begin_date=2023-06&end_date=2023-07&metric_type=Searches_Platform includes:
so, an "OR" of the two parameters (
metric_type=Searches_Platform|total_item_requests
) should include both Metric Types (from any Data Types, since data_type is not filtered):instead, https://pittir.commons-archive.org/api/sushi/r51/reports/pr?begin_date=2023-06&end_date=2023-07&metric_type=Searches_Platform|total_item_requests only includes Searches Platform from the Platform Data Type:
Related to:
Story
Refs #issuenumber
Expected Behavior Before Changes
Expected Behavior After Changes
Screenshots / Video
Notes