forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
[Python] Add typing to arrow using stubs #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
|
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or See also: |
e65e744 to
8c54fd0
Compare
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix invalid-context-manager --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix invalid-type-form errors --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
* fix: The type parameter of array should be covariant (apache#253) * release 20.0.0.20250716 (apache#254) * Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix non-subscriptable issues --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix no-matching-overload --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix `invalid-return-type` error * Fix linting --------- Co-authored-by: Rok Mihevc <rok@mihevc.org>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix `not-iterable` error --------- Co-authored-by: Rok Mihevc <rok@mihevc.org>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix possibly-unbound-attribute --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix too-many-positional-arguments --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix unknown-argument --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * removing OrderedDict, etc --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * to_sparse appears deprecated, ignore inline * Update python/pyarrow/tests/test_feather.py --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix invalid-assignment --------- Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unsupported-operator` error --------- Co-authored-by: Rok Mihevc <rok@mihevc.org>
diff --git c/python/pyarrow/__init__.py i/python/pyarrow/__init__.py
index da2fe96647..45aa2b619f 100644
--- c/python/pyarrow/__init__.py
+++ i/python/pyarrow/__init__.py
@@ -58,8 +58,8 @@ except ImportError:
except ImportError:
__version__ = None
-import pyarrow.lib as _lib
-from pyarrow.lib import (BuildInfo, CppBuildInfo, RuntimeInfo, set_timezone_db_path,
+import pyarrow.lib as _lib # type: ignore[unresolved_import]
+from pyarrow.lib import (BuildInfo, CppBuildInfo, RuntimeInfo, set_timezone_db_path, # type: ignore[unresolved_import]
MonthDayNano, VersionInfo, build_info, cpp_build_info,
cpp_version, cpp_version_info, runtime_info,
cpu_count, set_cpu_count, enable_signal_handlers,
@@ -153,7 +153,7 @@ def show_info():
print(f" {codec: <20}: {status: <8}")
-from pyarrow.lib import (null, bool_,
+from pyarrow.lib import (null, bool_, # type: ignore[unresolved_import]
int8, int16, int32, int64,
uint8, uint16, uint32, uint64,
time32, time64, timestamp, date32, date64, duration,
@@ -237,13 +237,13 @@ from pyarrow.lib import (null, bool_,
FixedShapeTensorScalar, JsonScalar, OpaqueScalar, UuidScalar)
# Buffers, allocation
-from pyarrow.lib import (DeviceAllocationType, Device, MemoryManager,
+from pyarrow.lib import (DeviceAllocationType, Device, MemoryManager, # type: ignore[unresolved_import]
default_cpu_memory_manager)
-from pyarrow.lib import (Buffer, ResizableBuffer, foreign_buffer, py_buffer,
+from pyarrow.lib import (Buffer, ResizableBuffer, foreign_buffer, py_buffer, # type: ignore[unresolved_import]
Codec, compress, decompress, allocate_buffer)
-from pyarrow.lib import (MemoryPool, LoggingMemoryPool, ProxyMemoryPool,
+from pyarrow.lib import (MemoryPool, LoggingMemoryPool, ProxyMemoryPool, # type: ignore[unresolved_import]
total_allocated_bytes, set_memory_pool,
default_memory_pool, system_memory_pool,
jemalloc_memory_pool, mimalloc_memory_pool,
@@ -252,7 +252,7 @@ from pyarrow.lib import (MemoryPool, LoggingMemoryPool, ProxyMemoryPool,
supported_memory_backends)
# I/O
-from pyarrow.lib import (NativeFile, PythonFile,
+from pyarrow.lib import (NativeFile, PythonFile, # type: ignore[unresolved_import]
BufferedInputStream, BufferedOutputStream, CacheOptions,
CompressedInputStream, CompressedOutputStream,
TransformInputStream, transcoding_input_stream,
@@ -263,12 +263,12 @@ from pyarrow.lib import (NativeFile, PythonFile,
input_stream, output_stream,
have_libhdfs)
-from pyarrow.lib import (ChunkedArray, RecordBatch, Table, table,
+from pyarrow.lib import (ChunkedArray, RecordBatch, Table, table, # type: ignore[unresolved_import]
concat_arrays, concat_tables, TableGroupBy,
RecordBatchReader, concat_batches)
# Exceptions
-from pyarrow.lib import (ArrowCancelled,
+from pyarrow.lib import (ArrowCancelled, # type: ignore[unresolved_import]
ArrowCapacityError,
ArrowException,
ArrowKeyError,
diff --git c/python/pyarrow/acero.py i/python/pyarrow/acero.py
index e475e8db5c..dcead124d3 100644
--- c/python/pyarrow/acero.py
+++ i/python/pyarrow/acero.py
@@ -22,11 +22,11 @@
# distutils: language = c++
# cython: language_level = 3
-from pyarrow.lib import Table, RecordBatch, array
+from pyarrow.lib import Table, RecordBatch, array # type: ignore[unresolved_import]
from pyarrow.compute import Expression, field
try:
- from pyarrow._acero import ( # noqa
+ from pyarrow._acero import ( # type: ignore[unresolved_import] # noqa
Declaration,
ExecNodeOptions,
TableSourceNodeOptions,
@@ -45,7 +45,7 @@ except ImportError as exc:
try:
import pyarrow.dataset as ds
- from pyarrow._dataset import ScanNodeOptions
+ from pyarrow._dataset import ScanNodeOptions # type: ignore[unresolved_import]
except ImportError:
class DatasetModuleStub:
class Dataset:
diff --git c/python/pyarrow/benchmark.py i/python/pyarrow/benchmark.py
index 25ee1141f0..c0ea1b0ec8 100644
--- c/python/pyarrow/benchmark.py
+++ i/python/pyarrow/benchmark.py
@@ -18,4 +18,4 @@
# flake8: noqa
-from pyarrow.lib import benchmark_PandasObjectIsNull
+from pyarrow.lib import benchmark_PandasObjectIsNull # type: ignore[unresolved_import]
diff --git c/python/pyarrow/compute.py i/python/pyarrow/compute.py
index fe0afdb0a8..52e2de0e48 100644
--- c/python/pyarrow/compute.py
+++ i/python/pyarrow/compute.py
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-from pyarrow._compute import ( # noqa
+from pyarrow._compute import ( # type: ignore[unresolved_import] # noqa
Function,
FunctionOptions,
FunctionRegistry,
diff --git c/python/pyarrow/conftest.py i/python/pyarrow/conftest.py
index 41beaa1404..d1b1567389 100644
--- c/python/pyarrow/conftest.py
+++ i/python/pyarrow/conftest.py
@@ -21,7 +21,7 @@ import os
import pyarrow as pa
from pyarrow import Codec
from pyarrow import fs
-from pyarrow.lib import is_threading_enabled
+from pyarrow.lib import is_threading_enabled # type: ignore[unresolved_import]
from pyarrow.tests.util import windows_has_tzdata
import sys
@@ -120,13 +120,13 @@ except ImportError:
pass
try:
- import fastparquet # noqa
+ import fastparquet # type: ignore[unresolved_import] # noqa
defaults['fastparquet'] = True
except ImportError:
pass
try:
- import pyarrow.gandiva # noqa
+ import pyarrow.gandiva # type: ignore[unresolved_import] # noqa
defaults['gandiva'] = True
except ImportError:
pass
diff --git c/python/pyarrow/csv.py i/python/pyarrow/csv.py
index 1ae197f9f2..76ab1c5e03 100644
--- c/python/pyarrow/csv.py
+++ i/python/pyarrow/csv.py
@@ -16,7 +16,7 @@
# under the License.
-from pyarrow._csv import ( # noqa
+from pyarrow._csv import ( # type: ignore[unresolved_import] # noqa
ReadOptions, ParseOptions, ConvertOptions, ISO8601,
open_csv, read_csv, CSVStreamingReader, write_csv,
WriteOptions, CSVWriter, InvalidRow)
diff --git c/python/pyarrow/cuda.py i/python/pyarrow/cuda.py
index 18c530d4af..834096cfa3 100644
--- c/python/pyarrow/cuda.py
+++ i/python/pyarrow/cuda.py
@@ -18,7 +18,7 @@
# flake8: noqa
-from pyarrow._cuda import (Context, IpcMemHandle, CudaBuffer,
+from pyarrow._cuda import (Context, IpcMemHandle, CudaBuffer, # type: ignore[unresolved_import]
HostBuffer, BufferReader, BufferWriter,
new_host_buffer,
serialize_record_batch, read_message,
diff --git c/python/pyarrow/dataset.py i/python/pyarrow/dataset.py
index ef4f728872..1ab75f8a7f 100644
--- c/python/pyarrow/dataset.py
+++ i/python/pyarrow/dataset.py
@@ -21,7 +21,7 @@ import pyarrow as pa
from pyarrow.util import _is_iterable, _stringify_path, _is_path_like
try:
- from pyarrow._dataset import ( # noqa
+ from pyarrow._dataset import ( # type: ignore[unresolved_import] # noqa
CsvFileFormat,
CsvFragmentScanOptions,
JsonFileFormat,
@@ -70,7 +70,7 @@ _orc_msg = (
)
try:
- from pyarrow._dataset_orc import OrcFileFormat
+ from pyarrow._dataset_orc import OrcFileFormat # type: ignore[unresolved_import]
_orc_available = True
except ImportError:
pass
@@ -82,7 +82,7 @@ _parquet_msg = (
)
try:
- from pyarrow._dataset_parquet import ( # noqa
+ from pyarrow._dataset_parquet import ( # type: ignore[unresolved_import] # noqa
ParquetDatasetFactory,
ParquetFactoryOptions,
ParquetFileFormat,
@@ -98,7 +98,7 @@ except ImportError:
try:
- from pyarrow._dataset_parquet_encryption import ( # noqa
+ from pyarrow._dataset_parquet_encryption import ( # type: ignore[unresolved_import] # noqa
ParquetDecryptionConfig,
ParquetEncryptionConfig,
)
diff --git c/python/pyarrow/feather.py i/python/pyarrow/feather.py
index 241c27706a..28a5c2c547 100644
--- c/python/pyarrow/feather.py
+++ i/python/pyarrow/feather.py
@@ -20,11 +20,12 @@ from collections.abc import Sequence
import os
from pyarrow.pandas_compat import _pandas_api # noqa
-from pyarrow.lib import (Codec, Table, # noqa
+from pyarrow.lib import (Codec, Table, # type: ignore[unresolved_import] # noqa
concat_tables, schema)
-import pyarrow.lib as ext
-from pyarrow import _feather
-from pyarrow._feather import FeatherError # noqa: F401
+import pyarrow.lib as ext # type: ignore[unresolved_import]
+from pyarrow import _feather # type: ignore[unresolved_import]
+from pyarrow._feather import FeatherError \
+ # type: ignore[unresolved_import] # noqa: F401
class FeatherDataset:
diff --git c/python/pyarrow/flight.py i/python/pyarrow/flight.py
index b1836907c6..d6c4602b45 100644
--- c/python/pyarrow/flight.py
+++ i/python/pyarrow/flight.py
@@ -16,7 +16,7 @@
# under the License.
try:
- from pyarrow._flight import ( # noqa:F401
+ from pyarrow._flight import ( # type: ignore[unresolved_import] # noqa:F401
connect,
Action,
ActionType,
diff --git c/python/pyarrow/fs.py i/python/pyarrow/fs.py
index 157dbdf938..c7f1b325c7 100644
--- c/python/pyarrow/fs.py
+++ i/python/pyarrow/fs.py
@@ -21,7 +21,7 @@ FileSystem abstraction to interact with various local and remote filesystems.
from pyarrow.util import _is_path_like, _stringify_path
-from pyarrow._fs import ( # noqa
+from pyarrow._fs import ( # type: ignore[unresolved_import] # noqa
FileSelector,
FileType,
FileInfo,
@@ -40,22 +40,22 @@ FileStats = FileInfo
_not_imported = []
try:
- from pyarrow._azurefs import AzureFileSystem # noqa
+ from pyarrow._azurefs import AzureFileSystem # type: ignore[unresolved_import] # noqa
except ImportError:
_not_imported.append("AzureFileSystem")
try:
- from pyarrow._hdfs import HadoopFileSystem # noqa
+ from pyarrow._hdfs import HadoopFileSystem # type: ignore[unresolved_import] # noqa
except ImportError:
_not_imported.append("HadoopFileSystem")
try:
- from pyarrow._gcsfs import GcsFileSystem # noqa
+ from pyarrow._gcsfs import GcsFileSystem # type: ignore[unresolved_import] # noqa
except ImportError:
_not_imported.append("GcsFileSystem")
try:
- from pyarrow._s3fs import ( # noqa
+ from pyarrow._s3fs import ( # type: ignore[unresolved_import] # noqa
AwsDefaultS3RetryStrategy, AwsStandardS3RetryStrategy,
S3FileSystem, S3LogLevel, S3RetryStrategy, ensure_s3_initialized,
finalize_s3, ensure_s3_finalized, initialize_s3, resolve_s3_region)
diff --git c/python/pyarrow/ipc.py i/python/pyarrow/ipc.py
index 4e23667878..39ec944b72 100644
--- c/python/pyarrow/ipc.py
+++ i/python/pyarrow/ipc.py
@@ -21,14 +21,14 @@ import os
import pyarrow as pa
-from pyarrow.lib import (IpcReadOptions, IpcWriteOptions, ReadStats, WriteStats, # noqa
+from pyarrow.lib import (IpcReadOptions, IpcWriteOptions, ReadStats, WriteStats, # type: ignore[unresolved_import] # noqa
Message, MessageReader,
RecordBatchReader, _ReadPandasMixin,
MetadataVersion, Alignment,
read_message, read_record_batch, read_schema,
read_tensor, write_tensor,
get_record_batch_size, get_tensor_size)
-import pyarrow.lib as lib
+import pyarrow.lib as lib # type: ignore[unresolved_import]
class RecordBatchStreamReader(lib._RecordBatchStreamReader):
diff --git c/python/pyarrow/json.py i/python/pyarrow/json.py
index 24e6046135..d4988a1b5a 100644
--- c/python/pyarrow/json.py
+++ i/python/pyarrow/json.py
@@ -16,4 +16,4 @@
# under the License.
-from pyarrow._json import ReadOptions, ParseOptions, read_json, open_json # noqa
+from pyarrow._json import ReadOptions, ParseOptions, read_json, open_json # type: ignore[unresolved_import] # noqa
diff --git c/python/pyarrow/orc.py i/python/pyarrow/orc.py
index 4e0d66ec66..03c6a48046 100644
--- c/python/pyarrow/orc.py
+++ i/python/pyarrow/orc.py
@@ -19,8 +19,8 @@
from numbers import Integral
import warnings
-from pyarrow.lib import Table
-import pyarrow._orc as _orc
+from pyarrow.lib import Table # type: ignore[unresolved_import]
+import pyarrow._orc as _orc # type: ignore[unresolved_import]
from pyarrow.fs import _resolve_filesystem_and_path
diff --git c/python/pyarrow/pandas_compat.py i/python/pyarrow/pandas_compat.py
index 7b9f5008a1..f284d411ab 100644
--- c/python/pyarrow/pandas_compat.py
+++ i/python/pyarrow/pandas_compat.py
@@ -35,7 +35,7 @@ try:
except ImportError:
np = None # type: ignore[assignment]
import pyarrow as pa
-from pyarrow.lib import _pandas_api, frombytes, is_threading_enabled # noqa
+from pyarrow.lib import _pandas_api, frombytes, is_threading_enabled # type: ignore[unresolved_import] # noqa
_logical_type_map = {}
@@ -729,7 +729,7 @@ def _reconstruct_block(item, columns=None, extension_columns=None, return_block=
pandas Block
"""
- import pandas.core.internals as _int
+ import pandas.core.internals as _int # type: ignore[unresolved_import]
block_arr = item.get('block', None)
placement = item['placement']
@@ -806,7 +806,8 @@ def table_to_dataframe(
result = pa.lib.table_to_blocks(options, table, categories,
list(ext_columns_dtypes.keys()))
if _pandas_api.is_ge_v3():
- from pandas.api.internals import create_dataframe_from_blocks
+ from pandas.api.internals import create_dataframe_from_blocks \
+ # type: ignore[unresolved_import]
blocks = [
_reconstruct_block(
@@ -816,7 +817,8 @@ def table_to_dataframe(
df = create_dataframe_from_blocks(blocks, index=index, columns=columns)
return df
else:
- from pandas.core.internals import BlockManager
+ from pandas.core.internals import BlockManager \
+ # type: ignore[unresolved_import]
from pandas import DataFrame
blocks = [
diff --git c/python/pyarrow/parquet/core.py i/python/pyarrow/parquet/core.py
index 8c1a2ae782..7b6c57f968 100644
--- c/python/pyarrow/parquet/core.py
+++ i/python/pyarrow/parquet/core.py
@@ -29,14 +29,14 @@ import operator
import pyarrow as pa
try:
- import pyarrow._parquet as _parquet
+ import pyarrow._parquet as _parquet # type: ignore[unresolved_import]
except ImportError as exc:
raise ImportError(
"The pyarrow installation is not built with support "
f"for the Parquet file format ({str(exc)})"
) from None
-from pyarrow._parquet import (ParquetReader, Statistics, # noqa
+from pyarrow._parquet import (ParquetReader, Statistics, # type: ignore[unresolved_import] # noqa
FileMetaData, RowGroupMetaData,
ColumnChunkMetaData,
ParquetSchema, ColumnSchema,
diff --git c/python/pyarrow/parquet/encryption.py i/python/pyarrow/parquet/encryption.py
index df6eed913f..43e3bce04e 100644
--- c/python/pyarrow/parquet/encryption.py
+++ i/python/pyarrow/parquet/encryption.py
@@ -16,7 +16,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-from pyarrow._parquet_encryption import (CryptoFactory, # noqa
+from pyarrow._parquet_encryption import (CryptoFactory, # type: ignore[unresolved_import] # noqa
EncryptionConfiguration,
DecryptionConfiguration,
KmsConnectionConfig,
diff --git c/python/pyarrow/substrait.py i/python/pyarrow/substrait.py
index db2c3a96a1..7ddfa790cb 100644
--- c/python/pyarrow/substrait.py
+++ i/python/pyarrow/substrait.py
@@ -16,7 +16,7 @@
# under the License.
try:
- from pyarrow._substrait import ( # noqa
+ from pyarrow._substrait import ( # type: ignore[unresolved_import] # noqa
BoundExpressions,
get_supported_functions,
run_query,
diff --git c/python/pyarrow/tests/test_builder.py i/python/pyarrow/tests/test_builder.py
index 9187a19b5f..65ca1458d0 100644
--- c/python/pyarrow/tests/test_builder.py
+++ i/python/pyarrow/tests/test_builder.py
@@ -19,7 +19,8 @@ import math
import weakref
import pyarrow as pa
-from pyarrow.lib import StringBuilder, StringViewBuilder
+from pyarrow.lib import StringBuilder, StringViewBuilder \
+ # type: ignore[unresolved_import]
def test_weakref():
diff --git c/python/pyarrow/tests/test_compute.py i/python/pyarrow/tests/test_compute.py
index 003fb5db41..4ab0e63213 100644
--- c/python/pyarrow/tests/test_compute.py
+++ i/python/pyarrow/tests/test_compute.py
@@ -40,7 +40,7 @@ except ImportError:
import pyarrow as pa
import pyarrow.compute as pc
-from pyarrow.lib import ArrowNotImplementedError
+from pyarrow.lib import ArrowNotImplementedError # type: ignore[unresolved_import]
try:
import pyarrow.substrait as pas
diff --git c/python/pyarrow/tests/test_cpp_internals.py i/python/pyarrow/tests/test_cpp_internals.py
index 7508d8f0b9..359ef62b1f 100644
--- c/python/pyarrow/tests/test_cpp_internals.py
+++ i/python/pyarrow/tests/test_cpp_internals.py
@@ -20,7 +20,7 @@ from os.path import join as pjoin
import pytest
-from pyarrow._pyarrow_cpp_tests import get_cpp_tests
+from pyarrow._pyarrow_cpp_tests import get_cpp_tests # type: ignore[unresolved_import]
def inject_cpp_tests(ns):
diff --git c/python/pyarrow/tests/test_cuda_numba_interop.py i/python/pyarrow/tests/test_cuda_numba_interop.py
index 3bd81d755f..f211f0046f 100644
--- c/python/pyarrow/tests/test_cuda_numba_interop.py
+++ i/python/pyarrow/tests/test_cuda_numba_interop.py
@@ -26,7 +26,8 @@ dtypes = ['uint8', 'int16', 'float32']
cuda = pytest.importorskip("pyarrow.cuda")
nb_cuda = pytest.importorskip("numba.cuda")
-from numba.cuda.cudadrv.devicearray import DeviceNDArray # noqa: E402
+from numba.cuda.cudadrv.devicearray import DeviceNDArray \
+ # type: ignore[unresolved_import] # noqa: E402
context_choices = None
diff --git c/python/pyarrow/tests/test_dataset.py i/python/pyarrow/tests/test_dataset.py
index d1cd3f6b8a..d9a4d3df20 100644
--- c/python/pyarrow/tests/test_dataset.py
+++ i/python/pyarrow/tests/test_dataset.py
@@ -41,7 +41,7 @@ import pyarrow.csv
import pyarrow.feather
import pyarrow.fs as fs
import pyarrow.json
-from pyarrow.lib import is_threading_enabled
+from pyarrow.lib import is_threading_enabled # type: ignore[unresolved_import]
from pyarrow.tests.util import (FSProtocolClass, ProxyHandler,
_configure_s3_limited_user, _filesystem_uri,
change_cwd)
diff --git c/python/pyarrow/tests/test_flight.py i/python/pyarrow/tests/test_flight.py
index 600c649278..0c0bc7089b 100644
--- c/python/pyarrow/tests/test_flight.py
+++ i/python/pyarrow/tests/test_flight.py
@@ -37,7 +37,7 @@ except ImportError:
import pytest
import pyarrow as pa
-from pyarrow.lib import IpcReadOptions, tobytes
+from pyarrow.lib import IpcReadOptions, tobytes # type: ignore[unresolved_import]
from pyarrow.util import find_free_port
from pyarrow.tests import util
diff --git c/python/pyarrow/tests/test_fs.py i/python/pyarrow/tests/test_fs.py
index a5a10fa55c..61dcb76b24 100644
--- c/python/pyarrow/tests/test_fs.py
+++ i/python/pyarrow/tests/test_fs.py
@@ -2168,7 +2168,7 @@ def test_fsspec_filesystem_from_uri():
def test_huggingface_filesystem_from_uri():
pytest.importorskip("fsspec")
try:
- from huggingface_hub import HfFileSystem
+ from huggingface_hub import HfFileSystem # type: ignore[unresolved_import]
except ImportError:
pytest.skip("huggingface_hub not installed")
diff --git c/python/pyarrow/tests/test_gandiva.py i/python/pyarrow/tests/test_gandiva.py
index 80d119a485..01a6d2151a 100644
--- c/python/pyarrow/tests/test_gandiva.py
+++ i/python/pyarrow/tests/test_gandiva.py
@@ -23,7 +23,7 @@ import pyarrow as pa
@pytest.mark.gandiva
def test_tree_exp_builder():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
builder = gandiva.TreeExprBuilder()
@@ -65,7 +65,7 @@ def test_tree_exp_builder():
@pytest.mark.gandiva
def test_table():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
table = pa.Table.from_arrays([pa.array([1.0, 2.0]), pa.array([3.0, 4.0])],
['a', 'b'])
@@ -92,7 +92,7 @@ def test_table():
@pytest.mark.gandiva
def test_filter():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
table = pa.Table.from_arrays([pa.array([1.0 * i for i in range(10000)])],
['a'])
@@ -116,7 +116,7 @@ def test_filter():
@pytest.mark.gandiva
def test_in_expr():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
arr = pa.array(["ga", "an", "nd", "di", "iv", "va"])
table = pa.Table.from_arrays([arr], ["a"])
@@ -154,7 +154,7 @@ def test_in_expr():
@pytest.mark.skip(reason="Gandiva C++ did not have *real* binary, "
"time and date support.")
def test_in_expr_todo():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
# TODO: Implement reasonable support for timestamp, time & date.
# Current exceptions:
# pyarrow.lib.ArrowException: ExpressionValidationError:
@@ -227,7 +227,7 @@ def test_in_expr_todo():
@pytest.mark.gandiva
def test_boolean():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
table = pa.Table.from_arrays([
pa.array([1., 31., 46., 3., 57., 44., 22.]),
@@ -254,7 +254,7 @@ def test_boolean():
@pytest.mark.gandiva
def test_literals():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
builder = gandiva.TreeExprBuilder()
@@ -294,7 +294,7 @@ def test_literals():
@pytest.mark.gandiva
def test_regex():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
elements = ["park", "sparkle", "bright spark and fire", "spark"]
data = pa.array(elements, type=pa.string())
@@ -318,7 +318,7 @@ def test_regex():
@pytest.mark.gandiva
def test_get_registered_function_signatures():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
signatures = gandiva.get_registered_function_signatures()
assert type(signatures[0].return_type()) is pa.DataType
@@ -328,7 +328,7 @@ def test_get_registered_function_signatures():
@pytest.mark.gandiva
def test_filter_project():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
mpool = pa.default_memory_pool()
# Create a table with some sample data
array0 = pa.array([10, 12, -20, 5, 21, 29], pa.int32())
@@ -375,7 +375,7 @@ def test_filter_project():
@pytest.mark.gandiva
def test_to_string():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
builder = gandiva.TreeExprBuilder()
assert str(builder.make_literal(2.0, pa.float64())
@@ -395,7 +395,7 @@ def test_to_string():
@pytest.mark.gandiva
def test_rejects_none():
- import pyarrow.gandiva as gandiva
+ import pyarrow.gandiva as gandiva # type: ignore[unresolved_import]
builder = gandiva.TreeExprBuilder()
diff --git c/python/pyarrow/tests/test_jvm.py i/python/pyarrow/tests/test_jvm.py
index d71380b866..b048fcea9e 100644
--- c/python/pyarrow/tests/test_jvm.py
+++ i/python/pyarrow/tests/test_jvm.py
@@ -76,8 +76,8 @@ def test_jvm_buffer(root_allocator):
def test_jvm_buffer_released(root_allocator):
- import jpype.imports # noqa
- from java.lang import IllegalArgumentException
+ import jpype.imports # type: ignore[unresolved_import] # noqa
+ from java.lang import IllegalArgumentException # type: ignore[unresolved_import]
jvm_buffer = root_allocator.buffer(8)
jvm_buffer.release()
diff --git c/python/pyarrow/tests/test_misc.py i/python/pyarrow/tests/test_misc.py
index 64f45d8bed..09ac52588e 100644
--- c/python/pyarrow/tests/test_misc.py
+++ i/python/pyarrow/tests/test_misc.py
@@ -22,7 +22,7 @@ import sys
import pytest
import pyarrow as pa
-from pyarrow.lib import ArrowInvalid
+from pyarrow.lib import ArrowInvalid # type: ignore[unresolved_import]
def test_get_include():
diff --git c/python/pyarrow/tests/test_sparse_tensor.py i/python/pyarrow/tests/test_sparse_tensor.py
index 27974b80f8..e4d141e2a6 100644
--- c/python/pyarrow/tests/test_sparse_tensor.py
+++ i/python/pyarrow/tests/test_sparse_tensor.py
@@ -32,7 +32,7 @@ except ImportError:
scipy = None # type: ignore[assignment]
try:
- import sparse
+ import sparse # type: ignore[unresolved_import]
except ImportError:
sparse = None
diff --git c/python/pyarrow/tests/test_substrait.py i/python/pyarrow/tests/test_substrait.py
index fcd1c8d48c..fae89d3cee 100644
--- c/python/pyarrow/tests/test_substrait.py
+++ i/python/pyarrow/tests/test_substrait.py
@@ -22,8 +22,9 @@ import pytest
import pyarrow as pa
import pyarrow.compute as pc
-from pyarrow.lib import tobytes
-from pyarrow.lib import ArrowInvalid, ArrowNotImplementedError
+from pyarrow.lib import tobytes # type: ignore[unresolved_import]
+from pyarrow.lib import ArrowInvalid, ArrowNotImplementedError \
+ # type: ignore[unresolved_import]
try:
import pyarrow.substrait as substrait
@@ -36,7 +37,7 @@ pytestmark = pytest.mark.substrait
def mock_udf_context(batch_length=10):
- from pyarrow._compute import _get_udf_context
+ from pyarrow._compute import _get_udf_context # type: ignore[unresolved_import]
return _get_udf_context(pa.default_memory_pool(), batch_length)
diff --git c/python/pyarrow/tests/test_udf.py i/python/pyarrow/tests/test_udf.py
index dbc3086797..891295a551 100644
--- c/python/pyarrow/tests/test_udf.py
+++ i/python/pyarrow/tests/test_udf.py
@@ -39,7 +39,7 @@ except ImportError:
def mock_udf_context(batch_length=10):
- from pyarrow._compute import _get_udf_context
+ from pyarrow._compute import _get_udf_context # type: ignore[unresolved_import]
return _get_udf_context(pa.default_memory_pool(), batch_length)
diff --git c/python/pyarrow/types.py i/python/pyarrow/types.py
index ab4e5d1b99..ee2b7e1440 100644
--- c/python/pyarrow/types.py
+++ i/python/pyarrow/types.py
@@ -20,11 +20,11 @@
from enum import IntEnum
-from pyarrow.lib import (is_boolean_value, # noqa
+from pyarrow.lib import (is_boolean_value, # type: ignore[unresolved_import] # noqa
is_integer_value,
is_float_value)
-import pyarrow.lib as lib
+import pyarrow.lib as lib # type: ignore[unresolved_import]
from pyarrow.util import doc
diff --git c/python/stubs/__init__.pyi i/python/stubs/__init__.pyi
index 8a0d1e870c..0a1c49067c 100644
--- c/python/stubs/__init__.pyi
+++ i/python/stubs/__init__.pyi
@@ -1,11 +1,11 @@
# ruff: noqa: F401, I001, E402
__version__: str
-import pyarrow.lib as _lib
+import pyarrow.lib as _lib # type: ignore[unresolved_import]
_gc_enabled: bool
-from pyarrow.lib import (
+from pyarrow.lib import ( # type: ignore[unresolved_import]
BuildInfo,
RuntimeInfo,
set_timezone_db_path,
@@ -27,7 +27,7 @@ def show_info() -> None: ...
def _module_is_available(module: str) -> bool: ...
def _filesystem_is_available(fs: str) -> bool: ...
-from pyarrow.lib import (
+from pyarrow.lib import ( # type: ignore[unresolved_import]
null,
bool_,
int8,
@@ -233,9 +233,9 @@ from pyarrow.lib import (
)
# Buffers, allocation
-from pyarrow.lib import DeviceAllocationType, Device, MemoryManager, default_cpu_memory_manager
+from pyarrow.lib import DeviceAllocationType, Device, MemoryManager, default_cpu_memory_manager # type: ignore[unresolved_import]
-from pyarrow.lib import (
+from pyarrow.lib import ( # type: ignore[unresolved_import]
Buffer,
ResizableBuffer,
foreign_buffer,
@@ -246,7 +246,7 @@ from pyarrow.lib import (
allocate_buffer,
)
-from pyarrow.lib import (
+from pyarrow.lib import ( # type: ignore[unresolved_import]
MemoryPool,
LoggingMemoryPool,
ProxyMemoryPool,
@@ -264,7 +264,7 @@ from pyarrow.lib import (
)
# I/O
-from pyarrow.lib import (
+from pyarrow.lib import ( # type: ignore[unresolved_import]
NativeFile,
PythonFile,
BufferedInputStream,
@@ -287,7 +287,7 @@ from pyarrow.lib import (
have_libhdfs,
)
-from pyarrow.lib import (
+from pyarrow.lib import ( # type: ignore[unresolved_import]
ChunkedArray,
RecordBatch,
Table,
@@ -299,7 +299,7 @@ from pyarrow.lib import (
)
# Exceptions
-from pyarrow.lib import (
+from pyarrow.lib import ( # type: ignore[unresolved_import]
ArrowCancelled,
ArrowCapacityError,
ArrowException,
diff --git c/python/stubs/__lib_pxi/array.pyi i/python/stubs/__lib_pxi/array.pyi
index ffdb8a9c07..37b397f6bb 100644
--- c/python/stubs/__lib_pxi/array.pyi
+++ i/python/stubs/__lib_pxi/array.pyi
@@ -23,8 +23,8 @@ import numpy as np
import pandas as pd
from pandas.core.dtypes.base import ExtensionDtype
-from pyarrow._compute import CastOptions
-from pyarrow._stubs_typing import (
+from pyarrow._compute import CastOptions # type: ignore[unresolved_import]
+from pyarrow._stubs_typing import ( # type: ignore[unresolved_import]
ArrayLike,
Indices,
Mask,
@@ -32,7 +32,7 @@ from pyarrow._stubs_typing import (
SupportArrowArray,
SupportArrowDeviceArray,
)
-from pyarrow.lib import (
+from pyarrow.lib import ( # type: ignore[unresolved_import]
Buffer,
Device,
MemoryManager,
diff --git c/python/stubs/__lib_pxi/builder.pyi i/python/stubs/__lib_pxi/builder.pyi
index 4a0e9ca470..655d6436da 100644
--- c/python/stubs/__lib_pxi/builder.pyi
+++ i/python/stubs/__lib_pxi/builder.pyi
@@ -1,6 +1,6 @@
from typing import Iterable
-from pyarrow.lib import MemoryPool, _Weakrefable
+from pyarrow.lib import MemoryPool, _Weakrefable # type: ignore[unresolved_import]
from .array import StringArray, StringViewArray
diff --git c/python/stubs/__lib_pxi/device.pyi i/python/stubs/__lib_pxi/device.pyi
index d1b9f39eed..edcabdd796 100644
--- c/python/stubs/__lib_pxi/device.pyi
+++ i/python/stubs/__lib_pxi/device.pyi
@@ -1,6 +1,6 @@
import enum
-from pyarrow.lib import _Weakrefable
+from pyarrow.lib import _Weakrefable # type: ignore[unresolved_import]
class DeviceAllocationType(enum.Flag):
CPU = enum.auto()
diff --git c/python/stubs/__lib_pxi/io.pyi i/python/stubs/__lib_pxi/io.pyi
index 37c8aefb06..488dbf163a 100644
--- c/python/stubs/__lib_pxi/io.pyi
+++ i/python/stubs/__lib_pxi/io.pyi
@@ -17,8 +17,8 @@ else:
from typing import Any, Literal, SupportsIndex, overload
-from pyarrow._stubs_typing import Compression, SupportPyBuffer
-from pyarrow.lib import MemoryPool, _Weakrefable
+from pyarrow._stubs_typing import Compression, SupportPyBuffer # type: ignore[unresolved_import]
+from pyarrow.lib import MemoryPool, _Weakrefable # type: ignore[unresolved_import]
from .device import Device, DeviceAllocationType, MemoryManager
from .types import KeyValueMetadata
diff --git c/python/stubs/__lib_pxi/ipc.pyi i/python/stubs/__lib_pxi/ipc.pyi
index 3d72892061..13363e4447 100644
--- c/python/stubs/__lib_pxi/ipc.pyi
+++ i/python/stubs/__lib_pxi/ipc.pyi
@@ -11,8 +11,8 @@ from typing import Iterable, Iterator, Literal, Mapping, NamedTuple
import pandas as pd
-from pyarrow._stubs_typing import SupportArrowStream, SupportPyBuffer
-from pyarrow.lib import MemoryPool, RecordBatch, Schema, Table, Tensor, _Weakrefable
+from pyarrow._stubs_typing import SupportArrowStream, SupportPyBuffer # type: ignore[unresolved_import]
+from pyarrow.lib import MemoryPool, RecordBatch, Schema, Table, Tensor, _Weakrefable # type: ignore[unresolved_import]
from .io import Buffer, Codec, NativeFile
from .types import DictionaryMemo, KeyValueMetadata
diff --git c/python/stubs/__lib_pxi/memory.pyi i/python/stubs/__lib_pxi/memory.pyi
index 57a3bb4f1b..c58bf20dd9 100644
--- c/python/stubs/__lib_pxi/memory.pyi
+++ i/python/stubs/__lib_pxi/memory.pyi
@@ -1,4 +1,4 @@
-from pyarrow.lib import _Weakrefable
+from pyarrow.lib import _Weakrefable # type: ignore[unresolved_import]
class MemoryPool(_Weakrefable):
"""
diff --git c/python/stubs/__lib_pxi/pandas_shim.pyi i/python/stubs/__lib_pxi/pandas_shim.pyi
index 29a8485d06..c8cebf765a 100644
--- c/python/stubs/__lib_pxi/pandas_shim.pyi
+++ i/python/stubs/__lib_pxi/pandas_shim.pyi
@@ -1,5 +1,5 @@
from types import ModuleType
-from typing import Any, Iterable, TypeGuard
+from typing import Any, Iterable, TypeGuard # type: ignore[unresolved_import]
import pandas
diff --git c/python/stubs/__lib_pxi/scalar.pyi i/python/stubs/__lib_pxi/scalar.pyi
index 81ab501206..cfd4ee6f34 100644
--- c/python/stubs/__lib_pxi/scalar.pyi
+++ i/python/stubs/__lib_pxi/scalar.pyi
@@ -16,8 +16,8 @@ from typing import Any, Generic, Iterator, Literal, Mapping, overload
import numpy as np
-from pyarrow._compute import CastOptions
-from pyarrow.lib import Array, Buffer, MemoryPool, MonthDayNano, Tensor, _Weakrefable
+from pyarrow._compute import CastOptions # type: ignore[unresolved_import]
+from pyarrow.lib import Array, Buffer, MemoryPool, MonthDayNano, Tensor, _Weakrefable # type: ignore[unresolved_import]
from typing_extensions import Protocol, TypeVar
from . import types
diff --git c/python/stubs/__lib_pxi/table.pyi i/python/stubs/__lib_pxi/table.pyi
index fbcfb1ef74..1ce21b6ed2 100644
--- c/python/stubs/__lib_pxi/table.pyi
+++ i/python/stubs/__lib_pxi/table.pyi
@@ -31,7 +31,7 @@ import numpy as np
import pandas as pd
from numpy.typing import NDArray
-from pyarrow._compute import (
+from pyarrow._compute import ( # type: ignore[unresolved_import]
CastOptions,
CountOptions,
FunctionOptions,
@@ -39,7 +39,7 @@ from pyarrow._compute import (
TDigestOptions,
VarianceOptions,
)
-from pyarrow._stubs_typing import (
+from pyarrow._stubs_typing import ( # type: ignore[unresolved_import]
Indices,
Mask,
NullEncoding,
@@ -49,12 +49,15 @@ from pyarrow._stubs_typing import (
SupportArrowDeviceArray,
SupportArrowStream,
)
-from pyarrow.compute import ArrayOrChunkedArray, Expression
+from pyarrow.compute import ArrayOrChunkedArray, Expression # type: ignore[unresolved_import]
from pyarrow.interchange.dataframe import _PyArrowDataFrame
-from pyarrow.lib import Device, Field, MemoryManager, MemoryPool, MonthDayNano, Schema
+from pyarrow.lib import Device, Field, MemoryManager, MemoryPool, MonthDayNano, Schema # type: ignore[unresolved_import]
from . import array, scalar, types
-from .array import Array, NullableCollection, StructArray, _CastAs, _PandasConvertible
+from .array import (
+ Array, StructArray, _CastAs, _PandasConvertible,
+ NullableCollection, # type: ignore[unresolved_import]
+)
from .device import DeviceAllocationType
from .io import Buffer
from .ipc import RecordBatchReader
diff --git c/python/stubs/__lib_pxi/tensor.pyi i/python/stubs/__lib_pxi/tensor.pyi
index d849abd0f1..a28804c6e3 100644
--- c/python/stubs/__lib_pxi/tensor.pyi
+++ i/python/stubs/__lib_pxi/tensor.pyi
@@ -7,9 +7,9 @@ else:
import numpy as np
-from pyarrow.lib import _Weakrefable
+from pyarrow.lib import _Weakrefable # type: ignore[unresolved_import]
from scipy.sparse import coo_matrix, csr_matrix
-from sparse import COO
+from sparse import COO # type: ignore[unresolved_import]
class Tensor(_Weakrefable):
"""
diff --git c/python/stubs/__lib_pxi/types.pyi i/python/stubs/__lib_pxi/types.pyi
index a7b6062b27..d38269ef34 100644
--- c/python/stubs/__lib_pxi/types.pyi
+++ i/python/stubs/__lib_pxi/types.pyi
@@ -14,8 +14,8 @@ from typing import Any, Generic, Iterable, Iterator, Literal, overload
import numpy as np
import pandas as pd
-from pyarrow._stubs_typing import SupportArrowSchema
-from pyarrow.lib import (
+from pyarrow._stubs_typing import SupportArrowSchema # type: ignore[unresolved_import]
+from pyarrow.lib import ( # type: ignore[unresolved_import]
Array,
ChunkedArray,
ExtensionArray,
@@ -29,6 +29,7 @@ from .io import Buffer
from .scalar import ExtensionScalar
_AsPyType = TypeVar("_AsPyType")
+_DataTypeT = TypeVar("_DataTypeT", bound=DataType)
class _Weakrefable: ...
class _Metadata(_Weakrefable): ...
diff --git c/python/stubs/_compute.pyi i/python/stubs/_compute.pyi
index 3d61ae4278..071fceb392 100644
--- c/python/stubs/_compute.pyi
+++ i/python/stubs/_compute.pyi
@@ -1,12 +1,6 @@
from typing import (
- Any,
- Callable,
- Iterable,
- Literal,
- Sequence,
- TypeAlias,
- TypedDict,
- overload,
+ Any, Callable, Iterable, Literal, Sequence, TypedDict, overload,
+ TypeAlias, # type: ignore[unresolved_import]
)
from . import lib
diff --git c/python/stubs/_fs.pyi i/python/stubs/_fs.pyi
index 9f6e28dcf0..d3b194e3de 100644
--- c/python/stubs/_fs.pyi
+++ i/python/stubs/_fs.pyi
@@ -19,6 +19,8 @@ from fsspec import AbstractFileSystem # type: ignore[import-untyped]
from .lib import NativeFile, _Weakrefable
+SupportedFileSystem: TypeAlias = Union[AbstractFileSystem, FileSystem]
+
class FileType(enum.IntFlag):
NotFound = enum.auto()
Unknown = enum.auto()
diff --git c/python/stubs/_parquet.pyi i/python/stubs/_parquet.pyi
index a9187df042..053f2d0826 100644
--- c/python/stubs/_parquet.pyi
+++ i/python/stubs/_parquet.pyi
@@ -1,4 +1,7 @@
-from typing import IO, Any, Iterable, Iterator, Literal, Sequence, TypeAlias, TypedDict
+from typing import (
+ IO, Any, Iterable, Iterator, Literal, Sequence, TypedDict,
+ TypeAlias, # type: ignore[unresolved_import]
+)
from _typeshed import StrPath
diff --git c/python/stubs/_s3fs.pyi i/python/stubs/_s3fs.pyi
index fc13c498bd..8e67c80561 100644
--- c/python/stubs/_s3fs.pyi
+++ i/python/stubs/_s3fs.pyi
@@ -1,6 +1,9 @@
import enum
-from typing import Literal, NotRequired, Required, TypedDict
+from typing import (
+ Literal, TypedDict,
+ NotRequired, Required, # type: ignore[unresolved_import]
+)
from ._fs import FileSystem
from .lib import KeyValueMetadata
diff --git c/python/stubs/_stubs_typing.pyi i/python/stubs/_stubs_typing.pyi
index 40d931d24e..73bb9f38a9 100644
--- c/python/stubs/_stubs_typing.pyi
+++ i/python/stubs/_stubs_typing.pyi
@@ -2,7 +2,10 @@ import datetime as dt
from collections.abc import Sequence
from decimal import Decimal
-from typing import Any, Collection, Literal, Protocol, TypeAlias, TypeVar, Union
+from typing import (
+ Any, Collection, Literal, Protocol, TypeVar, Union,
+ TypeAlias # type: ignore[unresolved_import]
+)
import numpy as np
diff --git c/python/stubs/benchmark.pyi i/python/stubs/benchmark.pyi
index 048973301d..972fad10a5 100644
--- c/python/stubs/benchmark.pyi
+++ i/python/stubs/benchmark.pyi
@@ -1,3 +1,3 @@
-from pyarrow.lib import benchmark_PandasObjectIsNull
+from pyarrow.lib import benchmark_PandasObjectIsNull # type: ignore[unresolved_import]
__all__ = ["benchmark_PandasObjectIsNull"]
diff --git c/python/stubs/compute.pyi i/python/stubs/compute.pyi
index 1cf52ff07c..775b7fa504 100644
--- c/python/stubs/compute.pyi
+++ i/python/stubs/compute.pyi
@@ -1,94 +1,100 @@
# ruff: noqa: I001
-from typing import Literal, TypeAlias, TypeVar, overload, Any, Iterable, ParamSpec, Sequence
+from typing import Literal, TypeAlias, TypeVar, overload, Any, Iterable, ParamSpec, Sequence # type: ignore[unresolved_import]
from collections.abc import Callable
# Option classes
-from pyarrow._compute import ArraySortOptions as ArraySortOptions
-from pyarrow._compute import AssumeTimezoneOptions as AssumeTimezoneOptions
-from pyarrow._compute import CastOptions as CastOptions
-from pyarrow._compute import CountOptions as CountOptions
-from pyarrow._compute import CumulativeOptions as CumulativeOptions
-from pyarrow._compute import CumulativeSumOptions as CumulativeSumOptions
-from pyarrow._compute import DayOfWeekOptions as DayOfWeekOptions
-from pyarrow._compute import DictionaryEncodeOptions as DictionaryEncodeOptions
-from pyarrow._compute import ElementWiseAggregateOptions as ElementWiseAggregateOptions
+from pyarrow._compute import ( # type: ignore[unresolved_import]
+ ArraySortOptions as ArraySortOptions,
+ AssumeTimezoneOptions as AssumeTimezoneOptions,
+ CastOptions as CastOptions,
+ CountOptions as CountOptions,
+ CumulativeOptions as CumulativeOptions,
+ CumulativeSumOptions as CumulativeSumOptions,
+ DayOfWeekOptions as DayOfWeekOptions,
+ DictionaryEncodeOptions as DictionaryEncodeOptions,
+ ElementWiseAggregateOptions as ElementWiseAggregateOptions,
+)
# Expressions
-from pyarrow._compute import Expression as Expression
-from pyarrow._compute import ExtractRegexOptions as ExtractRegexOptions
-from pyarrow._compute import ExtractRegexSpanOptions as ExtractRegexSpanOptions
-from pyarrow._compute import FilterOptions as FilterOptions
-from pyarrow._compute import Function as Function
-from pyarrow._compute import FunctionOptions as FunctionOptions
-from pyarrow._compute import FunctionRegistry as FunctionRegistry
-from pyarrow._compute import HashAggregateFunction as HashAggregateFunction
-from pyarrow._compute import HashAggregateKernel as HashAggregateKernel
-from pyarrow._compute import IndexOptions as IndexOptions
-from pyarrow._compute import JoinOptions as JoinOptions
-from pyarrow._compute import Kernel as Kernel
-from pyarrow._compute import ListFlattenOptions as ListFlattenOptions
-from pyarrow._compute import ListSliceOptions as ListSliceOptions
-from pyarrow._compute import MakeStructOptions as MakeStructOptions
-from pyarrow._compute import MapLookupOptions as MapLookupOptions
-from pyarrow._compute import MatchSubstringOptions as MatchSubstringOptions
-from pyarrow._compute import ModeOptions as ModeOptions
-from pyarrow._compute import NullOptions as NullOptions
-from pyarrow._compute import PadOptions as PadOptions
-from pyarrow._compute import PairwiseOptions as PairwiseOptions
-from pyarrow._compute import PartitionNthOptions as PartitionNthOptions
-from pyarrow._compute import PivotWiderOptions as PivotWiderOptions
-from pyarrow._compute import QuantileOptions as QuantileOptions
-from pyarrow._compute import RandomOptions as RandomOptions
-from pyarrow._compute import RankOptions as RankOptions
-from pyarrow._compute import RankQuantileOptions as RankQuantileOptions
-from pyarrow._compute import ReplaceSliceOptions as ReplaceSliceOptions
-from pyarrow._compute import ReplaceSubstringOptions as ReplaceSubstringOptions
-from pyarrow._compute import RoundBinaryOptions as RoundBinaryOptions
-from pyarrow._compute import RoundOptions as RoundOptions
-from pyarrow._compute import RoundTemporalOptions as RoundTemporalOptions
-from pyarrow._compute import RoundToMultipleOptions as RoundToMultipleOptions
-from pyarrow._compute import RunEndEncodeOptions as RunEndEncodeOptions
-from pyarrow._compute import ScalarAggregateFunction as ScalarAggregateFunction
-from pyarrow._compute import ScalarAggregateKernel as ScalarAggregateKernel
-from pyarrow._compute import ScalarAggregateOptions as ScalarAggregateOptions
-from pyarrow._compute import ScalarFunction as ScalarFunction
-from pyarrow._compute import ScalarKernel as ScalarKernel
-from pyarrow._compute import SelectKOptions as SelectKOptions
-from pyarrow._compute import SetLookupOptions as SetLookupOptions
-from pyarrow._compute import SkewOptions as SkewOptions
-from pyarrow._compute import SliceOptions as SliceOptions
-from pyarrow._compute import SortOptions as SortOptions
-from pyarrow._compute import SplitOptions as SplitOptions
-from pyarrow._compute import SplitPatternOptions as SplitPatternOptions
-from pyarrow._compute import StrftimeOptions as StrftimeOptions
-from pyarrow._compute import StrptimeOptions as StrptimeOptions
-from pyarrow._compute import StructFieldOptions as StructFieldOptions
-from pyarrow._compute import TakeOptions as TakeOptions
-from pyarrow._compute import TDigestOptions as TDigestOptions
-from pyarrow._compute import TrimOptions as TrimOptions
-from pyarrow._compute import UdfContext as UdfContext
-from pyarrow._compute import Utf8NormalizeOptions as Utf8NormalizeOptions
-from pyarrow._compute import VarianceOptions as VarianceOptions
-from pyarrow._compute import VectorFunction as VectorFunction
-from pyarrow._compute import VectorKernel as VectorKernel
-from pyarrow._compute import WeekOptions as WeekOptions
-from pyarrow._compute import WinsorizeOptions as WinsorizeOptions
+from pyarrow._compute import ( # type: ignore[unresolved_import]
+ Expression as Expression,
+ ExtractRegexOptions as ExtractRegexOptions,
+ ExtractRegexSpanOptions as ExtractRegexSpanOptions,
+ FilterOptions as FilterOptions,
+ Function as Function,
+ FunctionOptions as FunctionOptions,
+ FunctionRegistry as FunctionRegistry,
+ HashAggregateFunction as HashAggregateFunction,
+ HashAggregateKernel as HashAggregateKernel,
+ IndexOptions as IndexOptions,
+ JoinOptions as JoinOptions,
+ Kernel as Kernel,
+ ListFlattenOptions as ListFlattenOptions,
+ ListSliceOptions as ListSliceOptions,
+ MakeStructOptions as MakeStructOptions,
+ MapLookupOptions as MapLookupOptions,
+ MatchSubstringOptions as MatchSubstringOptions,
+ ModeOptions as ModeOptions,
+ NullOptions as NullOptions,
+ PadOptions as PadOptions,
+ PairwiseOptions as PairwiseOptions,
+ PartitionNthOptions as PartitionNthOptions,
+ PivotWiderOptions as PivotWiderOptions,
+ QuantileOptions as QuantileOptions,
+ RandomOptions as RandomOptions,
+ RankOptions as RankOptions,
+ RankQuantileOptions as RankQuantileOptions,
+ ReplaceSliceOptions as ReplaceSliceOptions,
+ ReplaceSubstringOptions as ReplaceSubstringOptions,
+ RoundBinaryOptions as RoundBinaryOptions,
+ RoundOptions as RoundOptions,
+ RoundTemporalOptions as RoundTemporalOptions,
+ RoundToMultipleOptions as RoundToMultipleOptions,
+ RunEndEncodeOptions as RunEndEncodeOptions,
+ ScalarAggregateFunction as ScalarAggregateFunction,
+ ScalarAggregateKernel as ScalarAggregateKernel,
+ ScalarAggregateOptions as ScalarAggregateOptions,
+ ScalarFunction as ScalarFunction,
+ ScalarKernel as ScalarKernel,
+ SelectKOptions as SelectKOptions,
+ SetLookupOptions as SetLookupOptions,
+ SkewOptions as SkewOptions,
+ SliceOptions as SliceOptions,
+ SortOptions as SortOptions,
+ SplitOptions as SplitOptions,
+ SplitPatternOptions as SplitPatternOptions,
+ StrftimeOptions as StrftimeOptions,
+ StrptimeOptions as StrptimeOptions,
+ StructFieldOptions as StructFieldOptions,
+ TakeOptions as TakeOptions,
+ TDigestOptions as TDigestOptions,
+ TrimOptions as TrimOptions,
+ UdfContext as UdfContext,
+ Utf8NormalizeOptions as Utf8NormalizeOptions,
+ VarianceOptions as VarianceOptions,
+ VectorFunction as VectorFunction,
+ VectorKernel as VectorKernel,
+ WeekOptions as WeekOptions,
+ WinsorizeOptions as WinsorizeOptions,
+)
# Functions
-from pyarrow._compute import call_function as call_function
+from pyarrow._compute import call_function as call_function # type: ignore[unresolved_import]
# Udf
-from pyarrow._compute import call_tabular_function as call_tabular_function
-from pyarrow._compute import function_registry as function_registry
-from pyarrow._compute import get_function as get_function
-from pyarrow._compute import list_functions as list_functions
-from pyarrow._compute import register_aggregate_function as register_aggregate_function
-from pyarrow._compute import register_scalar_function as register_scalar_function
-from pyarrow._compute import register_tabular_function as register_tabular_function
-from pyarrow._compute import register_vector_function as register_vector_function
+from pyarrow._compute import ( # type: ignore[unresolved_import]
+ call_tabular_function as call_tabular_function,
+ function_registry as function_registry,
+ get_function as get_function,
+ list_functions as list_functions,
+ register_aggregate_function as register_aggregate_function,
+ register_scalar_function as register_scalar_function,
+ register_tabular_function as register_tabular_function,
+ register_vector_function as register_vector_function,
+)
-from pyarrow._compute import _Order, _Placement
-from pyarrow._stubs_typing import ArrayLike, ScalarLike
+from pyarrow._compute import _Order, _Placement # type: ignore[unresolved_import]
+from pyarrow._stubs_typing import ArrayLike, ScalarLike # type: ignore[unresolved_import]
from . import lib
_P = ParamSpec("_P")
diff --git c/python/stubs/csv.pyi i/python/stubs/csv.pyi
index 510229d7e7..cea5542d1c 100644
--- c/python/stubs/csv.pyi
+++ i/python/stubs/csv.pyi
@@ -1,4 +1,4 @@
-from pyarrow._csv import (
+from pyarrow._csv import ( # type: ignore[unresolved_import]
ISO8601,
ConvertOptions,
CSVStreamingReader,
diff --git c/python/stubs/cuda.pyi i/python/stubs/cuda.pyi
index e11baf7d4e..3c69e746f7 100644
--- c/python/stubs/cuda.pyi
+++ i/python/stubs/cuda.pyi
@@ -1,4 +1,4 @@
-from pyarrow._cuda import (
+from pyarrow._cuda import ( # type: ignore[unresolved_import]
BufferReader,
BufferWriter,
Context,
diff --git c/python/stubs/dataset.pyi i/python/stubs/dataset.pyi
index 98f1a38aa8..a57e9f2f3f 100644
--- c/python/stubs/dataset.pyi
+++ i/python/stubs/dataset.pyi
@@ -1,7 +1,7 @@
-from typing import Callable, Iterable, Literal, Sequence, TypeAlias, overload
+from typing import Callable, Iterable, Literal, Sequence, TypeAlias, overload # type: ignore[unresolved_import]
from _typeshed import StrPath
-from pyarrow._dataset import (
+from pyarrow._dataset import ( # type: ignore[unresolved_import]
CsvFileFormat,
CsvFragmentScanOptions,
Dataset,
@@ -32,8 +32,8 @@ from pyarrow._dataset import (
WrittenFile,
get_partition_keys,
)
-from pyarrow._dataset_orc import OrcFileFormat
-from pyarrow._dataset_parquet import (
+from pyarrow._dataset_orc import OrcFileFormat # type: ignore[unresolved_import]
+from pyarrow._dataset_parquet import ( # type: ignore[unresolved_import]
ParquetDatasetFactory,
ParquetFactoryOptions,
ParquetFileFormat,
@@ -43,12 +43,12 @@ from pyarrow._dataset_parquet import (
ParquetReadOptions,
RowGroupInfo,
)
-from pyarrow._dataset_parquet_encryption import (
+from pyarrow._dataset_parquet_encryption import ( # type: ignore[unresolved_import]
ParquetDecryptionConfig,
ParquetEncryptionConfig,
)
from pyarrow.compute import Expression, field, scalar
-from pyarrow.lib import Array, RecordBatch, RecordBatchReader, Schema, Table
+from pyarrow.lib import Array, RecordBatch, RecordBatchReader, Schema, Table # type: ignore[unresolved_import]
from ._fs import SupportedFileSystem
diff --git c/python/stubs/feather.pyi i/python/stubs/feather.pyi
index 9451ee1576..63766cd5d6 100644
--- c/python/stubs/feather.pyi
+++ i/python/stubs/feather.pyi
@@ -3,8 +3,8 @@ from typing import IO, Literal
import pandas as pd
from _typeshed import StrPath
-from pyarrow._feather import FeatherError
-from pyarrow.lib import Table
+from pyarrow._feather import FeatherError # type: ignore[unresolved_import]
+from pyarrow.lib import Table # type: ignore[unresolved_import]
__all__ = [
"FeatherError",
diff --git c/python/stubs/flight.pyi i/python/stubs/flight.pyi
index 9b806ccf30..aa06f3ebec 100644
--- c/python/stubs/flight.pyi
+++ i/python/stubs/flight.pyi
@@ -1,4 +1,4 @@
-from pyarrow._flight import (
+from pyarrow._flight import ( # type: ignore[unresolved_import]
Action,
ActionType,
BasicAuth,
diff --git c/python/stubs/fs.pyi i/python/stubs/fs.pyi
index 6bf75616c1..07a1d7765e 100644
--- c/python/stubs/fs.pyi
+++ i/python/stubs/fs.pyi
@@ -1,4 +1,4 @@
-from pyarrow._fs import ( # noqa
+from pyarrow._fs import ( # type: ignore[unresolved_import] # noqa
FileSelector,
FileType,
FileInfo,
@@ -10,10 +10,10 @@ from pyarrow._fs import ( # noqa
PyFileSystem,
SupportedFileSystem,
)
-from pyarrow._azurefs import AzureFileSystem
-from pyarrow._hdfs import HadoopFileSystem
-from pyarrow._gcsfs import GcsFileSystem
-from pyarrow._s3fs import ( # noqa
+from pyarrow._azurefs import AzureFileSystem # type: ignore[unresolved_import]
+from pyarrow._hdfs import HadoopFileSystem # type: ignore[unresolved_import]
+from pyarrow._gcsfs import GcsFileSystem # type: ignore[unresolved_import]
+from pyarrow._s3fs import ( # type: ignore[unresolved_import] # noqa
AwsDefaultS3RetryStrategy,
AwsStandardS3RetryStrategy,
S3FileSystem,
diff --git c/python/stubs/interchange/buffer.pyi i/python/stubs/interchange/buffer.pyi
index 46673961a7..afef5acf35 100644
--- c/python/stubs/interchange/buffer.pyi
+++ i/python/stubs/interchange/buffer.pyi
@@ -1,6 +1,6 @@
import enum
-from pyarrow.lib import Buffer
+from pyarrow.lib import Buffer # type: ignore[unresolved_import]
class DlpackDeviceType(enum.IntEnum):
"""Integer enum for device type codes matching DLPack."""
diff --git c/python/stubs/interchange/column.pyi i/python/stubs/interchange/column.pyi
index e6662867b6..7d89c4ae6b 100644
--- c/python/stubs/interchange/column.pyi
+++ i/python/stubs/interchange/column.pyi
@@ -1,8 +1,8 @@
import enum
-from typing import Any, Iterable, TypeAlias, TypedDict
+from typing import Any, Iterable, TypeAlias, TypedDict # type: ignore[unresolved_import]
-from pyarrow.lib import Array, ChunkedArray
+from pyarrow.lib import Array, ChunkedArray # type: ignore[unresolved_import]
from .buffer import _PyArrowBuffer
diff --git c/python/stubs/interchange/dataframe.pyi i/python/stubs/interchange/dataframe.pyi
index 526a58926a..7a17dfeb1e 100644
--- c/python/stubs/interchange/dataframe.pyi
+++ i/python/stubs/interchange/dataframe.pyi
@@ -7,7 +7,7 @@ else:
from typing import Any, Iterable, Sequence
from pyarrow.interchange.column import _PyArrowColumn
-from pyarrow.lib import RecordBatch, Table
+from pyarrow.lib import RecordBatch, Table # type: ignore[unresolved_import]
class _PyArrowDataFrame:
"""
diff --git c/python/stubs/interchange/from_dataframe.pyi i/python/stubs/interchange/from_dataframe.pyi
index b04b626897..ad461270f5 100644
--- c/python/stubs/interchange/from_dataframe.pyi
+++ i/python/stubs/interchange/from_dataframe.pyi
@@ -1,6 +1,6 @@
-from typing import Any, Protocol, TypeAlias
+from typing import Any, Protocol, TypeAlias # type: ignore[unresolved_import]
-from pyarrow.lib import Array, Buffer, DataType, DictionaryArray, RecordBatch, Table
+from pyarrow.lib import Array, Buffer, DataType, DictionaryArray, RecordBatch, Table # type: ignore[unresolved_import]
from .column import (
ColumnBuffers,
diff --git c/python/stubs/ipc.pyi i/python/stubs/ipc.pyi
index c7f2af004d..2a5e8294e4 100644
--- c/python/stubs/ipc.pyi
+++ i/python/stubs/ipc.pyi
@@ -1,9 +1,9 @@
from io import IOBase
import pandas as pd
-import pyarrow.lib as lib
+import pyarrow.lib as lib # type: ignore[unresolved_import]
-from pyarrow.lib import (
+from pyarrow.lib import ( # type: ignore[unresolved_import]
IpcReadOptions,
IpcWriteOptions,
Message,
diff --git c/python/stubs/json.pyi i/python/stubs/json.pyi
index db1d35e0b8..97b94d5dd7 100644
--- c/python/stubs/json.pyi
+++ i/python/stubs/json.pyi
@@ -1,3 +1,3 @@
-from pyarrow._json import ParseOptions, ReadOptions, open_json, read_json
+from pyarrow._json import ParseOptions, ReadOptions, open_json, read_json # type: ignore[unresolved_import]
__all__ = ["ParseOptions", "ReadOptions", "read_json", "open_json"]
diff --git c/python/stubs/parquet/core.pyi i/python/stubs/parquet/core.pyi
index 56b2c8447d..01dce442fe 100644
--- c/python/stubs/parquet/core.pyi
+++ i/python/stubs/parquet/core.pyi
@@ -13,10 +13,10 @@ if sys.version_info >= (3, 10):
else:
from typing_extensions import TypeAlias
-from pyarrow import _parquet
-from pyarrow._compute import Expression
-from pyarrow._fs import FileSystem, SupportedFileSystem
-from pyarrow._parquet import (
+from pyarrow import _parquet # type: ignore[unresolved_import]
+from pyarrow._compute import Expression # type: ignore[unresolved_import]
+from pyarrow._fs import FileSystem, SupportedFileSystem # type: ignore[unresolved_import]
+from pyarrow._parquet import ( # type: ignore[unresolved_import]
ColumnChunkMetaData,
ColumnSchema,
FileDecryptionProperties,
@@ -29,9 +29,9 @@ from pyarrow._parquet import (
SortingColumn,
Statistics,
)
-from pyarrow._stubs_typing import FilterTuple, SingleOrList
+from pyarrow._stubs_typing import FilterTuple, SingleOrList # type: ignore[unresolved_import]
from pyarrow.dataset import ParquetFileFragment, Partitioning
-from pyarrow.lib import NativeFile, RecordBatch, Schema, Table
+from pyarrow.lib import NativeFile, RecordBatch, Schema, Table # type: ignore[unresolved_import]
from typing_extensions import deprecated
__all__ = (
diff --git c/python/stubs/parquet/encryption.pyi i/python/stubs/parquet/encryption.pyi
index 5a77dae7ef..daade78e6d 100644
--- c/python/stubs/parquet/encryption.pyi
+++ i/python/stubs/parquet/encryption.pyi
@@ -1,4 +1,4 @@
-from pyarrow._parquet_encryption import (
+from pyarrow._parquet_encryption import ( # type: ignore[unresolved_import]
CryptoFactory,
DecryptionConfiguration,
EncryptionConfiguration,
diff --git c/python/stubs/substrait.pyi i/python/stubs/substrait.pyi
index a56a8a5b40..004439d4c1 100644
--- c/python/stubs/substrait.pyi
+++ i/python/stubs/substrait.pyi
@@ -1,4 +1,4 @@
-from pyarrow._substrait import (
+from pyarrow._substrait import ( # type: ignore[unresolved_import]
BoundExpressions,
SubstraitSchema,
deserialize_expressions,
diff --git c/python/stubs/types.pyi i/python/stubs/types.pyi
index 0cb4f6171d..c128770d17 100644
--- c/python/stubs/types.pyi
+++ i/python/stubs/types.pyi
@@ -11,7 +11,7 @@ if sys.version_info >= (3, 10):
else:
from typing_extensions import TypeAlias
-from pyarrow.lib import (
+from pyarrow.lib import ( # type: ignore[unresolved_import]
BinaryType,
BinaryViewType,
BoolType,
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.
See #2 and #4 for more details.