fix: correct mypy.ini package name typo to re-enable type-checking - #88
Merged
Merged
Conversation
[mypy-pinecone_dataset.*] (missing the trailing "s") never matched the actual pinecone_datasets package, so the per-package override silently inherited ignore_errors = True from [mypy] and mypy type-checked nothing. Fix the typo and surface the real type errors it had been masking, with minimal annotation/logic fixes to make them pass. Deferred: re-adding disallow_untyped_defs/disallow_untyped_calls to the corrected section is tracked separately in #82.
jhamon
approved these changes
Aug 3, 2026
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.
Problem
mypy.ini's per-package override targeted[mypy-pinecone_dataset.*]— missing the trailing "s" — so it never matched the actualpinecone_datasetspackage. The override'signore_errors = Falsesilently had no effect, and the whole codebase inheritedignore_errors = Truefrom the[mypy]global section. In effect,mypy .(and CI'suv run mypy .step) type-checked nothing while still reporting success.Solution
[mypy-pinecone_dataset.*]→[mypy-pinecone_datasets.*].pinecone_datasets/fs.py: theCloudOrLocalFSTYPE_CHECKING-only alias needed an explicittyping.TypeAlias(PEP 613) annotation — without it, mypy can't infer it as a type alias once realgcsfs/s3fstypes (with fsspec's custom metaclasses) are involved, and reports "Variable ... is not valid as a type".pinecone_datasets/dataset.py: widened several parameter/attribute annotations (dataset_path,column_mapping,self._fs,self._documents,self._queries,self._metadata) to match what the code actually accepts/produces (Noneis a real, handled case in each), fixediter_pandas_dataframe_slices/iter_documentsreturn types to reflect thereturn_indexes=Truetuple-yielding branch, and added a guard in themetadataproperty so aNonevalue raises a clearValueErrorinstead of type-lying about it.pinecone_datasets/dataset_fsreader.py/dataset_fswriter.py: corrected two helper return types to| None, matching their actualNone-returning branches.pinecone_datasets/retry.py:is_retryable_errornow takesBaseException(matchestenacity'sretry_if_exceptionsignature) andlog_retry_attemptnull-checksRetryCallState.outcome/.fnbefore use (both areOptionalpertenacity's types).pinecone_datasets/catalog.py: added a narrow, commented# type: ignore[assignment]for thebase_path: str = Field(default=None)pattern — theNonedefault only exists to satisfy pydantic's required-field validation and is always overwritten in__init__before use.Verification
mypy .— clean (0 errors, 36 source files), confirmed meaningful by introducing a deliberate type error and observing mypy catch it, then reverting.ruff format --check ./ruff check .— clean on all touched files (repo-wide pre-existingMAINTAINERS.md/README.mdformatting drift is unrelated and untouched).pytest tests/unit— 158 passed, 3 skipped, 2 pre-existing failures unrelated to this change (both fail identically on unmodifiedmain; they require network egress tooauth2.googleapis.comthat isn't available here).Scope note
This issue's acceptance criteria called out "fix any real type errors that surface," which this PR does. It intentionally does not restore the stricter
disallow_untyped_defs/disallow_untyped_callsflags that were present in the original (mistyped, and thus inert) override section — that's already tracked as a dedicated follow-up in #82, which depends on this fix landing first.Closes #75
Warning
Firewall blocked 3 domains
The following domains were blocked by the firewall during workflow execution:
169.254.169.254metadata.google.internaloauth2.googleapis.comSee Network Configuration for more information.
Note
Low Risk
Changes are type annotations, config, and explicit error handling; no intended runtime behavior change beyond clearer
ValueErrorwhen metadata is absent.Overview
Fixes a typo in
mypy.iniso the per-package section targetspinecone_datasetsinstead ofpinecone_dataset. That re-enables real type-checking for the package (globalignore_errors = Trueno longer swallows everything). The stricterdisallow_untyped_*flags were dropped from that section; follow-up is tracked separately.Annotation and typing fixes across the modules mypy now checks: explicit
TypeAliasforCloudOrLocalFS, widerOptionaltypes onDatasetpaths/attributes and iterator return types whenreturn_indexes=True,metadataproperty raisesValueErrorwhen missing, helper return types includeNonein fs reader/writer, retry helpers aligned with tenacity (BaseException, null-safe logging), and a narrow ignore onCatalog.base_pathfor the pydanticField(default=None)pattern.Reviewed by Cursor Bugbot for commit e854e36. Bugbot is set up for automated code reviews on this repo. Configure here.