maxframe 1.2.0__cp37-cp37m-macosx_10_9_x86_64.whl → 1.2.1__cp37-cp37m-macosx_10_9_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of maxframe might be problematic. Click here for more details.
- maxframe/_utils.cpython-37m-darwin.so +0 -0
- maxframe/core/graph/core.cpython-37m-darwin.so +0 -0
- maxframe/dataframe/datasource/read_odps_query.py +1 -1
- maxframe/dataframe/datasource/tests/test_datasource.py +4 -0
- maxframe/lib/dtypes_extension/__init__.py +1 -1
- maxframe/lib/dtypes_extension/dtypes.py +0 -46
- maxframe/lib/dtypes_extension/tests/test_dtypes.py +1 -31
- maxframe/lib/mmh3.cpython-37m-darwin.so +0 -0
- maxframe/serialization/core.cpython-37m-darwin.so +0 -0
- {maxframe-1.2.0.dist-info → maxframe-1.2.1.dist-info}/METADATA +1 -1
- {maxframe-1.2.0.dist-info → maxframe-1.2.1.dist-info}/RECORD +13 -13
- {maxframe-1.2.0.dist-info → maxframe-1.2.1.dist-info}/WHEEL +0 -0
- {maxframe-1.2.0.dist-info → maxframe-1.2.1.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -262,7 +262,7 @@ class DataFrameReadODPSQuery(
|
|
|
262
262
|
column_renames = DictField("column_renames", default=None)
|
|
263
263
|
|
|
264
264
|
def get_columns(self):
|
|
265
|
-
return self.columns
|
|
265
|
+
return self.columns or list(self.dtypes.index)
|
|
266
266
|
|
|
267
267
|
def set_pruned_columns(self, columns, *, keep_order=None): # pragma: no cover
|
|
268
268
|
self.columns = columns
|
|
@@ -364,6 +364,7 @@ def test_from_odps_query():
|
|
|
364
364
|
index=["col1", "col2", "col3"],
|
|
365
365
|
),
|
|
366
366
|
)
|
|
367
|
+
assert df.op.get_columns() == ["col1", "col2", "col3"]
|
|
367
368
|
|
|
368
369
|
df = read_odps_query(query1, skip_schema=True)
|
|
369
370
|
assert df.dtypes is None
|
|
@@ -373,6 +374,7 @@ def test_from_odps_query():
|
|
|
373
374
|
df = read_odps_query(query1, index_col="col1")
|
|
374
375
|
assert df.op.query == query1
|
|
375
376
|
assert df.index_value.name == "col1"
|
|
377
|
+
assert df.op.get_columns() == ["col2", "col3"]
|
|
376
378
|
assert isinstance(df.index_value.value, IndexValue.Index)
|
|
377
379
|
pd.testing.assert_series_equal(
|
|
378
380
|
df.dtypes,
|
|
@@ -389,6 +391,7 @@ def test_from_odps_query():
|
|
|
389
391
|
df = read_odps_query(query2, index_col=["col1", "col2"])
|
|
390
392
|
assert df.op.query == query2
|
|
391
393
|
assert df.index_value.names == ["col1", "col2"]
|
|
394
|
+
assert df.op.get_columns() == ["c31", "c32"]
|
|
392
395
|
assert isinstance(df.index_value.value, IndexValue.MultiIndex)
|
|
393
396
|
pd.testing.assert_series_equal(
|
|
394
397
|
df.dtypes,
|
|
@@ -405,6 +408,7 @@ def test_from_odps_query():
|
|
|
405
408
|
assert df.op.query == query3
|
|
406
409
|
assert df.op.extra_params.no_split_sql is False
|
|
407
410
|
assert df.index_value.names == ["c1"]
|
|
411
|
+
assert df.op.get_columns() == ["c32"]
|
|
408
412
|
pd.testing.assert_series_equal(
|
|
409
413
|
df.dtypes,
|
|
410
414
|
pd.Series([np.dtype("float64")], index=["c32"]),
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
from .dtypes import ArrowDtype, dict_,
|
|
14
|
+
from .dtypes import ArrowDtype, dict_, is_map_dtype
|
|
@@ -13,10 +13,8 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
from typing import Union
|
|
15
15
|
|
|
16
|
-
import numpy as np
|
|
17
16
|
import pandas as pd
|
|
18
17
|
import pyarrow as pa
|
|
19
|
-
from pandas.api.extensions import ExtensionDtype
|
|
20
18
|
|
|
21
19
|
try:
|
|
22
20
|
from pandas import ArrowDtype
|
|
@@ -45,47 +43,3 @@ def is_map_dtype(dtype: ArrowDtype) -> bool:
|
|
|
45
43
|
if ArrowDtype is None:
|
|
46
44
|
raise ImportError("ArrowDtype is not supported in current environment")
|
|
47
45
|
return isinstance(dtype, ArrowDtype) and isinstance(dtype.pyarrow_dtype, pa.MapType)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
_dtype_mapping = {
|
|
51
|
-
pd.Int8Dtype(): lambda x: pa.int8(),
|
|
52
|
-
pd.Int16Dtype(): lambda x: pa.int16(),
|
|
53
|
-
pd.Int32Dtype(): lambda x: pa.int32(),
|
|
54
|
-
pd.Int64Dtype(): lambda x: pa.int64(),
|
|
55
|
-
pd.UInt8Dtype(): lambda x: pa.uint8(),
|
|
56
|
-
pd.UInt16Dtype(): lambda x: pa.uint16(),
|
|
57
|
-
pd.UInt32Dtype(): lambda x: pa.uint32(),
|
|
58
|
-
pd.UInt64Dtype(): lambda x: pa.uint64(),
|
|
59
|
-
pd.BooleanDtype(): lambda x: pa.bool_(),
|
|
60
|
-
pd.Float32Dtype(): lambda x: pa.float32(),
|
|
61
|
-
pd.Float64Dtype(): lambda x: pa.float64(),
|
|
62
|
-
pd.StringDtype(): lambda x: pa.string(),
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def infer_arrow_dtype(
|
|
67
|
-
dtype: Union[np.dtype, pa.DataType, ExtensionDtype]
|
|
68
|
-
) -> Union[ArrowDtype, ExtensionDtype]:
|
|
69
|
-
"""
|
|
70
|
-
Convert any pandas accepted dtype to arrow type in a best effort way.
|
|
71
|
-
|
|
72
|
-
Parameters
|
|
73
|
-
----------
|
|
74
|
-
dtype : Union[np.dtype, pa.DataType, ExtensionDtype]
|
|
75
|
-
The dtype instance, can be np.dtype, pa.DataType or ExtensionDtype
|
|
76
|
-
|
|
77
|
-
Returns
|
|
78
|
-
-------
|
|
79
|
-
Union[pd.ArrowDtype, ExtensionDtype]: The converted pd.ArrowDtype, or ExtensionDtype if conversion failed.
|
|
80
|
-
"""
|
|
81
|
-
if isinstance(dtype, ArrowDtype):
|
|
82
|
-
return dtype
|
|
83
|
-
|
|
84
|
-
if isinstance(dtype, np.dtype):
|
|
85
|
-
return ArrowDtype(pa.from_numpy_dtype(dtype))
|
|
86
|
-
if isinstance(dtype, pd.DatetimeTZDtype):
|
|
87
|
-
return pa.timestamp(dtype.unit, dtype.tz)
|
|
88
|
-
|
|
89
|
-
if dtype in _dtype_mapping:
|
|
90
|
-
return ArrowDtype(_dtype_mapping[dtype](dtype))
|
|
91
|
-
return dtype
|
|
@@ -12,13 +12,12 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
import numpy as np
|
|
16
15
|
import pandas as pd
|
|
17
16
|
import pyarrow as pa
|
|
18
17
|
import pytest
|
|
19
18
|
|
|
20
19
|
from ....utils import ARROW_DTYPE_NOT_SUPPORTED
|
|
21
|
-
from ..dtypes import dict_,
|
|
20
|
+
from ..dtypes import dict_, is_map_dtype
|
|
22
21
|
|
|
23
22
|
try:
|
|
24
23
|
from pandas import ArrowDtype
|
|
@@ -37,32 +36,3 @@ def test_map_dtype():
|
|
|
37
36
|
dt = pd.ArrowDtype(pa.list_(pa.int64()))
|
|
38
37
|
assert not is_map_dtype(dt)
|
|
39
38
|
assert not is_map_dtype(pd.Int64Dtype)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
@pytest.mark.skipif(
|
|
43
|
-
ARROW_DTYPE_NOT_SUPPORTED,
|
|
44
|
-
reason="pandas doesn't support ArrowDtype",
|
|
45
|
-
)
|
|
46
|
-
@pytest.mark.parametrize(
|
|
47
|
-
"input_dtype, expected_type, expected_pa_dtype",
|
|
48
|
-
[
|
|
49
|
-
(
|
|
50
|
-
ArrowDtype(pa.int64()) if ArrowDtype else None,
|
|
51
|
-
ArrowDtype,
|
|
52
|
-
pa.int64(),
|
|
53
|
-
), # pd.ArrowDtype
|
|
54
|
-
(np.dtype("int64"), ArrowDtype, pa.int64()), # np.dtype
|
|
55
|
-
(pd.CategoricalDtype(), pd.CategoricalDtype, None), # pa.DataType
|
|
56
|
-
(pd.Int64Dtype(), ArrowDtype, pa.int64()), # pd.ExtensionDtype
|
|
57
|
-
(
|
|
58
|
-
pd.DatetimeTZDtype("ns", "Asia/Shanghai"),
|
|
59
|
-
pa.TimestampType,
|
|
60
|
-
pa.timestamp("ns", "Asia/Shanghai"),
|
|
61
|
-
),
|
|
62
|
-
],
|
|
63
|
-
)
|
|
64
|
-
def test_infer_arrow_dtype(input_dtype, expected_type, expected_pa_dtype):
|
|
65
|
-
result = infer_arrow_dtype(input_dtype)
|
|
66
|
-
assert isinstance(result, expected_type)
|
|
67
|
-
if expected_type == ArrowDtype:
|
|
68
|
-
assert result.pyarrow_dtype == expected_pa_dtype
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
maxframe-1.2.
|
|
2
|
-
maxframe-1.2.
|
|
3
|
-
maxframe-1.2.
|
|
4
|
-
maxframe-1.2.
|
|
1
|
+
maxframe-1.2.1.dist-info/RECORD,,
|
|
2
|
+
maxframe-1.2.1.dist-info/WHEEL,sha256=HS_2vgrXyXO7N4Q-5VnuMAgG-fG_r8eemMgfU9Aw3Kk,110
|
|
3
|
+
maxframe-1.2.1.dist-info/top_level.txt,sha256=O_LOO6KS5Y1ZKdmCjA9mzfg0-b1sB_P6Oy-hD8aSDfM,25
|
|
4
|
+
maxframe-1.2.1.dist-info/METADATA,sha256=BDhFnZopw5BEo7LJru1V9dPskhg94eUdVCYdqkwOhLk,3055
|
|
5
5
|
maxframe_client/conftest.py,sha256=JkQKlLZqd9uJekiO8HvMvEegidF-6KlCVFcg-KmQLLY,643
|
|
6
6
|
maxframe_client/__init__.py,sha256=z4QT02esANpxtSVZPO_96693bqSvhG82e4suaD6Ll1E,689
|
|
7
7
|
maxframe_client/fetcher.py,sha256=9zIq_mNGlk8DcTVH0f1-dgNmH72X0edRM9a8muwko6Y,9172
|
|
@@ -28,7 +28,7 @@ maxframe/__init__.py,sha256=Gws_d9VblPR6Ld36_hSueVzs5mdN1ns4fMpgvbcEsxo,1004
|
|
|
28
28
|
maxframe/utils.py,sha256=ObMiBp0NDlgBSwNSPnJQk74j9taJCO7YzWL_GR3Wvoc,34852
|
|
29
29
|
maxframe/extension.py,sha256=xh1_qeZqzkW4GmcI3EMqTZhbsW8GHiGnWh1k_96DMP4,2720
|
|
30
30
|
maxframe/errors.py,sha256=Mk6qW6hVSW3fFcGvk8yRCiUTlbQyvXA-rY6pfeq09XQ,1028
|
|
31
|
-
maxframe/_utils.cpython-37m-darwin.so,sha256=
|
|
31
|
+
maxframe/_utils.cpython-37m-darwin.so,sha256=XVOsKb5wIPmHuXy-QpUfxiTnWdXnlpKi8u_9VzoUADc,415632
|
|
32
32
|
maxframe/udf.py,sha256=ctZQ2KxCPUbHMAk5wsWdYNnqiJMgoU7GNUVWh3FNxKw,5351
|
|
33
33
|
maxframe/typing_.py,sha256=V-xuayMMepLmG2Kg0V3bi8qRosRd2FV9mJ-kAWdhOjQ,1180
|
|
34
34
|
maxframe/codegen.py,sha256=OYhug8DUbd6X0qHq-pFQv473MlAiLluYci2lvfJoI_k,18317
|
|
@@ -81,14 +81,14 @@ maxframe/dataframe/datasource/from_index.py,sha256=c7jX1Vq4C4ZOXiL3MbRayJ3Jl0JEA
|
|
|
81
81
|
maxframe/dataframe/datasource/dataframe.py,sha256=-V8qjEhRwaFeOYeFzjf8h5A1gqpgH_-GbNCf4Au7VRM,2023
|
|
82
82
|
maxframe/dataframe/datasource/series.py,sha256=Sou6J9hg3JJdSxuTcJjsD5EWPmvVB1J5I_ys24IkBe4,1909
|
|
83
83
|
maxframe/dataframe/datasource/__init__.py,sha256=LaVpAg_oMJ2OofTlyjw-v9YLRQNfPQYHNVkWnCXPRCc,640
|
|
84
|
-
maxframe/dataframe/datasource/read_odps_query.py,sha256=
|
|
84
|
+
maxframe/dataframe/datasource/read_odps_query.py,sha256=bpwKPQOoMLWJ8D5F44rBZAvU7CDkyQ5CXH72BkX80e0,14648
|
|
85
85
|
maxframe/dataframe/datasource/core.py,sha256=W9AMhDsmlp4jl4T4iBsqTlMsdLNPCjcJbTi7SivsiFU,2687
|
|
86
86
|
maxframe/dataframe/datasource/date_range.py,sha256=TNfvRWgfwkpIhm52RbMZDxvBAdbWbbwGAUnbwFJRRAE,17227
|
|
87
87
|
maxframe/dataframe/datasource/read_odps_table.py,sha256=P-m8aqFCG3avt2MzpAReAiCewoT9H_VLrtjF7y7fMwA,9409
|
|
88
88
|
maxframe/dataframe/datasource/read_parquet.py,sha256=Pk3c1eQ0l8pJdhhvE7jfPI2IG933OZv8_k4e72ULEx0,14531
|
|
89
89
|
maxframe/dataframe/datasource/from_tensor.py,sha256=GrBxy0e-Vng640Z9kWnyshGsI9vkkmyowkRQvwDGsWs,14727
|
|
90
90
|
maxframe/dataframe/datasource/from_records.py,sha256=VB4rO5evF1_EUN6_GJq3xHrsvFxInW1TZH1AvtzPAis,3442
|
|
91
|
-
maxframe/dataframe/datasource/tests/test_datasource.py,sha256=
|
|
91
|
+
maxframe/dataframe/datasource/tests/test_datasource.py,sha256=bpIS9Kz5tM2HPO5yIh_ztiWjFbgU5x4n50xuuXekiWw,18777
|
|
92
92
|
maxframe/dataframe/datasource/tests/__init__.py,sha256=YsJxv7HbG4YYJmqAJZPYb8iHFRQX5JGpGn2PInDXvY8,596
|
|
93
93
|
maxframe/dataframe/sort/sort_index.py,sha256=gmv55CmKkAsWrA9bWf45JfX8IvMc0FuFloqb6D3cziI,5412
|
|
94
94
|
maxframe/dataframe/sort/__init__.py,sha256=E76aFGW1nejyX-_YV4AXlbl3vj0gSANgif5kbrmMWL4,1160
|
|
@@ -324,7 +324,7 @@ maxframe/core/entity/objects.py,sha256=XgeJHAFg9CT3i76kUkxiAhn0hByNLCo1Jr8C_CFC5
|
|
|
324
324
|
maxframe/core/entity/tests/__init__.py,sha256=YsJxv7HbG4YYJmqAJZPYb8iHFRQX5JGpGn2PInDXvY8,596
|
|
325
325
|
maxframe/core/entity/tests/test_objects.py,sha256=o0_ntvlp1u3eObNwf-WpomK-AeZcIbdUf3CGit1K1Es,1349
|
|
326
326
|
maxframe/core/graph/__init__.py,sha256=qlKFvg4JNTmNOOvidxwOQOZofw5WePSWphkYpZ7hVoc,765
|
|
327
|
-
maxframe/core/graph/core.cpython-37m-darwin.so,sha256=
|
|
327
|
+
maxframe/core/graph/core.cpython-37m-darwin.so,sha256=Vfo4sYkm2e3hufXKGZKaFEeWbjvk6E1dADoUudjxOi4,321120
|
|
328
328
|
maxframe/core/graph/entity.py,sha256=feXajqZBbPTsZID8FcRzhDCll3LW-S5Lf3UGObSA_fw,4863
|
|
329
329
|
maxframe/core/graph/core.pyx,sha256=trOWJOlAn1bwMuErZwugqGXO1loCuhLBupYBxxmlHaI,15923
|
|
330
330
|
maxframe/core/graph/tests/__init__.py,sha256=YsJxv7HbG4YYJmqAJZPYb8iHFRQX5JGpGn2PInDXvY8,596
|
|
@@ -358,7 +358,7 @@ maxframe/serialization/arrow.py,sha256=A1gDQ7BmsLk_57qPd34e5SIMSqbuMZrfKsixLtHrp
|
|
|
358
358
|
maxframe/serialization/__init__.py,sha256=psw8R-cCgEO7f5TB0ivKQHQcSYGmVZhdX62qGdU5a3k,936
|
|
359
359
|
maxframe/serialization/maxframe_objects.py,sha256=Ha2pFpBivutH_YES1EQN-zpWu3TbKtotJHiuc8Cs8S8,1365
|
|
360
360
|
maxframe/serialization/numpy.py,sha256=i6t8mI_pe34QQMxTEH23DrvPisRP6KxE2qLQ99MwjNI,3213
|
|
361
|
-
maxframe/serialization/core.cpython-37m-darwin.so,sha256=
|
|
361
|
+
maxframe/serialization/core.cpython-37m-darwin.so,sha256=r4GT7jikG3jIzGO7yKxOJKLm7QzEWvqxcHc6iIB3Pqo,600360
|
|
362
362
|
maxframe/serialization/scipy.py,sha256=W4P_r-4tAGGfVAFhwqcaHBxdW-dpZ6rIMLuppQzMXjo,2427
|
|
363
363
|
maxframe/serialization/core.pyx,sha256=9xb7LsnSZiaNGpkx61OWeVUyCHyL0u8xDmzvOLgqyP8,35945
|
|
364
364
|
maxframe/serialization/tests/test_serial.py,sha256=fsn5h9628eN-S3tPjzyhGtZtx_TEmTUdcNNJs-dSXXc,13163
|
|
@@ -395,7 +395,7 @@ maxframe/lib/wrapped_pickle.py,sha256=4qWVAbDcTJm4WAvs631fFXrV3NEyzGSnG1jSKHSzdv
|
|
|
395
395
|
maxframe/lib/version.py,sha256=krhgFvMhLdoNCJk3d9U-yyIAHixCR4S9-NggKdqrnHQ,18321
|
|
396
396
|
maxframe/lib/compression.py,sha256=QPxWRp0Q2q33EQzY-Jfx_iz7SELax6fu3GTmyIVyjGY,1442
|
|
397
397
|
maxframe/lib/__init__.py,sha256=spk1N3D3EL-0RyJDNlnwqHfQEW47lXL-rNDukcF6qlk,642
|
|
398
|
-
maxframe/lib/mmh3.cpython-37m-darwin.so,sha256=
|
|
398
|
+
maxframe/lib/mmh3.cpython-37m-darwin.so,sha256=95ymEsO7tHUhn1HBaVT21nou8fVmnNtJapxWC52jZHA,37200
|
|
399
399
|
maxframe/lib/mmh3.pyi,sha256=R_MzTIyUSTn8TF4Gs2hRP7NSWfWi0SeuUauh4eZJc-g,1494
|
|
400
400
|
maxframe/lib/functools_compat.py,sha256=c3gOw--FLvQNbamt0V8oqsTNRhPlASPEOzhMrzA2was,2616
|
|
401
401
|
maxframe/lib/mmh3_src/mmh3module.cpp,sha256=9J9eA42eKWTl546fvfQPNuIM3B2jpWSADpgIw3tr2jg,11604
|
|
@@ -431,10 +431,10 @@ maxframe/lib/filesystem/_oss_lib/handle.py,sha256=EqXngu4ScEvEzWoVhk8SdcFHVd3eth
|
|
|
431
431
|
maxframe/lib/filesystem/_oss_lib/__init__.py,sha256=YsJxv7HbG4YYJmqAJZPYb8iHFRQX5JGpGn2PInDXvY8,596
|
|
432
432
|
maxframe/lib/filesystem/_oss_lib/glob.py,sha256=ZAOPflY2zomCM7fKkrhG9qdULoyhHliBmbbmFaPvCKM,4837
|
|
433
433
|
maxframe/lib/filesystem/_oss_lib/common.py,sha256=zbhcqv_UKLHmk9cPT7T_9i43Uf2iz1DH_Uis8DJPOfs,6615
|
|
434
|
-
maxframe/lib/dtypes_extension/__init__.py,sha256=
|
|
435
|
-
maxframe/lib/dtypes_extension/dtypes.py,sha256=
|
|
434
|
+
maxframe/lib/dtypes_extension/__init__.py,sha256=vDReFX8FP-k9sqHKkFdV58KUfR-Rf5KnUB1fX9qY62M,648
|
|
435
|
+
maxframe/lib/dtypes_extension/dtypes.py,sha256=9TGEqLqAbVwyfujyLYG5Sk3jF28qxlkDfweFB-eHpa8,1534
|
|
436
436
|
maxframe/lib/dtypes_extension/tests/__init__.py,sha256=YsJxv7HbG4YYJmqAJZPYb8iHFRQX5JGpGn2PInDXvY8,596
|
|
437
|
-
maxframe/lib/dtypes_extension/tests/test_dtypes.py,sha256=
|
|
437
|
+
maxframe/lib/dtypes_extension/tests/test_dtypes.py,sha256=qr73aCmmIJo-UlawSrCz6o_LkY8nfHgGRBwz8gNgfFA,1127
|
|
438
438
|
maxframe/lib/sparse/matrix.py,sha256=EjPVR8s8DgXnE7mMqAyZngNbFhobrrMbZLSYGHYzTVY,7154
|
|
439
439
|
maxframe/lib/sparse/vector.py,sha256=a7q1uMWlF8rs_2lNYvWzFmpWsnOlF_FjWAsPjIUutk4,4809
|
|
440
440
|
maxframe/lib/sparse/__init__.py,sha256=V2akd93BuaxrSMURjikfbOmlCD5C_wyzkuwqfvzaYlM,18058
|
|
File without changes
|
|
File without changes
|