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

empty filter check #201

Merged
merged 2 commits into from
Feb 2, 2024
Merged

empty filter check #201

merged 2 commits into from
Feb 2, 2024

Conversation

yjunechoe
Copy link
Collaborator

Fixes #200

oa_query() now errors if it receives a filter with a missing value, instead of silently ignoring it. Guards against users accidentally specifying a filter that ends up not doing anything.

author_id <- NULL
author_works <- oa_fetch(
  entity = "works",
  author.id = author_id,
  publication_year = 2022,
  verbose = TRUE
)
#> Error: Filters must have a value: author.id

Copy link
Collaborator

@trangdata trangdata left a comment

Choose a reason for hiding this comment

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

Thank you for this PR! I made a small suggestion.

R/oa_fetch.R Outdated Show resolved Hide resolved
Co-authored-by: Trang Le <[email protected]>
@yjunechoe yjunechoe merged commit 5d2a695 into main Feb 2, 2024
7 checks passed
@trangdata trangdata deleted the empty-filter-check branch February 15, 2024 14:17
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.

oa_fetch works with author_id as NULL
2 participants