Skip to content

Handle some errors as nodata #42

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

Merged
merged 1 commit into from
Apr 29, 2021
Merged

Handle some errors as nodata #42

merged 1 commit into from
Apr 29, 2021

Conversation

gjoseph92
Copy link
Owner

Pass error patterns as errors_as_nodata, which if raised, will be printed as a warning, and whatever they were trying to load will be returned as an empty array. By default, RasterioIOError("HTTP response code: 404") is ignored.

The main thing I'm unsure about is the warnings.warn. In brief testing, it didn't reliably show up, and I'm not sure whether it would show up in distributed worker logs. However, I was also testing a URL that only intermittently failed, so I can't be sure the error was actually happening.

I'll likely merge this now, since it's still a significant improvement, but we should come back to the larger logging story. Additionally, this doesn't do anything about retries (#18).

cc @RichardScottOZ

Closes #12

Pass error patterns as `errors_as_nodata`, which if raised, will be printed as a warning, and whatever they were trying to load will be returned as an empty array.

The main thing I'm unsure about is the `warnings.warn`. In brief testing, it didn't reliably show up, and I'm not sure whether it would show up in distributed worker logs. However, I was also testing a URL that only intermittently failed, so I can't be sure the error was actually happening.

I'll likely merge this now, since it's still a significant improvement, but we should come back to the larger logging story.

Closes #12
@RichardScottOZ
Copy link
Contributor

Thanks Gabe, I will test it soon when I get a chance. I can do some of the same things I was using last weekend to compare.

Retries = more complicated.

@gjoseph92 gjoseph92 merged commit 56ac26d into main Apr 29, 2021
@gjoseph92 gjoseph92 deleted the errors-as-nodata branch April 29, 2021 07:54
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.

Missing file handling
2 participants