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

issue with crop_success_probabilities #128

Open
ChrisMarsh82 opened this issue Jun 18, 2024 · 5 comments
Open

issue with crop_success_probabilities #128

ChrisMarsh82 opened this issue Jun 18, 2024 · 5 comments

Comments

@ChrisMarsh82
Copy link

ChrisMarsh82 commented Jun 18, 2024

Not sure where the problem is but it looks like it has something to do with how this procedure is trying to authenticate with the buckets. However, I am not ruling out that it could be an issue with the API

command ran:
epicsawrap::crop_success_probabilities("zm_test", "zambia_eastern_4", c(100,200,300), c(20), c(25,50,75),TRUE,FALSE)
This works fine in R but brings back an error in the API
error:

Run `rlang::last_trace()` to see where the error occurred.
R[write to console]: Warning message:
R[write to console]: In (function (country, station_id, planting_dates = NULL, water_requirements = NULL,  :
R[write to console]:
R[write to console]:  Setting override = TRUE. Access to raw data is required

rlang trace:

  1. └─epicsawrap::crop_success_probabilities(...)
  2.   └─epicsawrap::definitions(...)
  3.     └─epicsadata::get_definitions_data(...)
  4.       └─epicsadata::update_definitions_data(country, station_id[i])
  5.         └─epicsadata::get_data(country = country, filename = filename)
  6.           └─googleCloudStorageR::gcs_get_object(...)
  7.             └─googleAuthR (local) ob()
  8.               └─googleAuthR:::doHttrRequest(...)
  9.                 └─googleAuthR:::retryRequest(...)
 10.                   └─googleAuthR:::abort_http(status_code, error)

All other functions work and the service account used is the same for both

@ChrisMarsh82
Copy link
Author

@lilyclements

@lilyclements
Copy link
Collaborator

lilyclements commented Jun 18, 2024

@ChrisMarsh82 when I run in R I also get an error. It is looking for a definitions file called ZME4.json which does not exist. I have now fixed this and merged it. However, that fixes your error, but then there's a new error that will occur for you which this doesn't fix.

Note that there is a warning saying "Setting override = TRUE. Access to raw data is required"

This is because you have asked not to override, but you have given new values for the planting_dates/etc. So, it ignores your override, and wants to create it from scratch.
But, it doesn't have access to the raw data, so it throws an error. This is working as I would expect it to.

@ChrisMarsh82
Copy link
Author

@lilyclements updated the package but still getting the issue.

makes sense on the override. I was meant to give you the error when the override was set to true. I must have just got it confused.

@lilyclements
Copy link
Collaborator

So if the override is set to TRUE, then it needs the raw data to calculate it. Is the raw data in the bucket for this data set?

@lilyclements
Copy link
Collaborator

lilyclements commented Jun 24, 2024

Can this be closed @ChrisMarsh82?

I've also put in under discussions about other data sets

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

No branches or pull requests

2 participants