Need a way to subscribe to DriverWarning as events with a callback
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 128
- Forks
- 110
- Avg merge
- 5d 14h
- Merged PRs (30d)
- 10
Description
With warnings.warn, if users have to asynchronously process driver warnings, then they need to override the warnings.showwarning function with a custom handler which would process driver warnings differently. This implies a global override, more things for users to maintain and a possibility of not handling certain other warnings in the application correctly. Would be good to have a warning event mechanism built into driver session which the users can subscribe to, by passing a callback function. This event mechanism can co-exist with the current warnings.warn. This way, users can adopt whatever approach makes sense for the application.
ie:
- if they want to raise exceptions for warnings, then they can simply do
warnings.simplefilter("error", DriverWarning) - if they want to asynchronously handle warnings without stopping the execution flow, then they can do
session.warning_event.subscribe(driverwarninghandler(DriverWarning))and define
def driverwarninghandler(DriverWarning):
<log to file, set a flag, push to a queue, raise few warnings and ignore others, etc>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the driver session's existing DriverWarning and warnings.warn handling; the issue does not name specific files or tests. Define the callback subscription behavior and verify that asynchronous handling can coexist with the current warning mechanism.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100