maxframe 1.2.0__cp311-cp311-macosx_10_9_x86_64.whl → 1.2.1__cp311-cp311-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.

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_, infer_arrow_dtype, is_map_dtype
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_, infer_arrow_dtype, is_map_dtype
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: maxframe
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: MaxFrame operator-based data analyze framework
5
5
  Requires-Dist: numpy<2.0.0,>=1.19.0
6
6
  Requires-Dist: pandas>=1.0.0
@@ -1,7 +1,7 @@
1
- maxframe-1.2.0.dist-info/RECORD,,
2
- maxframe-1.2.0.dist-info/WHEEL,sha256=rRBe8gNEhotozzxgrO95hZ3LAl74f9an5Xo4YRYFmgA,110
3
- maxframe-1.2.0.dist-info/top_level.txt,sha256=64x-fc2q59c_vXwNUkehyjF1vb8JWqFSdYmUqIFqoTM,31
4
- maxframe-1.2.0.dist-info/METADATA,sha256=PjQFUBd0dAx18iad3K42kn8KOfV2UpIVSLyaE3A7Rlo,3043
1
+ maxframe-1.2.1.dist-info/RECORD,,
2
+ maxframe-1.2.1.dist-info/WHEEL,sha256=rRBe8gNEhotozzxgrO95hZ3LAl74f9an5Xo4YRYFmgA,110
3
+ maxframe-1.2.1.dist-info/top_level.txt,sha256=64x-fc2q59c_vXwNUkehyjF1vb8JWqFSdYmUqIFqoTM,31
4
+ maxframe-1.2.1.dist-info/METADATA,sha256=ski2284d_beMcw3qHjoS9U9jnovYKyzNw40qYZ9rX0Q,3043
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
@@ -19,7 +19,7 @@ maxframe_client/session/tests/test_task.py,sha256=o0I10u6oX8e6vLt35xxxvZfcpb6F3o
19
19
  maxframe_client/session/tests/__init__.py,sha256=YsJxv7HbG4YYJmqAJZPYb8iHFRQX5JGpGn2PInDXvY8,596
20
20
  maxframe/_utils.pyx,sha256=v1fcebb-o5Hee2xzMBMKLIXV9NHThYrS3SND6Sik24U,17017
21
21
  maxframe/conftest.py,sha256=Jr7kv1m7VfJaDlfUW9pTKTfa9m9pkW_3jwNdmqB0zt4,6293
22
- maxframe/_utils.cpython-311-darwin.so,sha256=iQZP3nduFY0uOVbEx9CpYKokOlGQptNYCz_Bnw2QnWw,415312
22
+ maxframe/_utils.cpython-311-darwin.so,sha256=DGZXoGwThplp7XO55kFQyGBh1gub0pLbCJpx7oVGo0Y,415312
23
23
  maxframe/opcodes.py,sha256=mL1_p_2Qofwl-9aZw52dsUciPab41O_A-dN6_NUsDz0,10487
24
24
  maxframe/env.py,sha256=9sJWTeOWuP6KRRYEejJgYa4FoZyAeSuXFd_A8_xl6YM,1402
25
25
  maxframe/mixin.py,sha256=FnjS9bFlcg6LV8L62pyTVF29qgSJupFn9DZv8cv6MiI,3524
@@ -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=nXz-wROVmmFCP-Axfy5M8y-gGHiAWflw0NKy1aXlOe8,14621
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=q9Oao7HMoTJhvlhAeMkaUihSofWyvj0I4yFQEOPgE00,18576
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-311-darwin.so,sha256=PFrL4EGT5lnlrFV38W68mZZzVs3Q8q0apFcEYzl9aOE,321272
327
+ maxframe/core/graph/core.cpython-311-darwin.so,sha256=dUpV_U5uV7gIfULRcQydX33RJqg9A7_V9cIVUlPlS4E,321272
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
@@ -359,7 +359,7 @@ maxframe/serialization/__init__.py,sha256=psw8R-cCgEO7f5TB0ivKQHQcSYGmVZhdX62qGd
359
359
  maxframe/serialization/maxframe_objects.py,sha256=Ha2pFpBivutH_YES1EQN-zpWu3TbKtotJHiuc8Cs8S8,1365
360
360
  maxframe/serialization/numpy.py,sha256=i6t8mI_pe34QQMxTEH23DrvPisRP6KxE2qLQ99MwjNI,3213
361
361
  maxframe/serialization/scipy.py,sha256=W4P_r-4tAGGfVAFhwqcaHBxdW-dpZ6rIMLuppQzMXjo,2427
362
- maxframe/serialization/core.cpython-311-darwin.so,sha256=6gjlMFAk9qDzxN7gDEFeNL0h5flWfg4Aq0tVLKjouc0,617112
362
+ maxframe/serialization/core.cpython-311-darwin.so,sha256=afxBBhrbCdnBNHseI31lUasezcuH6qC5qhyQ9l5rCCQ,617112
363
363
  maxframe/serialization/core.pyx,sha256=9xb7LsnSZiaNGpkx61OWeVUyCHyL0u8xDmzvOLgqyP8,35945
364
364
  maxframe/serialization/tests/test_serial.py,sha256=fsn5h9628eN-S3tPjzyhGtZtx_TEmTUdcNNJs-dSXXc,13163
365
365
  maxframe/serialization/tests/__init__.py,sha256=YsJxv7HbG4YYJmqAJZPYb8iHFRQX5JGpGn2PInDXvY8,596
@@ -396,7 +396,7 @@ 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
398
  maxframe/lib/mmh3.pyi,sha256=R_MzTIyUSTn8TF4Gs2hRP7NSWfWi0SeuUauh4eZJc-g,1494
399
- maxframe/lib/mmh3.cpython-311-darwin.so,sha256=hdAvoFDjMcInK3MfvtuwgIfdDvNd6JHTCtS4CxaG6rA,37256
399
+ maxframe/lib/mmh3.cpython-311-darwin.so,sha256=Rhr0Wq_nD7DQ2CtzPL3ZVzJp84OCVKWZNQCC78XssSE,37256
400
400
  maxframe/lib/functools_compat.py,sha256=c3gOw--FLvQNbamt0V8oqsTNRhPlASPEOzhMrzA2was,2616
401
401
  maxframe/lib/mmh3_src/mmh3module.cpp,sha256=9J9eA42eKWTl546fvfQPNuIM3B2jpWSADpgIw3tr2jg,11604
402
402
  maxframe/lib/mmh3_src/MurmurHash3.h,sha256=lg5uXUFyMBge2BWRn0FgrqaCFCMfDWoTXD4PQtjHrMA,1263
@@ -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=jfQ-njtVH6QSBqWeane16jm0KqOXjIQ7_MwXh9Pr5ew,667
435
- maxframe/lib/dtypes_extension/dtypes.py,sha256=1vOMTMj8RRcjZw44cL4XtVUs--i64QdVzmu-V5K82r8,3019
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=YryIHQBTeeaMTB-m17PDH9FeUr8Sf1XXKBzyjeCT1a8,2133
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