-
Notifications
You must be signed in to change notification settings - Fork 373
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
_send_warning
always raises in strict mode
#3715
Comments
Note, this is the cause of a reported error where |
I agree with the rename, but I would expect |
### What - Rename `_send_warning` -> `_send_warning_or_raise` to make the behavior clearer. - Default to ignore Nones in AnyValues when the type is unknown. - Update the docstrings. - Expand the unit-tests. Resolves: - #3715 - #3716 ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3725) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/3725) - [Docs preview](https://rerun.io/preview/5540cb4172d7bbef4749daf200ee14672af010e7/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/5540cb4172d7bbef4749daf200ee14672af010e7/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
Right now this applies only to python warnings. For example, this code in the batcher produces a warning from rust. Should this raise an exception instead? |
Ideally yes - if we could implement it in a simple way. We could have a log-handler that looks for Related: https://github.com/rerun-io/rerun/blob/main/CODE_STYLE.md#error (BTW: we already have a strict-mode in Rust that panics on |
Interesting -- I'm still not fully convinced that all warnings should be panics/exceptions in strict mode, though I agree many of them probably should be. Still, my preferred interpretation of strict mode is something along the lines of "exceptions for warnings about something that happen as a direct function of user input and for which user could practically change their code to avoid." Panicking or throwing exceptions for warnings that happen in circumstances that are outside the control of the user, such as data being dropped because a network connection went down, still seems like a bad experience. Either way, the helper function was renamed in #3716 and I don't have a concrete warning I want to make non-exceptional at the moment, so I'm going to close for now. |
Very true, connection errors and other things outside the users control should not be affected by strict mode. (The Rust |
_send_warning
sounds innocuous enough that we've used it in some places that maybe shouldn't be fatal for users running in strict mode.We should rename this in a way that makes it clear that this is the behavior and consider adding a less fatal way of notifying users in cases that really should only ever be warnings.
The text was updated successfully, but these errors were encountered: