Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The changes preserve runtime behavior, add focused regression coverage, and leave only an optional docstring correction.
1 open issue
What changed in this PR
Fixes #694 by explicitly exporting existing top-level client symbols for type checkers without changing runtime imports.
Changes:
- Adds same-name aliases to public imports.
- Adds runtime and mypy regression coverage, with mypy in the test extra.
- Documents the fix in the changelog.
| File | Description |
|---|---|
| tests/typing/public_exports.py | Provides a representative consumer fixture. |
| tests/test_PublicExports.py | Checks runtime imports and explicit exports with mypy. |
| setup.py | Adds mypy as a test dependency. |
| influxdb_client/__init__.py | Explicitly re-exports existing public symbols. |
| CHANGELOG.md | Records the type-checker compatibility fix. |
Review effort: Balanced
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #722 +/- ##
==========================================
- Coverage 90.49% 90.39% -0.11%
==========================================
Files 40 41 +1
Lines 3568 3580 +12
==========================================
+ Hits 3229 3236 +7
- Misses 339 344 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fix docstring to correct the language and formatting. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #694.
Proposed Changes
Documented imports such as
from influxdb_client import InfluxDBClientwork at runtime but produce private-import errors in Pyright/Pylance and strict mypy because the typed package does not explicitly re-export them.Use same-name import aliases for the existing public bindings in
influxdb_client/__init__.py. This keeps runtime names and import behavior intact without adding a duplicate__all__list or removingpy.typed. Add a pytest regression that runs a representative consumer through strict mypy, with mypy included only in the test extra.This replaces influxdata/influxdb-clients-apigen#84, following the request to fix the client directly.
Validation on Python 3.12/Linux ARM64:
reportPrivateImportUsageerrors before and zero after; mypy 2.4.0 reports seven explicit-export errors before and zero after. The new pytest regression fails before and passes after.test_write_context_managercase was deselected. The full integration suite was not run because no InfluxDB service was started._async/api_client.pyand_sync/api_client.py.Checklist
pytest testscompletes successfully — full integration suite not run; focused results aboveAI assistance: OpenAI Codex investigated, implemented, and validated this follow-up.