Hi team,
Thanks for maintaining this package — it's a great tool for working with InfluxDB.
I'm opening this issue to report a problem that affects type checkers and IDEs (like Pyright, Pylance, and mypy) due to the presence of the py.typed file in the influxdb-client-python package.
Since the package declares itself as typed (via py.typed, per [PEP 561](https://peps.python.org/pep-0561/)), tools like Pyright and Pylance apply stricter rules around public API exposure. Specifically, public symbols must be explicitly exported using either:
- a
__all__ list in __init__.py, or
.pyi stub files.
Currently, this is not the case for the main client class. When importing InfluxDBClient from the top-level module as documented:
from influxdb_client import InfluxDBClient
Pylance (and Pyright) raises the following error:
"InfluxDBClient" is not exported from module "influxdb_client"
Import from "influxdb_client.client.influxdb_client" instead
Pylance: reportPrivateImportUsage
This is confusing to users and suggests that the public API is not properly defined.
Suggested solutions
To resolve this and ensure compatibility with type checkers, here are a few possible approaches:
- Add
__all__ to influxdb_client/__init__.py to explicitly define the intended public interface.
- Provide proper
.pyi stub files that describe the public API.
- If full typing support is not maintained, consider removing the
py.typed file to avoid stricter validation.
Improving this would help developers relying on static analysis and IDE support, and reduce confusion about which imports are officially supported.
Thanks again for your work and for considering this issue!
Hi team,
Thanks for maintaining this package — it's a great tool for working with InfluxDB.
I'm opening this issue to report a problem that affects type checkers and IDEs (like Pyright, Pylance, and mypy) due to the presence of the
py.typedfile in theinfluxdb-client-pythonpackage.Since the package declares itself as typed (via
py.typed, per [PEP 561](https://peps.python.org/pep-0561/)), tools like Pyright and Pylance apply stricter rules around public API exposure. Specifically, public symbols must be explicitly exported using either:__all__list in__init__.py, or.pyistub files.Currently, this is not the case for the main client class. When importing
InfluxDBClientfrom the top-level module as documented:Pylance (and Pyright) raises the following error:
This is confusing to users and suggests that the public API is not properly defined.
Suggested solutions
To resolve this and ensure compatibility with type checkers, here are a few possible approaches:
__all__toinfluxdb_client/__init__.pyto explicitly define the intended public interface..pyistub files that describe the public API.py.typedfile to avoid stricter validation.Improving this would help developers relying on static analysis and IDE support, and reduce confusion about which imports are officially supported.
Thanks again for your work and for considering this issue!