Skip to content

fix: correct mypy.ini package name typo to re-enable type-checking - #88

Merged
jhamon merged 1 commit into
mainfrom
agent/maintenance/issue-75-7c84358fb95f35fc
Aug 3, 2026
Merged

fix: correct mypy.ini package name typo to re-enable type-checking#88
jhamon merged 1 commit into
mainfrom
agent/maintenance/issue-75-7c84358fb95f35fc

Conversation

@pinecone-groundskeeper

@pinecone-groundskeeper pinecone-groundskeeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Problem

mypy.ini's per-package override targeted [mypy-pinecone_dataset.*] — missing the trailing "s" — so it never matched the actual pinecone_datasets package. The override's ignore_errors = False silently had no effect, and the whole codebase inherited ignore_errors = True from the [mypy] global section. In effect, mypy . (and CI's uv run mypy . step) type-checked nothing while still reporting success.

Solution

  • Fixed the typo: [mypy-pinecone_dataset.*][mypy-pinecone_datasets.*].
  • With type-checking actually enabled, fixed the real errors it surfaced:
    • pinecone_datasets/fs.py: the CloudOrLocalFS TYPE_CHECKING-only alias needed an explicit typing.TypeAlias (PEP 613) annotation — without it, mypy can't infer it as a type alias once real gcsfs/s3fs types (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 (None is a real, handled case in each), fixed iter_pandas_dataframe_slices/iter_documents return types to reflect the return_indexes=True tuple-yielding branch, and added a guard in the metadata property so a None value raises a clear ValueError instead of type-lying about it.
    • pinecone_datasets/dataset_fsreader.py / dataset_fswriter.py: corrected two helper return types to | None, matching their actual None-returning branches.
    • pinecone_datasets/retry.py: is_retryable_error now takes BaseException (matches tenacity's retry_if_exception signature) and log_retry_attempt null-checks RetryCallState.outcome/.fn before use (both are Optional per tenacity's types).
    • pinecone_datasets/catalog.py: added a narrow, commented # type: ignore[assignment] for the base_path: str = Field(default=None) pattern — the None default 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-existing MAINTAINERS.md/README.md formatting drift is unrelated and untouched).
  • pytest tests/unit — 158 passed, 3 skipped, 2 pre-existing failures unrelated to this change (both fail identically on unmodified main; they require network egress to oauth2.googleapis.com that 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_calls flags 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.254
  • metadata.google.internal
  • oauth2.googleapis.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "169.254.169.254"
    - "metadata.google.internal"
    - "oauth2.googleapis.com"

See Network Configuration for more information.

Generated by GitHub Maintenance Fixer · sonnet50 · 313.5 AIC · ⌖ 20.2 AIC · ⊞ 7.7K ·


Note

Low Risk
Changes are type annotations, config, and explicit error handling; no intended runtime behavior change beyond clearer ValueError when metadata is absent.

Overview
Fixes a typo in mypy.ini so the per-package section targets pinecone_datasets instead of pinecone_dataset. That re-enables real type-checking for the package (global ignore_errors = True no longer swallows everything). The stricter disallow_untyped_* flags were dropped from that section; follow-up is tracked separately.

Annotation and typing fixes across the modules mypy now checks: explicit TypeAlias for CloudOrLocalFS, wider Optional types on Dataset paths/attributes and iterator return types when return_indexes=True, metadata property raises ValueError when missing, helper return types include None in fs reader/writer, retry helpers aligned with tenacity (BaseException, null-safe logging), and a narrow ignore on Catalog.base_path for the pydantic Field(default=None) pattern.

Reviewed by Cursor Bugbot for commit e854e36. Bugbot is set up for automated code reviews on this repo. Configure here.

[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.
@pinecone-groundskeeper pinecone-groundskeeper Bot added the agent:maintenance Opened/maintained by the maintenance agent; it recognizes its own work by this label label Jul 31, 2026
@jhamon
jhamon merged commit e494b5d into main Aug 3, 2026
10 checks passed
@jhamon
jhamon deleted the agent/maintenance/issue-75-7c84358fb95f35fc branch August 3, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:maintenance Opened/maintained by the maintenance agent; it recognizes its own work by this label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix mypy.ini package typo — strict type-checking is silently disabled

1 participant