From 031f786df96a59acf3c5cb63b423c1ca14af589e Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Fri, 7 Oct 2022 10:28:39 +0200 Subject: [PATCH 01/16] Add a warning to .rst documents --- docs/source/developers/python.rst | 6 ++++-- docs/source/python/api/plasma.rst | 4 ++++ docs/source/python/plasma.rst | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/source/developers/python.rst b/docs/source/developers/python.rst index 188486cae37..fc48b2d65ec 100644 --- a/docs/source/developers/python.rst +++ b/docs/source/developers/python.rst @@ -109,7 +109,8 @@ The test groups currently include: * ``large_memory``: Test requiring a large amount of system RAM * ``orc``: Apache ORC tests * ``parquet``: Apache Parquet tests -* ``plasma``: Plasma Object Store tests +* ``plasma``: Plasma Object Store tests (deprecated since Arrow 10.0.0, + will be removed in 12.0.0 or so) * ``s3``: Tests for Amazon S3 * ``tensorflow``: Tests that involve TensorFlow @@ -330,7 +331,8 @@ adding flags with ``ON``: * ``ARROW_ORC``: Support for Apache ORC file format * ``ARROW_PARQUET``: Support for Apache Parquet file format * ``PARQUET_REQUIRE_ENCRYPTION``: Support for Parquet Modular Encryption -* ``ARROW_PLASMA``: Shared memory object store +* ``ARROW_PLASMA``: Shared memory object store (deprecated since Arrow 10.0.0, + will be removed in 12.0.0 or so) Anything set to ``ON`` above can also be turned off. Note that some compression libraries are recommended for full Parquet support. diff --git a/docs/source/python/api/plasma.rst b/docs/source/python/api/plasma.rst index 8df9e4e21ac..0ef21116cf4 100644 --- a/docs/source/python/api/plasma.rst +++ b/docs/source/python/api/plasma.rst @@ -22,6 +22,10 @@ Plasma In-Memory Object Store ============================= +.. warning:: + + Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so. + Classes ------- diff --git a/docs/source/python/plasma.rst b/docs/source/python/plasma.rst index 51c7b6eafee..c12a0ddbe96 100644 --- a/docs/source/python/plasma.rst +++ b/docs/source/python/plasma.rst @@ -21,6 +21,10 @@ The Plasma In-Memory Object Store ================================= +.. warning:: + + Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so. + .. note:: As present, Plasma is only supported for use on Linux and macOS. From 686070cb4996dcc4231dd5364feec7f0fae209c7 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Fri, 7 Oct 2022 11:01:32 +0200 Subject: [PATCH 02/16] Add deprecated directive to docstrings for Plasma classes: ObjectID, PlasmaClient, PlasmaBuffer --- python/pyarrow/_plasma.pyx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/python/pyarrow/_plasma.pyx b/python/pyarrow/_plasma.pyx index 35d39073634..7f0028c8c21 100644 --- a/python/pyarrow/_plasma.pyx +++ b/python/pyarrow/_plasma.pyx @@ -156,7 +156,10 @@ def make_object_id(object_id): cdef class ObjectID(_Weakrefable): """ - An ObjectID represents a string of bytes used to identify Plasma objects. + DEPRECATED: An ObjectID represents a string of bytes used to identify Plasma objects. + + .. deprecated:: 10.0.0 + Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so. """ cdef: @@ -219,13 +222,16 @@ cdef class ObjectNotAvailable(_Weakrefable): cdef class PlasmaBuffer(Buffer): """ - This is the type returned by calls to get with a PlasmaClient. + DEPRECATED: This is the type returned by calls to get with a PlasmaClient. We define our own class instead of directly returning a buffer object so that we can add a custom destructor which notifies Plasma that the object is no longer being used, so the memory in the Plasma store backing the object can potentially be freed. + .. deprecated:: 10.0.0 + Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so. + Attributes ---------- object_id : ObjectID @@ -295,11 +301,14 @@ def get_socket_from_fd(fileno, family, type): cdef class PlasmaClient(_Weakrefable): """ - The PlasmaClient is used to interface with a plasma store and manager. + DEPRECATED: The PlasmaClient is used to interface with a plasma store and manager. The PlasmaClient can ask the PlasmaStore to allocate a new buffer, seal a buffer, and get a buffer. Buffers are referred to by object IDs, which are strings. + + .. deprecated:: 10.0.0 + Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so. """ cdef: From f2827c0af0c512499d09d7d7315ae68676d2ea6f Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Mon, 10 Oct 2022 09:29:16 +0200 Subject: [PATCH 03/16] Add warnings.warn to PlasmaClient class --- python/pyarrow/_plasma.pyx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/pyarrow/_plasma.pyx b/python/pyarrow/_plasma.pyx index 7f0028c8c21..675937f5bee 100644 --- a/python/pyarrow/_plasma.pyx +++ b/python/pyarrow/_plasma.pyx @@ -321,6 +321,10 @@ cdef class PlasmaClient(_Weakrefable): self.notification_fd = -1 self.store_socket_name = b"" + warnings.warn( + "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so.", + DeprecationWarning) + cdef _get_object_buffers(self, object_ids, int64_t timeout_ms, c_vector[CObjectBuffer]* result): cdef: From cdff9b70f4dc2977f8011dc99afae55f095c6796 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Mon, 10 Oct 2022 09:34:10 +0200 Subject: [PATCH 04/16] Add warnings.warn to ObjectID class --- python/pyarrow/_plasma.pyx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/pyarrow/_plasma.pyx b/python/pyarrow/_plasma.pyx index 675937f5bee..e54468117cc 100644 --- a/python/pyarrow/_plasma.pyx +++ b/python/pyarrow/_plasma.pyx @@ -172,6 +172,10 @@ cdef class ObjectID(_Weakrefable): " is " + str(object_id)) self.data = CUniqueID.from_binary(object_id) + warnings.warn( + "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so.", + DeprecationWarning) + def __eq__(self, other): try: return self.data == (other).data From cd018d37bfe49e2bc606553846b867a76adcff57 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Mon, 10 Oct 2022 10:38:09 +0200 Subject: [PATCH 05/16] Add warnings for _plasma_store_entry_point --- python/pyarrow/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/pyarrow/__init__.py b/python/pyarrow/__init__.py index 19d630bc0ab..be3c1427476 100644 --- a/python/pyarrow/__init__.py +++ b/python/pyarrow/__init__.py @@ -341,13 +341,21 @@ def __getattr__(name): def _plasma_store_entry_point(): - """Entry point for starting the plasma store. + """ + DEPRECATED: Entry point for starting the plasma store. This can be used by invoking e.g. ``plasma_store -s /tmp/plasma -m 1000000000`` from the command line and will start the plasma_store executable with the given arguments. + + .. deprecated:: 10.0.0 + Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so. """ + warnings.warn( + "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so.", + DeprecationWarning) + import pyarrow plasma_store_executable = _os.path.join(pyarrow.__path__[0], "plasma-store-server") From 6e2cd7fa9effeee92f3eae3598f4170523cd0a5c Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Mon, 10 Oct 2022 11:49:55 +0200 Subject: [PATCH 06/16] Add tests for deprecation warnings and suppress the warnings in test_plasma.py --- python/pyarrow/tests/test_plasma.py | 4 +++ .../pyarrow/tests/test_plasma_deprecated.py | 34 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 python/pyarrow/tests/test_plasma_deprecated.py diff --git a/python/pyarrow/tests/test_plasma.py b/python/pyarrow/tests/test_plasma.py index ed08a687258..cf9ec5a95d0 100644 --- a/python/pyarrow/tests/test_plasma.py +++ b/python/pyarrow/tests/test_plasma.py @@ -30,6 +30,10 @@ import pyarrow as pa +# ignore all Plasma deprecation warnings in this file, we test that the +# warnings are actually raised in test_plasma_deprecated.py +pytestmark = pytest.mark.filterwarnings("ignore::DeprecationWarning") + DEFAULT_PLASMA_STORE_MEMORY = 10 ** 8 USE_VALGRIND = os.getenv("PLASMA_VALGRIND") == "1" EXTERNAL_STORE = "hashtable://test" diff --git a/python/pyarrow/tests/test_plasma_deprecated.py b/python/pyarrow/tests/test_plasma_deprecated.py new file mode 100644 index 00000000000..3cb74330470 --- /dev/null +++ b/python/pyarrow/tests/test_plasma_deprecated.py @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import os +import numpy as np +import pytest + +import pyarrow as pa +import pyarrow.plasma as plasma + +def test_plasma_deprecated(): + with pytest.warns(DeprecationWarning): + plasma_store_ctx = plasma.start_plasma_store( + plasma_store_memory=10 ** 8, + use_valgrind=os.getenv("PLASMA_VALGRIND") == "1") + plasma_store_name, _ = plasma_store_ctx.__enter__() + plasma.connect(plasma_store_name) + + with pytest.warns(DeprecationWarning): + plasma.ObjectID(20 * b"a") From af1ee1d5ed919659c51f2757566c62f2d635a157 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Mon, 10 Oct 2022 11:54:14 +0200 Subject: [PATCH 07/16] Linter corrections --- python/pyarrow/__init__.py | 4 ++-- python/pyarrow/tests/test_plasma_deprecated.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/python/pyarrow/__init__.py b/python/pyarrow/__init__.py index be3c1427476..bcb6b30e715 100644 --- a/python/pyarrow/__init__.py +++ b/python/pyarrow/__init__.py @@ -353,8 +353,8 @@ def _plasma_store_entry_point(): Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so. """ warnings.warn( - "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so.", - DeprecationWarning) + "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so.", + DeprecationWarning) import pyarrow plasma_store_executable = _os.path.join(pyarrow.__path__[0], diff --git a/python/pyarrow/tests/test_plasma_deprecated.py b/python/pyarrow/tests/test_plasma_deprecated.py index 3cb74330470..48f051464bb 100644 --- a/python/pyarrow/tests/test_plasma_deprecated.py +++ b/python/pyarrow/tests/test_plasma_deprecated.py @@ -16,12 +16,11 @@ # under the License. import os -import numpy as np import pytest -import pyarrow as pa import pyarrow.plasma as plasma + def test_plasma_deprecated(): with pytest.warns(DeprecationWarning): plasma_store_ctx = plasma.start_plasma_store( From c4ab82bd61d250afff3d163e979e3053d2fe4e27 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Mon, 10 Oct 2022 12:52:19 +0200 Subject: [PATCH 08/16] Add plasma mark to test_plasma_deprecated() --- python/pyarrow/tests/test_plasma_deprecated.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/pyarrow/tests/test_plasma_deprecated.py b/python/pyarrow/tests/test_plasma_deprecated.py index 48f051464bb..54307fe3d86 100644 --- a/python/pyarrow/tests/test_plasma_deprecated.py +++ b/python/pyarrow/tests/test_plasma_deprecated.py @@ -18,10 +18,11 @@ import os import pytest -import pyarrow.plasma as plasma - +@pytest.mark.plasma def test_plasma_deprecated(): + import pyarrow.plasma as plasma + with pytest.warns(DeprecationWarning): plasma_store_ctx = plasma.start_plasma_store( plasma_store_memory=10 ** 8, From 4e82b6b0c35f107b89aecf6cf57fb2bcb100c1fc Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Tue, 11 Oct 2022 09:54:41 +0200 Subject: [PATCH 09/16] Add warning to start_plasma_store() and change test --- python/pyarrow/plasma.py | 10 +++++++++- python/pyarrow/tests/test_plasma_deprecated.py | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/python/pyarrow/plasma.py b/python/pyarrow/plasma.py index 712ed9e5b22..e60292d8594 100644 --- a/python/pyarrow/plasma.py +++ b/python/pyarrow/plasma.py @@ -24,6 +24,7 @@ import sys import tempfile import time +import warnings from pyarrow._plasma import (ObjectID, ObjectNotAvailable, # noqa PlasmaBuffer, PlasmaClient, connect, @@ -84,7 +85,10 @@ def start_plasma_store(plasma_store_memory, plasma_directory=None, use_hugepages=False, external_store=None): """ - Start a plasma store process. + DEPRECATED: Start a plasma store process. + + .. deprecated:: 10.0.0 + Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so. Parameters ---------- @@ -109,6 +113,10 @@ def start_plasma_store(plasma_store_memory, A tuple of the name of the plasma store socket and the process ID of the plasma store process. """ + warnings.warn( + "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so.", + DeprecationWarning) + if use_valgrind and use_profiler: raise Exception("Cannot use valgrind and profiler at the same time.") diff --git a/python/pyarrow/tests/test_plasma_deprecated.py b/python/pyarrow/tests/test_plasma_deprecated.py index 54307fe3d86..a2af54f3e77 100644 --- a/python/pyarrow/tests/test_plasma_deprecated.py +++ b/python/pyarrow/tests/test_plasma_deprecated.py @@ -27,7 +27,9 @@ def test_plasma_deprecated(): plasma_store_ctx = plasma.start_plasma_store( plasma_store_memory=10 ** 8, use_valgrind=os.getenv("PLASMA_VALGRIND") == "1") - plasma_store_name, _ = plasma_store_ctx.__enter__() + + plasma_store_name, _ = plasma_store_ctx.__enter__() + with pytest.warns(DeprecationWarning): plasma.connect(plasma_store_name) with pytest.warns(DeprecationWarning): From 48bcf41b281a8d7ceb580afea3049fcb891ce896 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Tue, 11 Oct 2022 10:01:28 +0200 Subject: [PATCH 10/16] Move test_plasma_deprecated() to test_plasma.py --- python/pyarrow/tests/test_plasma.py | 17 +++++++++ .../pyarrow/tests/test_plasma_deprecated.py | 36 ------------------- 2 files changed, 17 insertions(+), 36 deletions(-) delete mode 100644 python/pyarrow/tests/test_plasma_deprecated.py diff --git a/python/pyarrow/tests/test_plasma.py b/python/pyarrow/tests/test_plasma.py index cf9ec5a95d0..ae2aac24004 100644 --- a/python/pyarrow/tests/test_plasma.py +++ b/python/pyarrow/tests/test_plasma.py @@ -1075,3 +1075,20 @@ def test_store_capacity(): with plasma.start_plasma_store(plasma_store_memory=10000) as (name, p): plasma_client = plasma.connect(name) assert plasma_client.store_capacity() == 10000 + + +@pytest.mark.plasma +def test_plasma_deprecated(): + import pyarrow.plasma as plasma + + with pytest.warns(DeprecationWarning): + plasma_store_ctx = plasma.start_plasma_store( + plasma_store_memory=10 ** 8, + use_valgrind=os.getenv("PLASMA_VALGRIND") == "1") + + plasma_store_name, _ = plasma_store_ctx.__enter__() + with pytest.warns(DeprecationWarning): + plasma.connect(plasma_store_name) + + with pytest.warns(DeprecationWarning): + plasma.ObjectID(20 * b"a") \ No newline at end of file diff --git a/python/pyarrow/tests/test_plasma_deprecated.py b/python/pyarrow/tests/test_plasma_deprecated.py deleted file mode 100644 index a2af54f3e77..00000000000 --- a/python/pyarrow/tests/test_plasma_deprecated.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -import os -import pytest - - -@pytest.mark.plasma -def test_plasma_deprecated(): - import pyarrow.plasma as plasma - - with pytest.warns(DeprecationWarning): - plasma_store_ctx = plasma.start_plasma_store( - plasma_store_memory=10 ** 8, - use_valgrind=os.getenv("PLASMA_VALGRIND") == "1") - - plasma_store_name, _ = plasma_store_ctx.__enter__() - with pytest.warns(DeprecationWarning): - plasma.connect(plasma_store_name) - - with pytest.warns(DeprecationWarning): - plasma.ObjectID(20 * b"a") From 913e88edb06d4b6d825a0641d5b5744dc54815a3 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Tue, 11 Oct 2022 10:07:13 +0200 Subject: [PATCH 11/16] Linter corrections --- python/pyarrow/plasma.py | 8 +++++--- python/pyarrow/tests/test_plasma.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/python/pyarrow/plasma.py b/python/pyarrow/plasma.py index e60292d8594..5c2c6543418 100644 --- a/python/pyarrow/plasma.py +++ b/python/pyarrow/plasma.py @@ -88,7 +88,8 @@ def start_plasma_store(plasma_store_memory, DEPRECATED: Start a plasma store process. .. deprecated:: 10.0.0 - Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so. + Plasma is deprecated since Arrow 10.0.0. It will be removed + in 12.0.0 or so. Parameters ---------- @@ -114,8 +115,9 @@ def start_plasma_store(plasma_store_memory, the plasma store process. """ warnings.warn( - "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so.", - DeprecationWarning) + "Plasma is deprecated since Arrow 10.0.0. It will be removed in " + "12.0.0 or so.", + DeprecationWarning) if use_valgrind and use_profiler: raise Exception("Cannot use valgrind and profiler at the same time.") diff --git a/python/pyarrow/tests/test_plasma.py b/python/pyarrow/tests/test_plasma.py index ae2aac24004..4e9a94c29de 100644 --- a/python/pyarrow/tests/test_plasma.py +++ b/python/pyarrow/tests/test_plasma.py @@ -1091,4 +1091,4 @@ def test_plasma_deprecated(): plasma.connect(plasma_store_name) with pytest.warns(DeprecationWarning): - plasma.ObjectID(20 * b"a") \ No newline at end of file + plasma.ObjectID(20 * b"a") From 805781269e873c0441fe2d9ef47aa62d8649569b Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Tue, 11 Oct 2022 10:45:35 +0200 Subject: [PATCH 12/16] Move the explicit __enter__ call inside the block being tested --- python/pyarrow/tests/test_plasma.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyarrow/tests/test_plasma.py b/python/pyarrow/tests/test_plasma.py index 4e9a94c29de..590d6c64392 100644 --- a/python/pyarrow/tests/test_plasma.py +++ b/python/pyarrow/tests/test_plasma.py @@ -1085,8 +1085,8 @@ def test_plasma_deprecated(): plasma_store_ctx = plasma.start_plasma_store( plasma_store_memory=10 ** 8, use_valgrind=os.getenv("PLASMA_VALGRIND") == "1") + plasma_store_name, _ = plasma_store_ctx.__enter__() - plasma_store_name, _ = plasma_store_ctx.__enter__() with pytest.warns(DeprecationWarning): plasma.connect(plasma_store_name) From 6f370ea015d881cbcdd9148cd5b5dc31f767a6a0 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Wed, 12 Oct 2022 08:35:29 +0200 Subject: [PATCH 13/16] Make changes to the test_plasma_deprecated() --- python/pyarrow/tests/test_plasma.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/python/pyarrow/tests/test_plasma.py b/python/pyarrow/tests/test_plasma.py index 590d6c64392..32947133591 100644 --- a/python/pyarrow/tests/test_plasma.py +++ b/python/pyarrow/tests/test_plasma.py @@ -1081,14 +1081,21 @@ def test_store_capacity(): def test_plasma_deprecated(): import pyarrow.plasma as plasma - with pytest.warns(DeprecationWarning): - plasma_store_ctx = plasma.start_plasma_store( - plasma_store_memory=10 ** 8, - use_valgrind=os.getenv("PLASMA_VALGRIND") == "1") - plasma_store_name, _ = plasma_store_ctx.__enter__() + plasma_store_ctx = plasma.start_plasma_store( + plasma_store_memory=10 ** 8, + use_valgrind=os.getenv("PLASMA_VALGRIND") == "1") with pytest.warns(DeprecationWarning): - plasma.connect(plasma_store_name) + with plasma_store_ctx: + pass + + plasma_store_ctx = plasma.start_plasma_store( + plasma_store_memory=10 ** 8, + use_valgrind=os.getenv("PLASMA_VALGRIND") == "1") + + with plasma_store_ctx as (plasma_store_name, _): + with pytest.warns(DeprecationWarning): + plasma.connect(plasma_store_name) with pytest.warns(DeprecationWarning): plasma.ObjectID(20 * b"a") From 3b0db54989cc7510a2096be52ba572f8bea4ffb3 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Wed, 12 Oct 2022 10:39:35 +0200 Subject: [PATCH 14/16] Apply suggestions from code review - Joris Co-authored-by: Joris Van den Bossche --- python/pyarrow/_plasma.pyx | 4 ++-- python/pyarrow/tests/test_plasma.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/pyarrow/_plasma.pyx b/python/pyarrow/_plasma.pyx index e54468117cc..594fdf67518 100644 --- a/python/pyarrow/_plasma.pyx +++ b/python/pyarrow/_plasma.pyx @@ -174,7 +174,7 @@ cdef class ObjectID(_Weakrefable): warnings.warn( "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so.", - DeprecationWarning) + DeprecationWarning, stacklevel=2) def __eq__(self, other): try: @@ -327,7 +327,7 @@ cdef class PlasmaClient(_Weakrefable): warnings.warn( "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so.", - DeprecationWarning) + DeprecationWarning, stacklevel=3) cdef _get_object_buffers(self, object_ids, int64_t timeout_ms, c_vector[CObjectBuffer]* result): diff --git a/python/pyarrow/tests/test_plasma.py b/python/pyarrow/tests/test_plasma.py index 32947133591..6cf75c492d4 100644 --- a/python/pyarrow/tests/test_plasma.py +++ b/python/pyarrow/tests/test_plasma.py @@ -32,7 +32,7 @@ # ignore all Plasma deprecation warnings in this file, we test that the # warnings are actually raised in test_plasma_deprecated.py -pytestmark = pytest.mark.filterwarnings("ignore::DeprecationWarning") +pytestmark = pytest.mark.filterwarnings("ignore:'Plasma:DeprecationWarning") DEFAULT_PLASMA_STORE_MEMORY = 10 ** 8 USE_VALGRIND = os.getenv("PLASMA_VALGRIND") == "1" From 8561eb0b21d7986041d569f5d46b02551bd52fdd Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Wed, 12 Oct 2022 10:42:18 +0200 Subject: [PATCH 15/16] Add deprecation notice to connect() docstrings --- python/pyarrow/_plasma.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/pyarrow/_plasma.pyx b/python/pyarrow/_plasma.pyx index 594fdf67518..61a4ac14651 100644 --- a/python/pyarrow/_plasma.pyx +++ b/python/pyarrow/_plasma.pyx @@ -871,9 +871,12 @@ cdef class PlasmaClient(_Weakrefable): def connect(store_socket_name, int num_retries=-1): """ - Return a new PlasmaClient that is connected a plasma store and + DEPRECATED: Return a new PlasmaClient that is connected a plasma store and optionally a manager. + .. deprecated:: 10.0.0 + Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so. + Parameters ---------- store_socket_name : str From cecad02f8dc015c917f07be5f864fbb2b52752e9 Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Wed, 12 Oct 2022 11:02:49 +0200 Subject: [PATCH 16/16] Remove apostrophe in filterwarnings --- python/pyarrow/tests/test_plasma.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyarrow/tests/test_plasma.py b/python/pyarrow/tests/test_plasma.py index 6cf75c492d4..cc5fd0357dd 100644 --- a/python/pyarrow/tests/test_plasma.py +++ b/python/pyarrow/tests/test_plasma.py @@ -32,7 +32,7 @@ # ignore all Plasma deprecation warnings in this file, we test that the # warnings are actually raised in test_plasma_deprecated.py -pytestmark = pytest.mark.filterwarnings("ignore:'Plasma:DeprecationWarning") +pytestmark = pytest.mark.filterwarnings("ignore:Plasma:DeprecationWarning") DEFAULT_PLASMA_STORE_MEMORY = 10 ** 8 USE_VALGRIND = os.getenv("PLASMA_VALGRIND") == "1"