Public symbols not properly exported with `py.typed` present — triggers Pylance/Pyright errors
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by inspecting influxdb_client/init.py and the package's py.typed marker, then reproduce the documented from influxdb_client import InfluxDBClient import with Pyright or Pylance. Determine the intended public exports and verify that the top-level import no longer produces the reported private-import diagnostic.
Written by the indexing model from the issue text.
Description
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 .pyistub 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__toinfluxdb_client/__init__.pyto explicitly define the intended public interface. - Provide proper
.pyistub files that describe the public API. - If full typing support is not maintained, consider removing the
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!
- Dominant language
- Python
- Stars
- 792
- Forks
- 186
- Avg merge
- 3h 2m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
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.
More from influxdata/influxdb-client-python
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
influxdata/influxdb-client-python#613 · 7 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 30/100
influxdata/influxdb-client-python#693 · 2 comments · 1 reaction ·
-
Socks proxy support Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
All issues in influxdata/influxdb-client-python
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100