Skip to content

Commit 2b194ad

Browse files
AlenkaFpitroujorisvandenbossche
authored
GH-20127: [Python] Remove deprecated pyarrow.filesystem legacy implementations (#39825)
This PR removes the `pyarrow.filesystem` and `pyarrow.hdfs` filesystems that have been deprecated since 2.0.0. * Closes: #20127 Lead-authored-by: AlenkaF <frim.alenka@gmail.com> Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com> Co-authored-by: Antoine Pitrou <pitrou@free.fr> Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
1 parent 70bb0fb commit 2b194ad

16 files changed

Lines changed: 93 additions & 2053 deletions

docs/source/python/filesystems_deprecated.rst

Lines changed: 0 additions & 88 deletions
This file was deleted.

docs/source/python/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ files into Arrow structures.
4949
memory
5050
ipc
5151
filesystems
52-
filesystems_deprecated
5352
numpy
5453
pandas
5554
interchange_protocol

python/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,6 @@ set(CYTHON_EXTENSIONS
545545
_csv
546546
_feather
547547
_fs
548-
_hdfsio
549548
_json
550549
_pyarrow_cpp_tests)
551550
set_source_files_properties(pyarrow/lib.pyx PROPERTIES CYTHON_API TRUE)

python/pyarrow/__init__.py

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,8 @@ def print_entry(label, value):
255255
BufferReader, BufferOutputStream,
256256
OSFile, MemoryMappedFile, memory_map,
257257
create_memory_map, MockOutputStream,
258-
input_stream, output_stream)
259-
260-
from pyarrow._hdfsio import HdfsFile, have_libhdfs
258+
input_stream, output_stream,
259+
have_libhdfs)
261260

262261
from pyarrow.lib import (ChunkedArray, RecordBatch, Table, table,
263262
concat_arrays, concat_tables, TableGroupBy,
@@ -276,54 +275,12 @@ def print_entry(label, value):
276275
ArrowTypeError,
277276
ArrowSerializationError)
278277

279-
import pyarrow.hdfs as hdfs
280-
281278
from pyarrow.ipc import serialize_pandas, deserialize_pandas
282279
import pyarrow.ipc as ipc
283280

284281
import pyarrow.types as types
285282

286283

287-
# deprecated top-level access
288-
289-
290-
from pyarrow.filesystem import FileSystem as _FileSystem
291-
from pyarrow.filesystem import LocalFileSystem as _LocalFileSystem
292-
from pyarrow.hdfs import HadoopFileSystem as _HadoopFileSystem
293-
294-
295-
_localfs = _LocalFileSystem._get_instance()
296-
297-
298-
_msg = (
299-
"pyarrow.{0} is deprecated as of 2.0.0, please use pyarrow.fs.{1} instead."
300-
)
301-
302-
_serialization_msg = (
303-
"'pyarrow.{0}' is deprecated and will be removed in a future version. "
304-
"Use pickle or the pyarrow IPC functionality instead."
305-
)
306-
307-
_deprecated = {
308-
"localfs": (_localfs, "LocalFileSystem"),
309-
"FileSystem": (_FileSystem, "FileSystem"),
310-
"LocalFileSystem": (_LocalFileSystem, "LocalFileSystem"),
311-
"HadoopFileSystem": (_HadoopFileSystem, "HadoopFileSystem"),
312-
}
313-
314-
315-
def __getattr__(name):
316-
if name in _deprecated:
317-
obj, new_name = _deprecated[name]
318-
_warnings.warn(_msg.format(name, new_name),
319-
FutureWarning, stacklevel=2)
320-
return obj
321-
322-
raise AttributeError(
323-
"module 'pyarrow' has no attribute '{0}'".format(name)
324-
)
325-
326-
327284
# ----------------------------------------------------------------------
328285
# Deprecations
329286

0 commit comments

Comments
 (0)