maxframe 0.1.0b1__cp38-cp38-win_amd64.whl → 0.1.0b3__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.

Files changed (42) hide show
  1. maxframe/_utils.cp38-win_amd64.pyd +0 -0
  2. maxframe/codegen.py +88 -19
  3. maxframe/config/config.py +10 -0
  4. maxframe/core/entity/executable.py +1 -0
  5. maxframe/core/entity/objects.py +3 -2
  6. maxframe/core/graph/core.cp38-win_amd64.pyd +0 -0
  7. maxframe/core/graph/core.pyx +2 -2
  8. maxframe/core/operator/base.py +14 -0
  9. maxframe/dataframe/__init__.py +3 -1
  10. maxframe/dataframe/datasource/from_records.py +4 -0
  11. maxframe/dataframe/datasource/read_odps_query.py +295 -0
  12. maxframe/dataframe/datasource/read_odps_table.py +1 -1
  13. maxframe/dataframe/datasource/tests/test_datasource.py +84 -1
  14. maxframe/dataframe/groupby/__init__.py +4 -0
  15. maxframe/dataframe/groupby/core.py +5 -0
  16. maxframe/dataframe/misc/to_numeric.py +4 -0
  17. maxframe/dataframe/window/aggregation.py +1 -24
  18. maxframe/dataframe/window/ewm.py +0 -7
  19. maxframe/dataframe/window/tests/test_ewm.py +0 -6
  20. maxframe/errors.py +21 -0
  21. maxframe/lib/aio/isolation.py +6 -1
  22. maxframe/lib/mmh3.cp38-win_amd64.pyd +0 -0
  23. maxframe/opcodes.py +1 -0
  24. maxframe/protocol.py +25 -5
  25. maxframe/serialization/core.cp38-win_amd64.pyd +0 -0
  26. maxframe/serialization/exception.py +2 -1
  27. maxframe/serialization/serializables/core.py +6 -1
  28. maxframe/serialization/serializables/field.py +2 -0
  29. maxframe/tensor/core.py +3 -3
  30. maxframe/tests/test_codegen.py +69 -0
  31. maxframe/tests/test_protocol.py +16 -8
  32. maxframe/tests/utils.py +1 -0
  33. maxframe/udf.py +15 -16
  34. maxframe/utils.py +21 -1
  35. {maxframe-0.1.0b1.dist-info → maxframe-0.1.0b3.dist-info}/METADATA +1 -74
  36. {maxframe-0.1.0b1.dist-info → maxframe-0.1.0b3.dist-info}/RECORD +42 -39
  37. {maxframe-0.1.0b1.dist-info → maxframe-0.1.0b3.dist-info}/WHEEL +1 -1
  38. maxframe_client/clients/framedriver.py +7 -7
  39. maxframe_client/session/task.py +31 -3
  40. maxframe_client/session/tests/test_task.py +29 -11
  41. maxframe_client/tests/test_session.py +2 -0
  42. {maxframe-0.1.0b1.dist-info → maxframe-0.1.0b3.dist-info}/top_level.txt +0 -0
maxframe/udf.py CHANGED
@@ -26,9 +26,7 @@ from .serialization.serializables import (
26
26
 
27
27
  class MarkedFunction(Serializable):
28
28
  func = FunctionField("func")
29
- resource_libraries = ListField(
30
- "resource_libraries", FieldTypes.string, default_factory=list
31
- )
29
+ resources = ListField("resources", FieldTypes.string, default_factory=list)
32
30
 
33
31
  def __init__(self, func: Optional[Callable] = None, **kw):
34
32
  super().__init__(func=func, **kw)
@@ -43,33 +41,34 @@ class MarkedFunction(Serializable):
43
41
  return f"<MarkedFunction {self.func!r}>"
44
42
 
45
43
 
46
- def with_resource_libraries(
47
- *resources: Union[str, Resource], use_wrapper_class: bool = True
48
- ):
44
+ def with_resources(*resources: Union[str, Resource], use_wrapper_class: bool = True):
49
45
  def res_to_str(res: Union[str, Resource]) -> str:
50
46
  if isinstance(res, str):
51
47
  return res
52
- res_parts = [res.project]
48
+ res_parts = [res.project.name]
53
49
  if res.schema:
54
- res_parts.append(res.schema)
55
- res_parts.append(res.name)
56
- return ".".join(res_parts)
50
+ res_parts.extend(["schemas", res.schema])
51
+ res_parts.extend(["resources", res.name])
52
+ return "/".join(res_parts)
57
53
 
58
54
  def func_wrapper(func):
59
55
  str_resources = [res_to_str(r) for r in resources]
60
56
  if not use_wrapper_class:
61
- func.resource_libraries = str_resources
57
+ func.resources = str_resources
62
58
  return func
63
59
 
64
60
  if isinstance(func, MarkedFunction):
65
- func.resource_libraries = str_resources
61
+ func.resources = str_resources
66
62
  return func
67
- return MarkedFunction(func, resource_libraries=list(resources))
63
+ return MarkedFunction(func, resources=list(str_resources))
68
64
 
69
65
  return func_wrapper
70
66
 
71
67
 
72
- def get_udf_resource_libraries(
68
+ with_resource_libraries = with_resources
69
+
70
+
71
+ def get_udf_resources(
73
72
  func: Callable,
74
- ) -> Optional[List[Union[Resource, str]]]:
75
- return getattr(func, "resource_libraries", None)
73
+ ) -> List[Union[Resource, str]]:
74
+ return getattr(func, "resources", None) or []
maxframe/utils.py CHANGED
@@ -338,6 +338,14 @@ def deserialize_serializable(ser_serializable: bytes):
338
338
  return deserialize(header2, buffers2)
339
339
 
340
340
 
341
+ def skip_na_call(func: Callable):
342
+ @functools.wraps(func)
343
+ def new_func(x):
344
+ return func(x) if x is not None else None
345
+
346
+ return new_func
347
+
348
+
341
349
  def url_path_join(*pieces):
342
350
  """Join components of url into a relative url
343
351
 
@@ -450,6 +458,9 @@ _ToThreadRetType = TypeVar("_ToThreadRetType")
450
458
 
451
459
 
452
460
  class ToThreadMixin:
461
+ _thread_pool_size = 1
462
+ _counter = itertools.count().__next__
463
+
453
464
  def __del__(self):
454
465
  if hasattr(self, "_pool"):
455
466
  kw = {"wait": False}
@@ -466,7 +477,10 @@ class ToThreadMixin:
466
477
  **kwargs,
467
478
  ) -> _ToThreadRetType:
468
479
  if not hasattr(self, "_pool"):
469
- self._pool = concurrent.futures.ThreadPoolExecutor(1)
480
+ self._pool = concurrent.futures.ThreadPoolExecutor(
481
+ self._thread_pool_size,
482
+ thread_name_prefix=f"{type(self).__name__}Pool-{self._counter()}",
483
+ )
470
484
 
471
485
  task = asyncio.create_task(
472
486
  to_thread_pool(func, *args, **kwargs, pool=self._pool)
@@ -1081,3 +1095,9 @@ def arrow_type_from_str(type_str: str) -> pa.DataType:
1081
1095
  if len(value_stack) > 1:
1082
1096
  raise ValueError(f"Cannot parse type {type_str}")
1083
1097
  return value_stack[-1]
1098
+
1099
+
1100
+ def get_python_tag():
1101
+ # todo add implementation suffix for non-GIL tags when PEP703 is ready
1102
+ version_info = sys.version_info
1103
+ return f"cp{version_info[0]}{version_info[1]}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maxframe
3
- Version: 0.1.0b1
3
+ Version: 0.1.0b3
4
4
  Summary: MaxFrame operator-based data analyze framework
5
5
  Requires-Dist: numpy >=1.19.0
6
6
  Requires-Dist: pandas >=1.0.0
@@ -102,76 +102,3 @@ License
102
102
 
103
103
  Licensed under the `Apache License
104
104
  2.0 <https://www.apache.org/licenses/LICENSE-2.0.html>`__.
105
- MaxCompute MaxFrame Client
106
- ==========================
107
-
108
- MaxFrame is a computational framework created by Alibaba Cloud to
109
- provide a way for Python developers to parallelize their code with
110
- MaxCompute. It creates a runnable computation graph locally, submits it
111
- to MaxCompute to execute and obtains results from MaxCompute.
112
-
113
- MaxFrame client is the client of MaxFrame. Currently it provides a
114
- DataFrame-based SDK with compatible APIs for pandas. In future, other
115
- common Python libraries like numpy and scikit-learn will be added as
116
- well. Python 3.7 is recommended for MaxFrame client to enable all
117
- functionalities while supports for higher Python versions are on the
118
- way.
119
-
120
- Installation
121
- ------------
122
-
123
- You may install MaxFrame client through PIP:
124
-
125
- .. code:: bash
126
-
127
- pip install maxframe
128
-
129
- Latest beta version can be installed with ``--pre`` argument:
130
-
131
- .. code:: bash
132
-
133
- pip install --pre maxframe
134
-
135
- You can also install MaxFrame client from source code:
136
-
137
- .. code:: bash
138
-
139
- pip install git+https://github.com/aliyun/aliyun-odps-maxframe.git
140
-
141
- Getting started
142
- ---------------
143
-
144
- We show a simple code example of MaxFrame client which read data from a
145
- MaxCompute table, performs some simple data transform and writes back
146
- into MaxCompute.
147
-
148
- .. code:: python
149
-
150
- import maxframe.dataframe as md
151
- import os
152
- from maxframe import new_session
153
- from odps import ODPS
154
-
155
- o = ODPS(
156
- os.getenv('ALIBABA_CLOUD_ACCESS_KEY_ID'),
157
- os.getenv('ALIBABA_CLOUD_ACCESS_KEY_SECRET'),
158
- project='your-default-project',
159
- endpoint='your-end-point',
160
- )
161
- session = new_session(o)
162
-
163
- df = md.read_odps_table("source_table")
164
- df["A"] = "prefix_" + df["A"]
165
- md.to_odps_table(df, "prefix_source_table")
166
-
167
- Documentation
168
- -------------
169
-
170
- Detailed documentations can be found
171
- `here <https://maxframe.readthedocs.io>`__.
172
-
173
- License
174
- -------
175
-
176
- Licensed under the `Apache License
177
- 2.0 <https://www.apache.org/licenses/LICENSE-2.0.html>`__.
@@ -1,20 +1,21 @@
1
1
  maxframe/__init__.py,sha256=MgltwhBvnUQDKKmHDg9Y69TJkRGmQQ9m8-D9FC2pcLU,1007
2
- maxframe/_utils.cp38-win_amd64.pyd,sha256=ycV3O8A50cR123JdJwawsyhchDobNV2qpdMZ2eSel-8,308224
2
+ maxframe/_utils.cp38-win_amd64.pyd,sha256=v0SiHG8U69LbmO5jg_wMpsYNpTlx3bjMIsvfOeEDnxE,308736
3
3
  maxframe/_utils.pxd,sha256=_qHN-lCY1FQgDFIrrqA79Ys0SBdonp9kXRMS93xKSYk,1187
4
4
  maxframe/_utils.pyx,sha256=_3p6aJEJ6WZYLcNZ6o4DxoxsxqadTlJXFlgDeFPxqUQ,17564
5
- maxframe/codegen.py,sha256=LzOBM2H5U24Eis3NA9tiy5dNe5xKsk7YaUizZKkkG44,14020
5
+ maxframe/codegen.py,sha256=S23hTTu2fIJTv5PMIItE_NPUnadUyoiMmb-1YAqbaWw,16329
6
6
  maxframe/conftest.py,sha256=JE9I-5mP4u-vgUqYL22mNY3tqpGofM8VMe8c8VUYkzk,4403
7
7
  maxframe/env.py,sha256=xY4wjMWIJ4qLsFAQ5F-X5CrVR7dDSWiryPXni0YSK5c,1435
8
+ maxframe/errors.py,sha256=xBnvoJjjNcHVLhwj77Dux9ut8isGVmmJXFqefmmx8Ak,711
8
9
  maxframe/extension.py,sha256=o7yiS99LWTtLF7ZX6F78UUJAqUyd-LllOXA2l69np50,2455
9
10
  maxframe/mixin.py,sha256=QfX0KqVIWDlVDSFs0lwdzLexw7lS7W_IUuK7aY1Ib8c,3624
10
- maxframe/opcodes.py,sha256=Kj8JQaGtnGXvcElBlrW1lZriSM9hCQRXUfJ5lic3pGA,10541
11
- maxframe/protocol.py,sha256=WsirflXFUuorZIQTddGbE1rFGP-5wR4RwcIhIKHqXow,13768
11
+ maxframe/opcodes.py,sha256=L-BvSFEUOMrtGJFXIH6zk2Xv_-te5VZxv5eDDCNNt0U,10566
12
+ maxframe/protocol.py,sha256=N4i0ggLY131gwnxOrCgKeZwzhLKSRB171cx1lWRvUcw,14605
12
13
  maxframe/session.py,sha256=Mme-jB2hioJC6ttrXfX4XSeHLCMYoFR0ikmmhx82-vc,36624
13
14
  maxframe/typing_.py,sha256=pAgOhHHSM376N7PJLtNXvS5LHNYywz5dIjnA_hHRWSM,1133
14
- maxframe/udf.py,sha256=23Zd-abK40xMgT3sS7aCn3G8f-0t1mcTy23M0MdatmE,2332
15
- maxframe/utils.py,sha256=c_xOE-9ecd7kiDmuCub-bpHFtB1-1dzzpKtoCUlMIuc,34452
15
+ maxframe/udf.py,sha256=EFAAV2c8SpWKcF9_8Pocpjc4bXsEASf57Qy_Q30YH4Q,2315
16
+ maxframe/utils.py,sha256=CpA4Cqf5Lg7LMKJeJFsmybqVutcSh3sSqMhdHnIi0h4,35017
16
17
  maxframe/config/__init__.py,sha256=AHo3deaCm1JnbbRX_udboJEDYrYytdvivp9RFxJcumI,671
17
- maxframe/config/config.py,sha256=9FrjTv-Dx-DIBW0FejJ86CKVRx39Ycj2EVIlstzLjxo,13178
18
+ maxframe/config/config.py,sha256=Top-9hUEkPvaTlAGrP9GzGjwvZk6YPuHtwy4TEryKqg,13475
18
19
  maxframe/config/validators.py,sha256=pKnloh2kEOBRSsT8ks-zL8XVSaMMVIEvHvwNJlideeo,1672
19
20
  maxframe/config/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
20
21
  maxframe/config/tests/test_config.py,sha256=FWQZ6KBUG_jY1-KaR-GKXl7khhlTbuLlk3uaEV8koM8,2839
@@ -25,15 +26,15 @@ maxframe/core/mode.py,sha256=a-2AjLrIaqemN3pZPFhdfrPYXR7ryCLcsT1KJwWKPb0,3107
25
26
  maxframe/core/entity/__init__.py,sha256=tD4zo3KXpzLrQraHnIXeO1Q961lSsIqpbAGRK2WijVE,1336
26
27
  maxframe/core/entity/chunks.py,sha256=zKk8Iyc3IkakIDW1bMYq_zZNLrR4ZMdXH-mBuOiFerM,2202
27
28
  maxframe/core/entity/core.py,sha256=aFwjNMhTJ4ybr1WzmMVSTG211fzutzaATs14QoNh-JM,4170
28
- maxframe/core/entity/executable.py,sha256=Pt-ad4u2jqb9mCbOHp0DcL1Oo6kjUzF411ZxQrouqys,11239
29
+ maxframe/core/entity/executable.py,sha256=CKxFGvFPfY_8JBprhpyndhTSLgVLtUG4G5n7Dw0dHnw,11275
29
30
  maxframe/core/entity/fuse.py,sha256=X1lI0WXj5t0flgGI5-qlVl5LoYkAdLJHk2Vv767C9G4,2350
30
- maxframe/core/entity/objects.py,sha256=GST_N6nwNxUv1wXaPBWty7n8Asn2hX8wfIDjrctkZP8,3119
31
+ maxframe/core/entity/objects.py,sha256=Ys_l6cBp0HwgRmXuqYo4HsnjdbfUW4mgvek5W0IMmXY,3134
31
32
  maxframe/core/entity/output_types.py,sha256=NnNeDBVAEhD8dtPBWzpM7n6s8neVFrahjd0zMGWroCc,2735
32
33
  maxframe/core/entity/tileables.py,sha256=6jJyFscvb8sH5K_k2VaNGeUm8YrpevCtou3WSUl4Dw8,13973
33
34
  maxframe/core/entity/utils.py,sha256=454RYVbTMVW_8KnfDqUPec4kz1p98izVTC2OrzhOkao,966
34
35
  maxframe/core/graph/__init__.py,sha256=n1WiszgVu0VdXsk12oiAyggduNwu-1-9YKnfZqvmmXk,838
35
- maxframe/core/graph/core.cp38-win_amd64.pyd,sha256=iuBSHogC_TrMCtP9IBj2KUyRXM8SJCvuF_A9D9gE3Ng,250368
36
- maxframe/core/graph/core.pyx,sha256=tHD1r5h2MoqeqtJWZIo_wkdz3WIK0yWRInRj-Aendkc,16320
36
+ maxframe/core/graph/core.cp38-win_amd64.pyd,sha256=Pxd3Gfcq9JBPGAfySG6YaTFnJiTphRtr1FNe3NZCBUo,250368
37
+ maxframe/core/graph/core.pyx,sha256=WYlYtXXSs72vfhf2ttJO-4u85exYzy2J9mlALHOMqoA,16354
37
38
  maxframe/core/graph/entity.py,sha256=RT_xbP5niUN5D6gqZ5Pg1vUegHn8bqPk8G8A30quOVA,5730
38
39
  maxframe/core/graph/builder/__init__.py,sha256=vTRY5xRPOMHUsK0jAtNIb1BjSPGqi_6lv86AroiiiL4,718
39
40
  maxframe/core/graph/builder/base.py,sha256=IzNYD4A2alnYaOvZnipDzC-ZIfNsYR80wLnFcx7bJzc,2635
@@ -43,7 +44,7 @@ maxframe/core/graph/builder/utils.py,sha256=vO7_4ykzI1G194Oqn_tM6zVWwxLReJ0GL4lC
43
44
  maxframe/core/graph/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
44
45
  maxframe/core/graph/tests/test_graph.py,sha256=nkVn_dLk0oT42HWJxnSjniC5ElXjsHxC1Jzlg1CKHcQ,7667
45
46
  maxframe/core/operator/__init__.py,sha256=IHBCB3KC6dlVnfJryHSd__3Xnso9CtwYJrbfsSJ6siE,1162
46
- maxframe/core/operator/base.py,sha256=ops_YDdVqJtGSu05E4efQqGbxCkhztohn_sAxjpvwJI,15277
47
+ maxframe/core/operator/base.py,sha256=3d2_iNxp06XCiiY_zZRNxm2Cvy2kR-5x9Di6tqbuuxA,15701
47
48
  maxframe/core/operator/core.py,sha256=cDzq0_9k7pfUiyAkaIq2eLaP6fAw7uRS-7bacon0Acg,9539
48
49
  maxframe/core/operator/fetch.py,sha256=4g9kyJbIco7cDgbdUJOJNtC3NCploUU45jnateGYG8c,1563
49
50
  maxframe/core/operator/fuse.py,sha256=1XBA2T6X4WSMj8xssZoC8bSALuNIdYSg7NTKTgR14-E,954
@@ -53,7 +54,7 @@ maxframe/core/operator/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH
53
54
  maxframe/core/operator/tests/test_core.py,sha256=iqZk4AWubFLO24V_VeV6SEy5xrzBFLP9qKK6tKO0SGs,1755
54
55
  maxframe/core/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
55
56
  maxframe/core/tests/test_mode.py,sha256=fyRH-ksa6MogEs6kNhtXhCZyvhYqflgaXJYI3nSo-ps,2507
56
- maxframe/dataframe/__init__.py,sha256=2YCnRh0neFIiFhmRr0wm3BHPRsvhEMjLXxs7NPY90PM,2109
57
+ maxframe/dataframe/__init__.py,sha256=t_Fnu2MNCgOr_N7mMqGU3LeZXvBF1yOHtLb5u1PoHt0,2187
57
58
  maxframe/dataframe/arrays.py,sha256=rOvhxMQars9E3SOYSu0ygBuuRVY0QV6xzengnMqKs4s,29616
58
59
  maxframe/dataframe/core.py,sha256=63TqgmOCTr5wtwbILJ6bLtHZQ6xnZd7LvVrMqR27GDQ,76034
59
60
  maxframe/dataframe/initializer.py,sha256=WW96yQjquofNFt6RPZvgWW4SBmH0OEDj8-BxpuyKThY,10552
@@ -114,15 +115,16 @@ maxframe/dataframe/datasource/core.py,sha256=1X32MxCU3Y5vxTVEIkNNXx29eIARyRCvnkV
114
115
  maxframe/dataframe/datasource/dataframe.py,sha256=P3kvDS_Jh6EGgJRVfh_rHVkVfMaHeGQ2U7rZT5Gr2Tk,2082
115
116
  maxframe/dataframe/datasource/date_range.py,sha256=At-TQwqMiTEshSk4gQvxpq0wSEibC0FwpMDnwcjaI4o,17748
116
117
  maxframe/dataframe/datasource/from_index.py,sha256=c6ecX7miuig3-uZB3-aj68TkpUypzpaogZsUZSbTtBs,1911
117
- maxframe/dataframe/datasource/from_records.py,sha256=5uIi6GsbRl3aTx0CI_CFoXrAjz-bmt4_VfzIhBeo30M,3478
118
+ maxframe/dataframe/datasource/from_records.py,sha256=ygpKOMXZnDdWzGxMxQ4KdGv-tJFT_yhpLGnDlS1rNLc,3549
118
119
  maxframe/dataframe/datasource/from_tensor.py,sha256=mShHYi0fZcG7ZShFVgIezaphh8tSFqR9-nQMm5YKIhw,15146
119
120
  maxframe/dataframe/datasource/index.py,sha256=X_NShW67nYJGxaWp3qOrvyInNkz9L-XHjbApU4fHoes,4518
120
121
  maxframe/dataframe/datasource/read_csv.py,sha256=IvQihmpcZIdzSD7ziX92aTAHNyP5WnTgd2cZz_h43sQ,24668
121
- maxframe/dataframe/datasource/read_odps_table.py,sha256=kZDpJvq3d39hLYa4oznk2LjJXipOUkfXadDhxPFSZbs,9267
122
+ maxframe/dataframe/datasource/read_odps_query.py,sha256=QKU_7R6dd6GXzNX4IN9uwu3jB17MfhTr2nUtx0LFSNk,10116
123
+ maxframe/dataframe/datasource/read_odps_table.py,sha256=ocSKQQ7SwIkzliFCFWNzy3e8J3CBZsf4971oRdlgdks,9294
122
124
  maxframe/dataframe/datasource/read_parquet.py,sha256=SZPrWoax2mwMBNvRk_3lkS72pZLe-_X_GwQ1JROBMs4,14952
123
125
  maxframe/dataframe/datasource/series.py,sha256=elQVupKETh-hUHI2fTu8TRxBE729Vyrmpjx17XlRV-8,1964
124
126
  maxframe/dataframe/datasource/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
125
- maxframe/dataframe/datasource/tests/test_datasource.py,sha256=jorppnuuEZMdCx_VhQu-HxlyBUiDj3r-Y8nIlmg02fs,11645
127
+ maxframe/dataframe/datasource/tests/test_datasource.py,sha256=UumRBjE-bIuCi7Z4_3t8qb58ZcF8ePRZf3xF7DTvqIA,15041
126
128
  maxframe/dataframe/datastore/__init__.py,sha256=MmlHYvFacMReOHDQMXF-z2bCsLyrSHYBVwIlCsZGOK4,810
127
129
  maxframe/dataframe/datastore/to_csv.py,sha256=lheaF3ZmBPrcwcWyhK5gEVAGIaLJbvTyVAzqZFGG7eM,8026
128
130
  maxframe/dataframe/datastore/to_odps.py,sha256=Ml_iF9AspqIgGbeOAjTF3ukAwv-7SizribuqXZdxuXo,5776
@@ -133,10 +135,10 @@ maxframe/dataframe/extensions/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b
133
135
  maxframe/dataframe/extensions/tests/test_extensions.py,sha256=oDnVwQx-o8p4wmen8ZS3gnudOAihFAdNKQhSCqNNXzQ,1324
134
136
  maxframe/dataframe/fetch/__init__.py,sha256=W1arTCAjD0v_bdVeIzpJMnil3h0Ucsn29zFWmgZcYck,668
135
137
  maxframe/dataframe/fetch/core.py,sha256=27VANjpMm2rdCg1KPZxWZrKWNuNgSMzZrordI05mqWc,3424
136
- maxframe/dataframe/groupby/__init__.py,sha256=2GpnBNlM35Z2cU-seUkwZ_GX1h9vpiZXtX4HOo2y4zc,3325
138
+ maxframe/dataframe/groupby/__init__.py,sha256=wMjmvk4ced1uCm7bw0oodIKvaep61KhupriL9JRRq5w,3443
137
139
  maxframe/dataframe/groupby/aggregation.py,sha256=cUnu-Bj6YD1TVkaafwL2aGIIqixLEq7s9-7BQ_1T2DI,12303
138
140
  maxframe/dataframe/groupby/apply.py,sha256=DQHyEfqj-3tfK-CxwpdVgya0_YC9dImeWYPZJDw7ckk,9735
139
- maxframe/dataframe/groupby/core.py,sha256=BPcDrMN710phqwV1_F7kZKKan7ZqxoER-Jd4mXxMMyw,6154
141
+ maxframe/dataframe/groupby/core.py,sha256=NG6e3sqIu5dnBw9_DCQEDtsnxM5e4Yl1oD7Z_qjdtWA,6254
140
142
  maxframe/dataframe/groupby/cum.py,sha256=A7vIWLsb50VLu3yAngO-BfZecjWj0Fk6TZ5v4uQEAPM,3879
141
143
  maxframe/dataframe/groupby/fill.py,sha256=AXRmA_j-m7ig0udLCJ02FwIce2GLQ2U8KlnuCe-NY3U,4862
142
144
  maxframe/dataframe/groupby/getitem.py,sha256=owNzoE8UEfM41dfuntKkRBjjYYbY8O8CMJchIhCEyds,3344
@@ -197,7 +199,7 @@ maxframe/dataframe/misc/select_dtypes.py,sha256=qsrWW8BNBd-hAT1yIlrnbvBjfbzZyttz
197
199
  maxframe/dataframe/misc/shift.py,sha256=HCGKBuToksgu5LZR_k5eaQrdyrXCeqRZYbZs0J5-N6s,9191
198
200
  maxframe/dataframe/misc/stack.py,sha256=a3eWRUnFQ4okGUEirsdIq9taLfcRTCKnLfcXHg-sce8,8200
199
201
  maxframe/dataframe/misc/string_.py,sha256=AaEfHcPAJWZ8Ug-zbD0gjaBfuFXWfHDXbrHQ1Kaqes4,8322
200
- maxframe/dataframe/misc/to_numeric.py,sha256=0U96l_IxGHPzB3Tbomc_VXEJ04fYL43i0hgJ_0EqNLY,6370
202
+ maxframe/dataframe/misc/to_numeric.py,sha256=VxYijzFTiUD9Jc62fE24tZ3iB8EVb9cBqZwvQFt2bHA,6440
201
203
  maxframe/dataframe/misc/transform.py,sha256=JotPUQzKGhCLRi53sk7USU9HscNjUKCzzus9PgTyhHU,12000
202
204
  maxframe/dataframe/misc/transpose.py,sha256=SsKRuN9Pj36D6kntnsLfzBsFHjSCiV1cZuPJuKHgbGU,3772
203
205
  maxframe/dataframe/misc/value_counts.py,sha256=7Yd3ZSrCRDMRX093IlzdsrTJ5UUx0n_lbD5AmXLUr_U,5674
@@ -262,13 +264,13 @@ maxframe/dataframe/ufunc/__init__.py,sha256=0oKXArwhdI6TvyMamPN_UuW7dwe9plKXAYJX
262
264
  maxframe/dataframe/ufunc/tensor.py,sha256=wZzmrGgGZ1w2EaYjjfc-J6vKe6W8SLP9yFNGUtMLXSc,1672
263
265
  maxframe/dataframe/ufunc/ufunc.py,sha256=lvHUhekjNn8eJZRfJRwk922j6QLQvIfrNWs41hJ-Vq0,1703
264
266
  maxframe/dataframe/window/__init__.py,sha256=bQsgFdk801ezvU3Z4i-V-JGIOX-JzwsQk2JPrIdgPUc,939
265
- maxframe/dataframe/window/aggregation.py,sha256=OUQDtCWlfShFaEUaQhyqMAvSJIBnJkDScwiJDJMYavE,4571
267
+ maxframe/dataframe/window/aggregation.py,sha256=gTkI4ysG3Qd-pHiTI-aUWnsaGMZuk_gUhD8pZ-tZYko,3890
266
268
  maxframe/dataframe/window/core.py,sha256=NKWQIao5dOI_3jL2Rzkgo_wdi36VCBIMWG4eRe1237M,2274
267
- maxframe/dataframe/window/ewm.py,sha256=t7NtbcIrgOXCKannKrCYBYIXes5wBImCAsPYiW6C8bk,8288
269
+ maxframe/dataframe/window/ewm.py,sha256=csPVRhHOTk2VP_I7WOuQMG6vlZtPXSij6A3Pe7H-who,8038
268
270
  maxframe/dataframe/window/expanding.py,sha256=Y0RLJdV4lnVGDD2VdOVCuYoXVr5PO-WqaMx3AAiNKWc,3941
269
271
  maxframe/dataframe/window/rolling.py,sha256=czrpdXbenldL-9tYc8ndRBf7KlzIIfP4jwmM5V-fwO8,12418
270
272
  maxframe/dataframe/window/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
271
- maxframe/dataframe/window/tests/test_ewm.py,sha256=4iFXBalVZuKT99AfuM9tU00Z0Z41iWiD8GEjkXLCDtE,2330
273
+ maxframe/dataframe/window/tests/test_ewm.py,sha256=v1hM2ucFH_8aRn8AJqWEpvvVtSK9QQUCs911N0trbX8,2130
272
274
  maxframe/dataframe/window/tests/test_expanding.py,sha256=PsFYI6YXxNHYlsyaesy9yIAUSixp4IOrChmQtRGBpKc,2010
273
275
  maxframe/dataframe/window/tests/test_rolling.py,sha256=eJYHh4MhKm_e9h4bCnK_d_aAYlKGQtFAbZTTEILe6gU,1771
274
276
  maxframe/learn/__init__.py,sha256=1QzrFCJmdZFy0Nh1Ng3V6yY_NVvoSUdTIqcU-HIa1wk,649
@@ -281,7 +283,7 @@ maxframe/learn/contrib/pytorch/tests/test_pytorch.py,sha256=GHP-oD5uMU8LD90Jt2cH
281
283
  maxframe/lib/__init__.py,sha256=_PB28W40qku6YiT8fJYqdmEdRMQfelOwGeksCOZJfCc,657
282
284
  maxframe/lib/compression.py,sha256=QQpNK79iUC9zck74I0HKMhapSRnLBXtTRyS91taEVIc,1497
283
285
  maxframe/lib/functools_compat.py,sha256=2LTrkSw5i-z5E9XCtZzfg9-0vPrYxicKvDjnnNrAL1Q,2697
284
- maxframe/lib/mmh3.cp38-win_amd64.pyd,sha256=pFpTjj4_RHguFOFsaudsDifXrhrEEnQLV4sxOdaPj8k,17408
286
+ maxframe/lib/mmh3.cp38-win_amd64.pyd,sha256=HMgH8mFYmm50QB_5WtKQ7UIOgGnFUGJoPzGKKfApJVs,17408
285
287
  maxframe/lib/version.py,sha256=VOVZu3KHS53YUsb_vQsT7AyHwcCWAgc-3bBqV5ANcbQ,18941
286
288
  maxframe/lib/wrapped_pickle.py,sha256=bzEaokhAZlkjXqw1xfeKO1KX2awhKIz_1RT81yPPoag,3949
287
289
  maxframe/lib/aio/__init__.py,sha256=xzIYnV42_7CYuDTTv8svscIXQeJMF0nn8AXMbpv173M,963
@@ -289,7 +291,7 @@ maxframe/lib/aio/_runners.py,sha256=zhDC92KxrYxLEufo5Hk8QU-mTVOxNL7IM9pZXas_nDg,
289
291
  maxframe/lib/aio/_threads.py,sha256=cDaEKg5STncq9QTPUUwehJ722vgueqBoB1C-NeoHN8E,1363
290
292
  maxframe/lib/aio/base.py,sha256=Ol0MnkcsBRfsQdZWceYfaWVtNOuiHzY8EYo2Zh0QFvM,2240
291
293
  maxframe/lib/aio/file.py,sha256=uy2LM_U8-Snpf45yZqUQRR_0hZT5UXZnwq0qENpMI6k,2097
292
- maxframe/lib/aio/isolation.py,sha256=zUqytRXUHRniUrZCRtsJkBldP-RnGWv3KpelQ3hyRdU,2723
294
+ maxframe/lib/aio/isolation.py,sha256=wIliQ1qFtGV_cZ4stE21QHKUVtq7j88m7ZuZF8Ye2iE,2861
293
295
  maxframe/lib/aio/lru.py,sha256=hZ0QY8VWhZr06B11YqjEONKcjySP7oKaa-p9evwnxZY,7133
294
296
  maxframe/lib/aio/parallelism.py,sha256=Q3dXir6wr5vG2SmVSz0n6BdH7d5mhMTohfeFs5JDTtU,1272
295
297
  maxframe/lib/aio/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
@@ -344,17 +346,17 @@ maxframe/remote/core.py,sha256=w_eTDEs0O7iIzLn1YrMGh2gcNAzzbqV0mx2bRT7su_U,7001
344
346
  maxframe/remote/run_script.py,sha256=k93-vaFLUanWoBRai4-78DX_SLeZ8_rbbxcCtOIXZO8,3677
345
347
  maxframe/serialization/__init__.py,sha256=nxxU7CI6MRcL3sjA1KmLkpTGKA3KG30FKl-MJJ0MCdI,947
346
348
  maxframe/serialization/arrow.py,sha256=OMeDjLcPgagqzokG7g3Vhwm6Xw1j-Kph1V2QsIwi6dw,3513
347
- maxframe/serialization/core.cp38-win_amd64.pyd,sha256=j_ASMBKKkzSryNVhP4SmEqsp-WPE5tEHiZPVOr2E4fw,397824
349
+ maxframe/serialization/core.cp38-win_amd64.pyd,sha256=pm3uyk95Wnhn8B_LPdI9pV_gHACS9uBywUES38pY2OI,397824
348
350
  maxframe/serialization/core.pxd,sha256=Fymih3Wo-CrOY27_o_DRINdbRGR7mgiT-XCaXCXafxM,1347
349
351
  maxframe/serialization/core.pyx,sha256=Qmipu3LiJGIBVy_7d4tSJqcYWnG5xj2I7IaPv2PSq5E,35078
350
- maxframe/serialization/exception.py,sha256=D3KhQqQLbNC_eoG_9A6j3knCAtf6I9pzJ68MPCD2ats,3073
352
+ maxframe/serialization/exception.py,sha256=e7bZyPlZ8XhSCdeOwlYreq0HazPXKOgOA6r9Q4Ecn2Y,3113
351
353
  maxframe/serialization/maxframe_objects.py,sha256=ZHyvxIALoPuB_y3CRc70hZXyfdj4IhaKMXUEYLXHQag,1404
352
354
  maxframe/serialization/numpy.py,sha256=ENrFKl24mtYyO1vZRLwHvMD0r4z_UI7J2-yNlmfWSdk,3304
353
355
  maxframe/serialization/pandas.py,sha256=3aPzDOg9UYSI9GFpWm2aJc8EAi-d-timM8vQ8kTL3Cg,7349
354
356
  maxframe/serialization/scipy.py,sha256=fGwQ5ZreymrMT8g7TneATfFdKFF7YPNZQqgWgMa3J8M,2498
355
357
  maxframe/serialization/serializables/__init__.py,sha256=rlQhIaSAVzz4KYkc5shEHFZDPd6WDMPkxalU76yjJ3M,1406
356
- maxframe/serialization/serializables/core.py,sha256=9QlrQIRWSf0Ocs3YB4_n62v03RAkrb1rGN8AFCuzumI,9053
357
- maxframe/serialization/serializables/field.py,sha256=Rv9qFKCE0G9TSJXo1VU8mYu_OLakFsiZHC0enDrKIBs,16540
358
+ maxframe/serialization/serializables/core.py,sha256=QUjHQPG_Qd5yh_bW-mCdapY5uKUl-s1axrM2N3eomyQ,9227
359
+ maxframe/serialization/serializables/field.py,sha256=DVott3HAbne4UvN-heSFS9gSl0wCxV5RssS738FCjzk,16639
358
360
  maxframe/serialization/serializables/field_type.py,sha256=hkxrXT2SL_tATuobtJDfL4DzzVP2hJjDlC3PrJg6ZKo,15454
359
361
  maxframe/serialization/serializables/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
360
362
  maxframe/serialization/serializables/tests/test_field_type.py,sha256=uG87-bdG8xGmjrubEHCww1ZKmRupSvnNKnZoV2SnwYM,4502
@@ -363,7 +365,7 @@ maxframe/serialization/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH
363
365
  maxframe/serialization/tests/test_serial.py,sha256=9G2CbPBHINwcZ038pRwZON_OtH-JVXZ8w66BLYWP578,12923
364
366
  maxframe/tensor/__init__.py,sha256=aomZCK-bt5OYyRLGcbACxtFLrWIp14F4R3P79zwbN5E,3694
365
367
  maxframe/tensor/array_utils.py,sha256=xr_Ng-4dETJFjsMfWi5gbTPM9mRmPvRWj8QY2WKjmCg,5129
366
- maxframe/tensor/core.py,sha256=u9HPbYj1gOF4m7WJpjSCprIHR-3HEEwK_LhjPNmro7g,22644
368
+ maxframe/tensor/core.py,sha256=-G-UzY81GTKj2SD9FQLqBg-UDod5LjjrEA-uF16ofms,22638
367
369
  maxframe/tensor/operators.py,sha256=8VsSZ8OcImGkSRQvrYlV05KMHGsroAYmW1o9RM2yV1U,3584
368
370
  maxframe/tensor/utils.py,sha256=An35s6MrbltYvN8WYzjKCjyozTDbGQrvUW_qz8KnA94,23632
369
371
  maxframe/tensor/arithmetic/__init__.py,sha256=SUlcG0Mf9ddgxAdydenuJ9eY5yVu0TgKfpBujI3OX4w,9695
@@ -601,26 +603,27 @@ maxframe/tensor/statistics/quantile.py,sha256=HrPxQoRXTEGf-5m79osqhUoSTFpWmIwmhO
601
603
  maxframe/tensor/ufunc/__init__.py,sha256=8QUi-cPvvbsD7i7LOeZ9sc0v1XXd7lt-XV5pQKbVZJs,821
602
604
  maxframe/tensor/ufunc/ufunc.py,sha256=XRtGlhdrW7H--mrc8fTBOlUP0mzKpd9tdRtCuLDymtc,7383
603
605
  maxframe/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
604
- maxframe/tests/test_protocol.py,sha256=n7LSC42JtGQuCRt0XY8sd9ewf6i_1C0LE3ux9yNMGp8,4993
606
+ maxframe/tests/test_codegen.py,sha256=h3TKqP4zghxTn1twH7gR9jOe6NKXdCC1B4u0chlUrpY,2277
607
+ maxframe/tests/test_protocol.py,sha256=IgZT2CBH1dv6V1DwSq-PjvrUhvtOf8Mab6dnWhAT3No,5331
605
608
  maxframe/tests/test_utils.py,sha256=0Iey3O6zrGI1yQU2OSpWavJNvhUjrmdkct4-27tkGUM,12353
606
- maxframe/tests/utils.py,sha256=ulCRwCjaJeoMo4NwvekJq5BhEJzzr9sdTn-cOx9HG_A,4697
609
+ maxframe/tests/utils.py,sha256=gCre-8BApU4-AEun9WShm4Ff5a9a_oKxvLNneESXBjU,4732
607
610
  maxframe_client/__init__.py,sha256=xqlN69LjvAp2bNCaT9d82U9AF5WKi_c4UOheEW1wV9E,741
608
611
  maxframe_client/conftest.py,sha256=UWWMYjmohHL13hLl4adb0gZPLRdBVOYVvsFo6VZruI0,658
609
612
  maxframe_client/fetcher.py,sha256=ajt14PYVEXKShXSx-qTL_8adMCXBEsZoOhHr3yx95-M,7015
610
613
  maxframe_client/clients/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
611
- maxframe_client/clients/framedriver.py,sha256=_Hv_pcV0Rmc3v8sNLzrZyTYz5AyoavDPOs8jtotFQWU,4570
614
+ maxframe_client/clients/framedriver.py,sha256=upN6C1eZrCpLTsS6fihWOMy392psWfo0bw2XgSLI_Yg,4581
612
615
  maxframe_client/clients/spe.py,sha256=uizNBejhU_FrMhsgsFgDnq7gL7Cxk803LeLYmr3nmxs,3697
613
616
  maxframe_client/session/__init__.py,sha256=9zFCd3zkSADESAFc4SPoQ2nkvRwsIhhpNNO2TtSaWbU,854
614
617
  maxframe_client/session/consts.py,sha256=nD-D0zHXumbQI8w3aUyltJS59K5ftipf3xCtHNLmtc8,1380
615
618
  maxframe_client/session/graph.py,sha256=GSZaJ-PV4DK8bTcNtoSoY5kDTyyIRAKleh4tOCSUbsI,4470
616
619
  maxframe_client/session/odps.py,sha256=RG7_28UaS_8tgJUOa4ohw2QtwX2fF4yqsGGy2MksQWI,16700
617
- maxframe_client/session/task.py,sha256=5g3xmYpc5tY_rJqPQLok3WN-FJXDi9DarkY1b533I9s,10359
620
+ maxframe_client/session/task.py,sha256=R8x8OERIb673vTq-o0ig6Zy2NT4_jvi8AbLhyMaljo8,11409
618
621
  maxframe_client/session/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
619
- maxframe_client/session/tests/test_task.py,sha256=lm2q1tWZiaYeU0D11_f_t7acZLLi1Ts-nlIFpZHsm4U,2684
622
+ maxframe_client/session/tests/test_task.py,sha256=861usEURVXeTUzfJYZmBfwsHfZFexG23mMtT5IJOOm4,3364
620
623
  maxframe_client/tests/__init__.py,sha256=29eM5D4knhYwe3TF42naTuC5b4Ym3VeH4rK8KpdLWNY,609
621
624
  maxframe_client/tests/test_fetcher.py,sha256=7iYXLMIoCJLfgUkjB2HBkV-sqQ-xGlhtzfp9hRJz_kM,3605
622
- maxframe_client/tests/test_session.py,sha256=vTycMT6IMtPQcpVFCXFWLniHXj6m03JsSciJ7x_kAbU,6443
623
- maxframe-0.1.0b1.dist-info/METADATA,sha256=6EWTzzw1n2LdaYmzAdRlAN_afurzh-lLiYbljnug3Do,5146
624
- maxframe-0.1.0b1.dist-info/WHEEL,sha256=3SeyPJ5-Us2Ct5GSftUVKtLSlm-bNefW4m5qd0GLzww,100
625
- maxframe-0.1.0b1.dist-info/top_level.txt,sha256=64x-fc2q59c_vXwNUkehyjF1vb8JWqFSdYmUqIFqoTM,31
626
- maxframe-0.1.0b1.dist-info/RECORD,,
625
+ maxframe_client/tests/test_session.py,sha256=s8pxf0I6PjOd6ZZQ4IYjfOM_3F3wf6SGPRMz0tAZFmo,6514
626
+ maxframe-0.1.0b3.dist-info/METADATA,sha256=aZIVKoKmfRSjIExk2K16jB0fJj5iApw9FhoHqv6hs_k,3147
627
+ maxframe-0.1.0b3.dist-info/WHEEL,sha256=Wb4yjwIXVKEpht4JWFUZNCzpG7JLBNZnqtK2YNdqLkI,100
628
+ maxframe-0.1.0b3.dist-info/top_level.txt,sha256=64x-fc2q59c_vXwNUkehyjF1vb8JWqFSdYmUqIFqoTM,31
629
+ maxframe-0.1.0b3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-cp38-win_amd64
5
5
 
@@ -14,6 +14,7 @@
14
14
 
15
15
  from typing import Any, Dict, List
16
16
 
17
+ import msgpack
17
18
  from tornado import httpclient
18
19
 
19
20
  from maxframe.core import TileableGraph
@@ -28,7 +29,6 @@ from maxframe.protocol import (
28
29
  )
29
30
  from maxframe.typing_ import TimeoutType
30
31
  from maxframe.utils import (
31
- deserialize_serializable,
32
32
  format_timeout_params,
33
33
  serialize_serializable,
34
34
  wait_http_response,
@@ -47,12 +47,12 @@ class FrameDriverClient:
47
47
  resp = await httpclient.AsyncHTTPClient().fetch(
48
48
  req_url, method="POST", body=serialize_serializable(req_body)
49
49
  )
50
- return deserialize_serializable(resp.body).body
50
+ return SessionInfo.from_json(msgpack.loads(resp.body))
51
51
 
52
52
  async def get_session(self, session_id: str) -> SessionInfo:
53
53
  req_url = f"{self._endpoint}/api/sessions/{session_id}"
54
54
  resp = await httpclient.AsyncHTTPClient().fetch(req_url, method="GET")
55
- return deserialize_serializable(resp.body).body
55
+ return SessionInfo.from_json(msgpack.loads(resp.body))
56
56
 
57
57
  async def delete_session(self, session_id: str):
58
58
  req_url = f"{self._endpoint}/api/sessions/{session_id}"
@@ -71,12 +71,12 @@ class FrameDriverClient:
71
71
  method="POST",
72
72
  body=serialize_serializable(ProtocolBody(body=req_body)),
73
73
  )
74
- return deserialize_serializable(resp.body).body
74
+ return DagInfo.from_json(msgpack.loads(resp.body))
75
75
 
76
76
  async def get_dag_info(self, session_id: str, dag_id: str) -> DagInfo:
77
77
  req_url = f"{self._endpoint}/api/sessions/{session_id}/dags/{dag_id}"
78
78
  resp = await httpclient.AsyncHTTPClient().fetch(req_url, method="GET")
79
- return deserialize_serializable(resp.body).body
79
+ return DagInfo.from_json(msgpack.loads(resp.body))
80
80
 
81
81
  async def wait_dag(self, session_id: str, dag_id: str, timeout: TimeoutType = None):
82
82
  query_part = format_timeout_params(timeout)
@@ -87,7 +87,7 @@ class FrameDriverClient:
87
87
  resp = await wait_http_response(
88
88
  req_url, method="GET", request_timeout=timeout
89
89
  )
90
- info = deserialize_serializable(resp.body).body
90
+ info = DagInfo.from_json(msgpack.loads(resp.body))
91
91
  except TimeoutError:
92
92
  info = await self.get_dag_info(session_id, dag_id)
93
93
  return info
@@ -103,7 +103,7 @@ class FrameDriverClient:
103
103
  resp = await wait_http_response(
104
104
  req_url, method="DELETE", request_timeout=timeout
105
105
  )
106
- info = deserialize_serializable(resp.body).body
106
+ info = DagInfo.from_json(msgpack.loads(resp.body))
107
107
  except TimeoutError:
108
108
  info = await self.get_dag_info(session_id, dag_id)
109
109
  return info
@@ -22,6 +22,7 @@ import msgpack
22
22
  from odps import ODPS
23
23
  from odps import options as odps_options
24
24
  from odps import serializers
25
+ from odps.errors import parse_instance_error
25
26
  from odps.models import Instance, Task
26
27
 
27
28
  from maxframe.config import options
@@ -29,6 +30,11 @@ from maxframe.core import TileableGraph
29
30
  from maxframe.protocol import DagInfo, JsonSerializable, ResultInfo, SessionInfo
30
31
  from maxframe.utils import deserialize_serializable, serialize_serializable, to_str
31
32
 
33
+ try:
34
+ from maxframe import __version__ as mf_version
35
+ except ImportError:
36
+ mf_version = None
37
+
32
38
  from .consts import (
33
39
  MAXFRAME_DEFAULT_PROTOCOL,
34
40
  MAXFRAME_OUTPUT_JSON_FORMAT,
@@ -91,6 +97,8 @@ class MaxFrameTask(Task):
91
97
  "odps.maxframe.output_format": self._output_format,
92
98
  "odps.service.endpoint": self._service_endpoint,
93
99
  }
100
+ if mf_version:
101
+ mf_opts["odps.maxframe.client_version"] = mf_version
94
102
  settings.update(mf_opts)
95
103
  self.properties["settings"] = json.dumps(settings)
96
104
  return super().serial()
@@ -104,13 +112,19 @@ class MaxFrameInstanceCaller(MaxFrameServiceCaller):
104
112
  odps_entry: ODPS,
105
113
  task_name: Optional[str] = None,
106
114
  project: Optional[str] = None,
107
- priority: Optional[str] = None,
115
+ priority: Optional[int] = None,
108
116
  running_cluster: Optional[str] = None,
109
117
  nested_instance_id: Optional[str] = None,
110
118
  major_version: Optional[str] = None,
111
119
  output_format: Optional[str] = None,
112
120
  **kwargs,
113
121
  ):
122
+ if callable(odps_options.get_priority):
123
+ default_priority = odps_options.get_priority(odps_entry)
124
+ else:
125
+ default_priority = odps_options.priority
126
+ priority = priority if priority is not None else default_priority
127
+
114
128
  self._odps_entry = odps_entry
115
129
  self._task_name = task_name
116
130
  self._project = project
@@ -118,6 +132,7 @@ class MaxFrameInstanceCaller(MaxFrameServiceCaller):
118
132
  self._running_cluster = running_cluster
119
133
  self._major_version = major_version
120
134
  self._output_format = output_format or MAXFRAME_OUTPUT_MSGPACK_FORMAT
135
+
121
136
  if nested_instance_id is None:
122
137
  self._nested = False
123
138
  self._instance = None
@@ -126,9 +141,12 @@ class MaxFrameInstanceCaller(MaxFrameServiceCaller):
126
141
  self._instance = odps_entry.get_instance(nested_instance_id)
127
142
 
128
143
  def _deserial_task_info_result(
129
- self, content: Union[bytes, str], target_cls: Type[JsonSerializable]
144
+ self, content: Union[bytes, str, dict], target_cls: Type[JsonSerializable]
130
145
  ):
131
- json_data = json.loads(to_str(content))
146
+ if isinstance(content, (str, bytes)):
147
+ json_data = json.loads(to_str(content))
148
+ else:
149
+ json_data = content
132
150
  result_data = base64.b64decode(json_data["result"])
133
151
  if self._output_format == MAXFRAME_OUTPUT_MAXFRAME_FORMAT:
134
152
  return deserialize_serializable(result_data)
@@ -166,12 +184,22 @@ class MaxFrameInstanceCaller(MaxFrameServiceCaller):
166
184
  )
167
185
  return self._deserial_task_info_result(result, SessionInfo)
168
186
 
187
+ def _parse_instance_result_error(self):
188
+ result_data = self._instance.get_task_result(self._task_name)
189
+ try:
190
+ info = self._deserial_task_info_result({"result": result_data}, SessionInfo)
191
+ except:
192
+ raise parse_instance_error(result_data)
193
+ info.error_info.reraise()
194
+
169
195
  def _wait_instance_task_ready(
170
196
  self, interval: float = 0.1, max_interval: float = 5.0, timeout: int = None
171
197
  ):
172
198
  check_time = time.time()
173
199
  timeout = timeout or options.client.task_start_timeout
174
200
  while True:
201
+ if self._instance.is_terminated(retry=True):
202
+ self._parse_instance_result_error()
175
203
  status_json = json.loads(
176
204
  self._instance.get_task_info(self._task_name, "status") or "{}"
177
205
  )
@@ -18,6 +18,7 @@ import os
18
18
  import mock
19
19
  from defusedxml import ElementTree
20
20
  from odps import ODPS
21
+ from odps import options as odps_options
21
22
 
22
23
  from ...session.consts import MAXFRAME_OUTPUT_JSON_FORMAT
23
24
  from ...session.task import MaxFrameInstanceCaller, MaxFrameTask
@@ -27,17 +28,20 @@ expected_file_dir = os.path.join(os.path.dirname(__file__), "expected-data")
27
28
 
28
29
  def test_maxframe_instance_caller_creating_session():
29
30
  o = ODPS.from_environments()
30
- task_caller = MaxFrameInstanceCaller(
31
- odps_entry=o,
32
- task_name="task_test",
33
- major_version="test_version",
34
- output_format=MAXFRAME_OUTPUT_JSON_FORMAT,
35
- priority="100",
36
- running_cluster="test_cluster",
37
- )
31
+
32
+ def create_caller(**kwargs):
33
+ kw = dict(
34
+ odps_entry=o,
35
+ task_name="task_test",
36
+ major_version="test_version",
37
+ output_format=MAXFRAME_OUTPUT_JSON_FORMAT,
38
+ running_cluster="test_cluster",
39
+ )
40
+ kw.update(**kwargs)
41
+ return MaxFrameInstanceCaller(**kw)
38
42
 
39
43
  def mock_create(self, task: MaxFrameTask, priority=None, running_cluster=None):
40
- assert priority == "100"
44
+ assert priority == 100
41
45
  assert running_cluster == "test_cluster"
42
46
  root = ElementTree.parse(
43
47
  os.path.join(expected_file_dir, "create_session.xml")
@@ -62,6 +66,20 @@ def test_maxframe_instance_caller_creating_session():
62
66
  target="maxframe_client.session.task.MaxFrameInstanceCaller",
63
67
  _wait_instance_task_ready=mock.DEFAULT,
64
68
  get_session=mock.DEFAULT,
65
- ):
66
- with mock.patch("odps.models.instances.BaseInstances.create", mock_create):
69
+ ), mock.patch("odps.models.instances.BaseInstances.create", mock_create):
70
+ task_caller = create_caller(priority=100)
71
+ task_caller.create_session()
72
+
73
+ old_priority = odps_options.priority
74
+ old_get_priority = odps_options.get_priority
75
+ try:
76
+ task_caller = create_caller(priority=100)
77
+ odps_options.priority = 100
78
+ task_caller.create_session()
79
+
80
+ odps_options.priority = None
81
+ odps_options.get_priority = lambda _: 100
67
82
  task_caller.create_session()
83
+ finally:
84
+ odps_options.priority = old_priority
85
+ odps_options.get_priority = old_get_priority
@@ -24,6 +24,7 @@ from odps import ODPS
24
24
  import maxframe.dataframe as md
25
25
  import maxframe.remote as mr
26
26
  from maxframe.core import ExecutableTuple, TileableGraph
27
+ from maxframe.lib.aio import stop_isolation
27
28
  from maxframe.protocol import ResultInfo
28
29
  from maxframe.serialization import RemoteException
29
30
  from maxframe.session import new_session
@@ -52,6 +53,7 @@ def start_mock_session(framedriver_app): # noqa: F811
52
53
  time.sleep(5) # Wait for temp table deleted
53
54
  else:
54
55
  session.reset_default()
56
+ stop_isolation()
55
57
 
56
58
 
57
59
  def test_simple_run_dataframe(start_mock_session):