Skip to content

Star re-imports (e.g. from pyarrow.parquet.core) #238

Closed
@aldanor

Description

@aldanor

(cc @zen-xu)

import pyarrow.parquet as pq
from pyarrow.parquet import core

_ = core.read_table  # ok

_ = pq.read_table  # not ok...
❯ pyright --version
pyright 1.1.397

❯ pyright test.py
test.py
  test.py:6:8 - error: "read_table" is not a known attribute of module "pyarrow.parquet" (reportAttributeAccessIssue)
1 error, 0 warnings, 0 informations

Looks like pyright may stumble because of re-imports

from .core import * # noqa

This fails both with this project's pyright config

[tool.pyright]
typeCheckingMode = "strict"
reportMissingImports = false
reportPrivateUsage = false
reportUnknownParameterType = false
reportMissingTypeArgument = false
reportMissingParameterType = false
reportMissingTypeStubs = false
reportUnknownVariableType = false
reportUnknownArgumentType = false

and with other (non-strict) configs as well.

Should the __all__ be added to pyarrow/parquet/__init__.pyi? (unfortunately some duplication but then I think it should work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions