]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/python/pyarrow/tests/test_serialization_deprecated.py
cd4b3ed78c876a3ac1b39ceaad723bc659af2370
[ceph.git] / ceph / src / arrow / python / pyarrow / tests / test_serialization_deprecated.py
1 # Licensed to the Apache Software Foundation (ASF) under one
2 # or more contributor license agreements. See the NOTICE file
3 # distributed with this work for additional information
4 # regarding copyright ownership. The ASF licenses this file
5 # to you under the Apache License, Version 2.0 (the
6 # "License"); you may not use this file except in compliance
7 # with the License. You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing,
12 # software distributed under the License is distributed on an
13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 # KIND, either express or implied. See the License for the
15 # specific language governing permissions and limitations
16 # under the License.
17
18 import sys
19
20 import pytest
21
22 import pyarrow as pa
23
24
25 def test_serialization_deprecated():
26 with pytest.warns(FutureWarning):
27 ser = pa.serialize(1)
28
29 with pytest.warns(FutureWarning):
30 pa.deserialize(ser.to_buffer())
31
32 f = pa.BufferOutputStream()
33 with pytest.warns(FutureWarning):
34 pa.serialize_to(12, f)
35
36 buf = f.getvalue()
37 f = pa.BufferReader(buf)
38 with pytest.warns(FutureWarning):
39 pa.read_serialized(f).deserialize()
40
41 with pytest.warns(FutureWarning):
42 pa.default_serialization_context()
43
44 context = pa.lib.SerializationContext()
45 with pytest.warns(FutureWarning):
46 pa.register_default_serialization_handlers(context)
47
48
49 @pytest.mark.skipif(sys.version_info < (3, 7),
50 reason="getattr needs Python 3.7")
51 def test_serialization_deprecated_toplevel():
52 with pytest.warns(FutureWarning):
53 pa.SerializedPyObject()
54
55 with pytest.warns(FutureWarning):
56 pa.SerializationContext()