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

occ_download_cached() finds nothing #748

Closed
UlvHare opened this issue Sep 9, 2024 · 5 comments
Closed

occ_download_cached() finds nothing #748

UlvHare opened this issue Sep 9, 2024 · 5 comments
Labels
Milestone

Comments

@UlvHare
Copy link

UlvHare commented Sep 9, 2024

Hello!
In rmarkdown document I want to check if I have recent (less then month) download and if yes get it else make a new query.

The query (credentials are not shown):

occ_download(
   pred("classKey", 359),
    pred("hasGeospatialIssue", FALSE),
    pred("hasCoordinate", TRUE),
    pred_lte("coordinateUncertaintyInMeters", 5000),
    pred_within(my_wkt)
)

Everything OK, I can get it. But when I try to check:

occ_download_cached(
   pred("classKey", 359),
    pred("hasGeospatialIssue", FALSE),
    pred("hasCoordinate", TRUE),
    pred_lte("coordinateUncertaintyInMeters", 5000),
    pred_within(my_wkt)
)

I get only

no match found
[1] NA

Even minimal request

occ_download_cached(
    pred("hasCoordinate", TRUE),
)

gives the same result, nothing

@jhnwllr
Copy link
Collaborator

jhnwllr commented Sep 10, 2024

@UlvHare thanks for catching this. It appears to be a bug.

Some queries seem to work but not all.

works

occ_download(pred("datasetKey","17e4f415-f4d5-4c3d-b99c-70e4573160e5"))
occ_download_cached(pred("datasetKey","17e4f415-f4d5-4c3d-b99c-70e4573160e5"))

broken

occ_download(pred("taxonKey", "7553988"))
occ_download_cached(pred("taxonKey", "7553988"))

@jhnwllr jhnwllr added the Bug label Sep 10, 2024
@jhnwllr
Copy link
Collaborator

jhnwllr commented Sep 12, 2024

@UlvHare I think this might work for downloads older than one day.

For me,

occ_download(pred("taxonKey", "7553988"))
occ_download_cached(pred("taxonKey", "7553988"))

This now works after waiting a day. I try to change it so you can check your cached downloads on the same day as the download.

@UlvHare
Copy link
Author

UlvHare commented Sep 17, 2024

occ_download_cached(
    pred("hasCoordinate", TRUE),
)

occ_download_cached(
    pred("scientificName", "Mammalia"))

still doesn't work :-(

@jhnwllr
Copy link
Collaborator

jhnwllr commented Sep 20, 2024

@UlvHare there was some boilerplate that was in the GBIF version that was not in the rgbif generated version, that I am filtering out. Fix is coming soon.

@jhnwllr jhnwllr added this to the 3.8.1 milestone Sep 24, 2024
@jhnwllr jhnwllr closed this as completed Sep 24, 2024
@jhnwllr jhnwllr mentioned this issue Sep 26, 2024
@UlvHare
Copy link
Author

UlvHare commented Oct 1, 2024

@jhnwllr, thank you very much! Now it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants