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
Add stubs for influxdb-client #9429
Conversation
This comment has been minimized.
This comment has been minimized.
|
The homeassistant primer warning is genuine. The |
This comment has been minimized.
This comment has been minimized.
| | bytes | ||
| | Iterable[bytes] | ||
| | _Observable | ||
| | NamedTuple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mypy accepts NamedTuple as a type annotation but I'm not sure that's a feature we can rely on in typeshed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used a type alias to tuple[Any, ...] for now, similar to what I did to dataclass.
|
Diff from mypy_primer, showing the effect of this PR on open source code: core (https://github.com/home-assistant/core)
+ homeassistant/components/influxdb/__init__.py:352: error: Argument 1 to "InfluxDBClient" has incompatible type "**Dict[str, int]"; expected "Optional[str]" [arg-type]
+ homeassistant/components/influxdb/__init__.py:352: error: Argument 1 to "InfluxDBClient" has incompatible type "**Dict[str, int]"; expected "bool" [arg-type]
+ homeassistant/components/influxdb/__init__.py:352: error: Argument 1 to "InfluxDBClient" has incompatible type "**Dict[str, int]"; expected "Optional[Dict[Any, Any]]" [arg-type]
|
Except for
client.util.date_utils, the stubs were auto-generated and then manually fixed/cleaned up. This is best reviewed commit by commit, where the first commit is just the output of create_baseline_stubs.Upstream annotations were cleaned up, but not reviewed. I'm sure that the many
dict/listannotations could be made more lenient, but I didn't check review that.