maxframe 1.2.0__cp38-cp38-win_amd64.whl → 1.2.1__cp38-cp38-win_amd64.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
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.1
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,5 +1,5 @@
1
1
  maxframe/__init__.py,sha256=6Y3yW67GtpKOGqMC1prt4yxqUTc0twHA3yjMEH-5WTw,1036
2
- maxframe/_utils.cp38-win_amd64.pyd,sha256=DKWajJzJdM-FwJGYuUg_Uh1PHBUiOJ__MHKwZcL-S3I,308736
2
+ maxframe/_utils.cp38-win_amd64.pyd,sha256=fEOuuP0AThCNtAqPbAp5UFAm2cu4zv9bVzcKzyPvCyA,308736
3
3
  maxframe/_utils.pxd,sha256=ckEN1J8rXAtNYW7CictnSVYamH-sQx-uIuWrQts_OT4,1187
4
4
  maxframe/_utils.pyx,sha256=oOBAUIaOM0mkKY_dzymY75Vit8bW64vbFrtwzqQpUA8,17564
5
5
  maxframe/codegen.py,sha256=H4daLJbkmFxdwgDBcvRTXE51VynKzaMDlwCM810BLZw,18858
@@ -34,7 +34,7 @@ maxframe/core/entity/utils.py,sha256=Cx7bfNQTbYZjAxNP-1AXjBozZ1mGqJ1KCz7rwDlxn6w
34
34
  maxframe/core/entity/tests/__init__.py,sha256=4LpNXO11JAdLjSut3p036oEEXlDEB-6AURW9oci5W5Y,609
35
35
  maxframe/core/entity/tests/test_objects.py,sha256=UwJTYFSUr61E255tPrGwnJlhHDGlkpSugFk0kRsJG8Q,1392
36
36
  maxframe/core/graph/__init__.py,sha256=h7zLVFfnmRPrzaiO7zbuOTMZ0iSNZN5TaD5fB7vuxxA,782
37
- maxframe/core/graph/core.cp38-win_amd64.pyd,sha256=SlNeuKE6E2l29ZzSHMmzM1N7Ud0bBJUX5GmhR1vSoU8,252416
37
+ maxframe/core/graph/core.cp38-win_amd64.pyd,sha256=Who1ZZaheeZYMRyk9stZ4RymXwriNj3MCmzslPiZPwI,252416
38
38
  maxframe/core/graph/core.pyx,sha256=DJ3RV_5W1lNDRj113ewpSLosiiHCqXYQNuPVR5mBaVU,16390
39
39
  maxframe/core/graph/entity.py,sha256=zfijVHeCTOJynagcPSEBEIi194mjMwXcW9p4jopwoZ8,5010
40
40
  maxframe/core/graph/builder/__init__.py,sha256=NjIcWQ1ZtEbRJalz8XH1UKaQLpsvOqouRPeRBaul5cA,655
@@ -143,12 +143,12 @@ maxframe/dataframe/datasource/from_records.py,sha256=5PWL2uGCwdoOjGzpL52O7Yg_mNB
143
143
  maxframe/dataframe/datasource/from_tensor.py,sha256=kd59E9xEaLzOdsOennQyDkfJlS6eg26gjfn_VrqfdTs,15146
144
144
  maxframe/dataframe/datasource/index.py,sha256=LUOaSY3jScY65h4TSryXMfQJGdUWWXmnoS1IP9ah5aw,4518
145
145
  maxframe/dataframe/datasource/read_csv.py,sha256=RyjHDs5eVzti9G6HgHm61QgqvqC8XN1opMTT_98YywE,24668
146
- maxframe/dataframe/datasource/read_odps_query.py,sha256=mwimNXzA0cihS8HIiCwaiTk3pQJmVa4jWQFu-1eOP-Q,15044
146
+ maxframe/dataframe/datasource/read_odps_query.py,sha256=xk7KDrD3rz-j-wHK_oX81fR8rwLmYz2qpZApoA8qD_I,15071
147
147
  maxframe/dataframe/datasource/read_odps_table.py,sha256=GztSJFV-vQl20mleqCMWGhMd0tXJ1mSMDm2kI89KS7g,9667
148
148
  maxframe/dataframe/datasource/read_parquet.py,sha256=dt1PE06wfvnbXxQXWXxVe69jBClIP3bDz6OnkjfVjfE,14952
149
149
  maxframe/dataframe/datasource/series.py,sha256=9GmE-UVQ_eeFI53UuWiF6rQSqQ1mp4RkBVRWIhKNw2k,1964
150
150
  maxframe/dataframe/datasource/tests/__init__.py,sha256=4LpNXO11JAdLjSut3p036oEEXlDEB-6AURW9oci5W5Y,609
151
- maxframe/dataframe/datasource/tests/test_datasource.py,sha256=FEtjUGk6SS2YABxed4w9GWN-SoQu0Gzynh76zIVdYMk,19119
151
+ maxframe/dataframe/datasource/tests/test_datasource.py,sha256=8Dq5EJOmyfH9YqErP-6i39R-MeOj-bf97so1iGcRfLU,19324
152
152
  maxframe/dataframe/datastore/__init__.py,sha256=KbGUgDoSvqGe_6Jm89Mh3KxU2N4mmMrn4prA4Jk933g,810
153
153
  maxframe/dataframe/datastore/core.py,sha256=uNAcFyUgjn_LxUHk7IjqRlAWNeru77Ub-dZ15M5WDjA,762
154
154
  maxframe/dataframe/datastore/to_csv.py,sha256=gWPz0fcKmJA-2cyDJDhbL9C_CSOq79GTNHq9-qAkkek,7974
@@ -350,7 +350,7 @@ maxframe/learn/utils/core.py,sha256=JmuEV8O_tEXI-nBwRK2j1CPYSFlJJyrFhYh83df29L4,
350
350
  maxframe/lib/__init__.py,sha256=ZxIRETECrnrJcfRmGQTTNwrCxwqTVLNaM9nCzBNPo1k,657
351
351
  maxframe/lib/compression.py,sha256=8F0QEOlrgrFz8Yzeyap4ud3PYe1I5LUWUHWvQg1YKq0,1497
352
352
  maxframe/lib/functools_compat.py,sha256=1a-R_fcKQo7gUZnyk6L-qt_Ozhm3Gb0y86Fd3ROeTcw,2697
353
- maxframe/lib/mmh3.cp38-win_amd64.pyd,sha256=_bsvt4jJGTE-48yjhBR9OVGzIgAojtQGVzEe5PlQ0R4,17920
353
+ maxframe/lib/mmh3.cp38-win_amd64.pyd,sha256=EOzfdtzO9cBqzWovBVCfTQnY8fwf2fwD5UCeESeP3Fo,17920
354
354
  maxframe/lib/mmh3.pyi,sha256=ad6KZrDA7dznE5Qv0lnGB32rw1Zl2DBwNIH0BI_bFQU,1537
355
355
  maxframe/lib/version.py,sha256=NqxzCX2pLHIMTj-7HTA6xU3iyd_DVeqyyW1n-Rk8MCQ,18941
356
356
  maxframe/lib/wrapped_pickle.py,sha256=Yazeydh6vOAd4ibsv_tn_8LgAC7kVkoResQYFW8RXNw,3976
@@ -366,10 +366,10 @@ maxframe/lib/aio/tests/__init__.py,sha256=4LpNXO11JAdLjSut3p036oEEXlDEB-6AURW9oc
366
366
  maxframe/lib/aio/tests/test_aio_file.py,sha256=WnU2jQMZ1jVPT8l9m3h4lytLUDhAHTIa9_mTMHpo224,1713
367
367
  maxframe/lib/cython/__init__.py,sha256=4LpNXO11JAdLjSut3p036oEEXlDEB-6AURW9oci5W5Y,609
368
368
  maxframe/lib/cython/libcpp.pxd,sha256=lNA9YvEGLS0xMarsmvllh2qMdPxu-_Tl2ymT2EQw14c,1130
369
- maxframe/lib/dtypes_extension/__init__.py,sha256=IiNUhMYa_fWIEyjOyemyUMevbEiN19re1b8hh8ZXNZo,681
370
- maxframe/lib/dtypes_extension/dtypes.py,sha256=Qs5hu-kJSexioMuPOpQleMr5M4Hc_RV-51RAMykaKO4,3110
369
+ maxframe/lib/dtypes_extension/__init__.py,sha256=F2HSAnbE502wzvJZDiiTTB-m7cByZwrT7CaB8BX0GJM,662
370
+ maxframe/lib/dtypes_extension/dtypes.py,sha256=mPtU8uoazTC-0ar-w1MQ0MIVTy6eNLR2MR5bocFrVQw,1579
371
371
  maxframe/lib/dtypes_extension/tests/__init__.py,sha256=4LpNXO11JAdLjSut3p036oEEXlDEB-6AURW9oci5W5Y,609
372
- maxframe/lib/dtypes_extension/tests/test_dtypes.py,sha256=ik77K1dQhYXpq_qpz0qBYKkzScrB41h06LHqMs2BnxM,2201
372
+ maxframe/lib/dtypes_extension/tests/test_dtypes.py,sha256=dWJTqACn_tzsrZ4jWp3X7_gn0viIg38Kcbl-osTIq48,1165
373
373
  maxframe/lib/filesystem/__init__.py,sha256=1LjZ5ZPdXZHKaJ5TZY34dnoLgYMy1qiB3DcE5k9YjaU,855
374
374
  maxframe/lib/filesystem/_glob.py,sha256=H1wRnnhFAK6PqshJf6ALo0jxVZ9em1zhi3d9Q5rXpLk,6708
375
375
  maxframe/lib/filesystem/arrow.py,sha256=QKH1gtjx-0jUyBNMKBF0nLJZCKuOwDIGko8biBBgQkQ,8647
@@ -408,7 +408,7 @@ maxframe/remote/core.py,sha256=4K33fOPX6f1v_c1yZ7Z9MRICHtmwkqbiuujfwplZicw,6733
408
408
  maxframe/remote/run_script.py,sha256=mibruTktWFh62ye9AtjKG7UG7g3_ZLxmXWLWCWY0le8,3677
409
409
  maxframe/serialization/__init__.py,sha256=0naXxktD3hjxZBVvV_mnvslPL5Azu4SeoW7KkFy4sbE,963
410
410
  maxframe/serialization/arrow.py,sha256=DUq7e9V8kJrpj_Z67F767jo_wxgkkXygSPByzMqfB4M,3513
411
- maxframe/serialization/core.cp38-win_amd64.pyd,sha256=AVL95f7xVvLNHh-gL2UVxl5QiKV9AYFvxBkiH178nzQ,416768
411
+ maxframe/serialization/core.cp38-win_amd64.pyd,sha256=tmGIcmw4Q06kE0-_HmMCu3jfWUlgFo4EkqTJ5NNs6cI,416768
412
412
  maxframe/serialization/core.pxd,sha256=tFsBg4SxvMgaKHNr6Pqxcw4uRes1NmoITq2igPtozDM,1548
413
413
  maxframe/serialization/core.pyi,sha256=oYh_n-2-cV8BaacM9kFev1rSC_OfEgWOUHjwdXBeY78,2206
414
414
  maxframe/serialization/core.pyx,sha256=KmeHc9A-NLZcMqVjyRxPDoKtVcvLmMOb57QsrsucncI,37083
@@ -691,7 +691,7 @@ maxframe_client/session/tests/test_task.py,sha256=HVLZUSUgzzJmim3d0rBw5mH2j-4HoA
691
691
  maxframe_client/tests/__init__.py,sha256=4LpNXO11JAdLjSut3p036oEEXlDEB-6AURW9oci5W5Y,609
692
692
  maxframe_client/tests/test_fetcher.py,sha256=-KG_OshShJEa66Hg_RKuT745AxadH2LMWasHo5hhIow,4265
693
693
  maxframe_client/tests/test_session.py,sha256=7-oNldT5YAnzWxSixWJH3VuBMwzFO7C38fNODINMi-M,11542
694
- maxframe-1.2.0.dist-info/METADATA,sha256=yjACwCuq9KVBUCAaE-A5W1bWY4qxsctZIuaJbde8xuQ,3126
695
- maxframe-1.2.0.dist-info/WHEEL,sha256=rTcqimtzpX3smAWAhGmiRSWAxTY4PqYPNE-p4kscHDQ,99
696
- maxframe-1.2.0.dist-info/top_level.txt,sha256=64x-fc2q59c_vXwNUkehyjF1vb8JWqFSdYmUqIFqoTM,31
697
- maxframe-1.2.0.dist-info/RECORD,,
694
+ maxframe-1.2.1.dist-info/METADATA,sha256=61VvcvqHcKtpGuHCTTDaJxN1YV-pv4ZNBBAe8Vdnu5A,3126
695
+ maxframe-1.2.1.dist-info/WHEEL,sha256=rTcqimtzpX3smAWAhGmiRSWAxTY4PqYPNE-p4kscHDQ,99
696
+ maxframe-1.2.1.dist-info/top_level.txt,sha256=64x-fc2q59c_vXwNUkehyjF1vb8JWqFSdYmUqIFqoTM,31
697
+ maxframe-1.2.1.dist-info/RECORD,,