maxframe 1.1.1__cp37-cp37m-win32.whl → 1.2.1__cp37-cp37m-win32.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/__init__.py +1 -1
- maxframe/_utils.cp37-win32.pyd +0 -0
- maxframe/_utils.pxd +1 -1
- maxframe/_utils.pyx +1 -1
- maxframe/codegen.py +14 -7
- maxframe/config/__init__.py +1 -1
- maxframe/config/config.py +10 -1
- maxframe/config/tests/__init__.py +1 -1
- maxframe/config/tests/test_config.py +1 -1
- maxframe/config/tests/test_validators.py +1 -1
- maxframe/config/validators.py +1 -1
- maxframe/conftest.py +1 -1
- maxframe/core/__init__.py +2 -1
- maxframe/core/accessor.py +44 -0
- maxframe/core/base.py +1 -1
- maxframe/core/entity/__init__.py +1 -1
- maxframe/core/entity/core.py +1 -1
- maxframe/core/entity/executable.py +1 -1
- maxframe/core/entity/objects.py +1 -1
- maxframe/core/entity/output_types.py +1 -1
- maxframe/core/entity/tests/__init__.py +1 -1
- maxframe/core/entity/tests/test_objects.py +1 -1
- maxframe/core/entity/tileables.py +1 -1
- maxframe/core/entity/utils.py +1 -1
- maxframe/core/graph/__init__.py +1 -1
- maxframe/core/graph/builder/__init__.py +1 -1
- maxframe/core/graph/builder/base.py +1 -1
- maxframe/core/graph/builder/tileable.py +1 -1
- maxframe/core/graph/builder/utils.py +1 -1
- maxframe/core/graph/core.cp37-win32.pyd +0 -0
- maxframe/core/graph/core.pyx +1 -1
- maxframe/core/graph/entity.py +1 -1
- maxframe/core/graph/tests/__init__.py +1 -1
- maxframe/core/graph/tests/test_graph.py +1 -1
- maxframe/core/mode.py +1 -1
- maxframe/core/operator/__init__.py +1 -1
- maxframe/core/operator/base.py +1 -1
- maxframe/core/operator/core.py +1 -1
- maxframe/core/operator/fetch.py +1 -1
- maxframe/core/operator/objects.py +1 -1
- maxframe/core/operator/shuffle.py +1 -1
- maxframe/core/operator/tests/__init__.py +1 -1
- maxframe/core/operator/tests/test_core.py +1 -1
- maxframe/core/operator/utils.py +1 -1
- maxframe/core/tests/__init__.py +1 -1
- maxframe/core/tests/test_mode.py +1 -1
- maxframe/dataframe/__init__.py +3 -3
- maxframe/dataframe/accessors/__init__.py +15 -0
- maxframe/dataframe/accessors/datetime_/__init__.py +32 -0
- maxframe/dataframe/accessors/datetime_/accessor.py +67 -0
- maxframe/dataframe/{misc/datetimes.py → accessors/datetime_/core.py} +9 -9
- maxframe/dataframe/{plotting → accessors/datetime_}/tests/__init__.py +1 -1
- maxframe/dataframe/accessors/datetime_/tests/test_datetime_accessor.py +41 -0
- maxframe/dataframe/accessors/dict_/__init__.py +43 -0
- maxframe/dataframe/accessors/dict_/accessor.py +38 -0
- maxframe/dataframe/accessors/dict_/contains.py +81 -0
- maxframe/dataframe/accessors/dict_/getitem.py +144 -0
- maxframe/dataframe/accessors/dict_/length.py +72 -0
- maxframe/dataframe/accessors/dict_/remove.py +87 -0
- maxframe/dataframe/accessors/dict_/setitem.py +88 -0
- maxframe/dataframe/accessors/dict_/tests/__init__.py +13 -0
- maxframe/dataframe/accessors/dict_/tests/test_dict_accessor.py +130 -0
- maxframe/dataframe/{plotting → accessors/plotting}/__init__.py +4 -6
- maxframe/dataframe/{plotting → accessors/plotting}/core.py +3 -3
- maxframe/dataframe/accessors/plotting/tests/__init__.py +13 -0
- maxframe/dataframe/{plotting/tests/test_plotting.py → accessors/plotting/tests/test_plotting_accessor.py} +6 -6
- maxframe/dataframe/accessors/string_/__init__.py +32 -0
- maxframe/dataframe/{misc → accessors/string_}/accessor.py +4 -65
- maxframe/dataframe/{misc/string_.py → accessors/string_/core.py} +20 -20
- maxframe/dataframe/accessors/string_/tests/__init__.py +13 -0
- maxframe/dataframe/accessors/string_/tests/test_string_accessor.py +73 -0
- maxframe/dataframe/arithmetic/__init__.py +1 -1
- maxframe/dataframe/arithmetic/abs.py +1 -1
- maxframe/dataframe/arithmetic/add.py +1 -1
- maxframe/dataframe/arithmetic/arccos.py +1 -1
- maxframe/dataframe/arithmetic/arccosh.py +1 -1
- maxframe/dataframe/arithmetic/arcsin.py +1 -1
- maxframe/dataframe/arithmetic/arcsinh.py +1 -1
- maxframe/dataframe/arithmetic/arctan.py +1 -1
- maxframe/dataframe/arithmetic/arctanh.py +1 -1
- maxframe/dataframe/arithmetic/around.py +1 -1
- maxframe/dataframe/arithmetic/bitwise_and.py +1 -1
- maxframe/dataframe/arithmetic/bitwise_or.py +1 -1
- maxframe/dataframe/arithmetic/bitwise_xor.py +1 -1
- maxframe/dataframe/arithmetic/ceil.py +1 -1
- maxframe/dataframe/arithmetic/core.py +1 -1
- maxframe/dataframe/arithmetic/cos.py +1 -1
- maxframe/dataframe/arithmetic/cosh.py +1 -1
- maxframe/dataframe/arithmetic/degrees.py +1 -1
- maxframe/dataframe/arithmetic/docstring.py +1 -1
- maxframe/dataframe/arithmetic/equal.py +1 -1
- maxframe/dataframe/arithmetic/exp.py +1 -1
- maxframe/dataframe/arithmetic/exp2.py +1 -1
- maxframe/dataframe/arithmetic/expm1.py +1 -1
- maxframe/dataframe/arithmetic/floor.py +1 -1
- maxframe/dataframe/arithmetic/floordiv.py +1 -1
- maxframe/dataframe/arithmetic/greater.py +1 -1
- maxframe/dataframe/arithmetic/greater_equal.py +1 -1
- maxframe/dataframe/arithmetic/invert.py +1 -1
- maxframe/dataframe/arithmetic/is_ufuncs.py +1 -1
- maxframe/dataframe/arithmetic/less.py +1 -1
- maxframe/dataframe/arithmetic/less_equal.py +1 -1
- maxframe/dataframe/arithmetic/log.py +1 -1
- maxframe/dataframe/arithmetic/log10.py +1 -1
- maxframe/dataframe/arithmetic/log2.py +1 -1
- maxframe/dataframe/arithmetic/mod.py +1 -1
- maxframe/dataframe/arithmetic/multiply.py +1 -1
- maxframe/dataframe/arithmetic/negative.py +1 -1
- maxframe/dataframe/arithmetic/not_equal.py +1 -1
- maxframe/dataframe/arithmetic/power.py +1 -1
- maxframe/dataframe/arithmetic/radians.py +1 -1
- maxframe/dataframe/arithmetic/sin.py +1 -1
- maxframe/dataframe/arithmetic/sinh.py +1 -1
- maxframe/dataframe/arithmetic/sqrt.py +1 -1
- maxframe/dataframe/arithmetic/subtract.py +1 -1
- maxframe/dataframe/arithmetic/tan.py +1 -1
- maxframe/dataframe/arithmetic/tanh.py +1 -1
- maxframe/dataframe/arithmetic/tests/__init__.py +1 -1
- maxframe/dataframe/arithmetic/tests/test_arithmetic.py +1 -1
- maxframe/dataframe/arithmetic/truediv.py +1 -1
- maxframe/dataframe/arithmetic/trunc.py +1 -1
- maxframe/dataframe/arrays.py +1 -1
- maxframe/dataframe/core.py +1 -1
- maxframe/dataframe/datasource/__init__.py +1 -1
- maxframe/dataframe/datasource/core.py +1 -1
- maxframe/dataframe/datasource/dataframe.py +1 -1
- maxframe/dataframe/datasource/date_range.py +1 -1
- maxframe/dataframe/datasource/from_index.py +1 -1
- maxframe/dataframe/datasource/from_records.py +1 -1
- maxframe/dataframe/datasource/from_tensor.py +1 -1
- maxframe/dataframe/datasource/index.py +1 -1
- maxframe/dataframe/datasource/read_csv.py +1 -1
- maxframe/dataframe/datasource/read_odps_query.py +46 -17
- maxframe/dataframe/datasource/read_odps_table.py +1 -1
- maxframe/dataframe/datasource/read_parquet.py +1 -1
- maxframe/dataframe/datasource/series.py +1 -1
- maxframe/dataframe/datasource/tests/__init__.py +1 -1
- maxframe/dataframe/datasource/tests/test_datasource.py +59 -8
- maxframe/dataframe/datastore/__init__.py +1 -1
- maxframe/dataframe/datastore/core.py +1 -1
- maxframe/dataframe/datastore/tests/__init__.py +1 -1
- maxframe/dataframe/datastore/tests/test_to_odps.py +1 -1
- maxframe/dataframe/datastore/to_csv.py +1 -1
- maxframe/dataframe/datastore/to_odps.py +1 -1
- maxframe/dataframe/extensions/__init__.py +2 -2
- maxframe/dataframe/extensions/accessor.py +6 -22
- maxframe/dataframe/extensions/apply_chunk.py +86 -1
- maxframe/dataframe/extensions/flatjson.py +1 -1
- maxframe/dataframe/extensions/flatmap.py +1 -1
- maxframe/dataframe/extensions/reshuffle.py +1 -1
- maxframe/dataframe/extensions/tests/__init__.py +1 -1
- maxframe/dataframe/extensions/tests/test_apply_chunk.py +1 -1
- maxframe/dataframe/extensions/tests/test_extensions.py +1 -1
- maxframe/dataframe/fetch/__init__.py +1 -1
- maxframe/dataframe/fetch/core.py +1 -1
- maxframe/dataframe/groupby/__init__.py +1 -1
- maxframe/dataframe/groupby/aggregation.py +1 -1
- maxframe/dataframe/groupby/apply.py +1 -1
- maxframe/dataframe/groupby/core.py +1 -1
- maxframe/dataframe/groupby/cum.py +1 -1
- maxframe/dataframe/groupby/fill.py +1 -1
- maxframe/dataframe/groupby/getitem.py +1 -1
- maxframe/dataframe/groupby/head.py +1 -1
- maxframe/dataframe/groupby/sample.py +1 -1
- maxframe/dataframe/groupby/tests/__init__.py +1 -1
- maxframe/dataframe/groupby/tests/test_groupby.py +1 -1
- maxframe/dataframe/groupby/transform.py +1 -1
- maxframe/dataframe/indexing/__init__.py +1 -1
- maxframe/dataframe/indexing/add_prefix_suffix.py +1 -1
- maxframe/dataframe/indexing/align.py +1 -1
- maxframe/dataframe/indexing/at.py +1 -1
- maxframe/dataframe/indexing/getitem.py +1 -1
- maxframe/dataframe/indexing/iat.py +1 -1
- maxframe/dataframe/indexing/iloc.py +1 -1
- maxframe/dataframe/indexing/insert.py +1 -1
- maxframe/dataframe/indexing/loc.py +1 -1
- maxframe/dataframe/indexing/reindex.py +1 -1
- maxframe/dataframe/indexing/rename.py +1 -1
- maxframe/dataframe/indexing/rename_axis.py +1 -1
- maxframe/dataframe/indexing/reset_index.py +1 -1
- maxframe/dataframe/indexing/sample.py +1 -1
- maxframe/dataframe/indexing/set_axis.py +1 -1
- maxframe/dataframe/indexing/set_index.py +1 -1
- maxframe/dataframe/indexing/setitem.py +1 -1
- maxframe/dataframe/indexing/tests/__init__.py +1 -1
- maxframe/dataframe/indexing/tests/test_indexing.py +1 -1
- maxframe/dataframe/indexing/where.py +1 -1
- maxframe/dataframe/initializer.py +1 -1
- maxframe/dataframe/merge/__init__.py +1 -1
- maxframe/dataframe/merge/append.py +1 -1
- maxframe/dataframe/merge/concat.py +1 -1
- maxframe/dataframe/merge/merge.py +1 -1
- maxframe/dataframe/merge/tests/__init__.py +1 -1
- maxframe/dataframe/merge/tests/test_merge.py +1 -1
- maxframe/dataframe/misc/__init__.py +1 -16
- maxframe/dataframe/misc/_duplicate.py +1 -1
- maxframe/dataframe/misc/apply.py +74 -1
- maxframe/dataframe/misc/astype.py +1 -1
- maxframe/dataframe/misc/case_when.py +1 -1
- maxframe/dataframe/misc/check_monotonic.py +1 -1
- maxframe/dataframe/misc/cut.py +6 -4
- maxframe/dataframe/misc/describe.py +1 -1
- maxframe/dataframe/misc/diff.py +1 -1
- maxframe/dataframe/misc/drop.py +1 -1
- maxframe/dataframe/misc/drop_duplicates.py +7 -4
- maxframe/dataframe/misc/duplicated.py +1 -1
- maxframe/dataframe/misc/eval.py +1 -1
- maxframe/dataframe/misc/explode.py +1 -1
- maxframe/dataframe/misc/get_dummies.py +1 -1
- maxframe/dataframe/misc/isin.py +1 -1
- maxframe/dataframe/misc/map.py +1 -1
- maxframe/dataframe/misc/melt.py +1 -1
- maxframe/dataframe/misc/memory_usage.py +1 -1
- maxframe/dataframe/misc/pct_change.py +1 -1
- maxframe/dataframe/misc/pivot_table.py +1 -1
- maxframe/dataframe/misc/qcut.py +1 -1
- maxframe/dataframe/misc/select_dtypes.py +1 -1
- maxframe/dataframe/misc/shift.py +1 -1
- maxframe/dataframe/misc/stack.py +1 -1
- maxframe/dataframe/misc/tests/__init__.py +1 -1
- maxframe/dataframe/misc/tests/test_misc.py +1 -76
- maxframe/dataframe/misc/to_numeric.py +1 -1
- maxframe/dataframe/misc/transform.py +1 -1
- maxframe/dataframe/misc/transpose.py +1 -1
- maxframe/dataframe/misc/value_counts.py +1 -1
- maxframe/dataframe/missing/__init__.py +1 -1
- maxframe/dataframe/missing/checkna.py +1 -1
- maxframe/dataframe/missing/dropna.py +1 -1
- maxframe/dataframe/missing/fillna.py +1 -1
- maxframe/dataframe/missing/replace.py +1 -1
- maxframe/dataframe/missing/tests/__init__.py +1 -1
- maxframe/dataframe/missing/tests/test_missing.py +1 -1
- maxframe/dataframe/operators.py +1 -1
- maxframe/dataframe/reduction/__init__.py +1 -1
- maxframe/dataframe/reduction/aggregation.py +1 -1
- maxframe/dataframe/reduction/all.py +1 -1
- maxframe/dataframe/reduction/any.py +1 -1
- maxframe/dataframe/reduction/core.py +1 -1
- maxframe/dataframe/reduction/count.py +1 -1
- maxframe/dataframe/reduction/cummax.py +1 -1
- maxframe/dataframe/reduction/cummin.py +1 -1
- maxframe/dataframe/reduction/cumprod.py +1 -1
- maxframe/dataframe/reduction/cumsum.py +1 -1
- maxframe/dataframe/reduction/custom_reduction.py +1 -1
- maxframe/dataframe/reduction/kurtosis.py +1 -1
- maxframe/dataframe/reduction/max.py +1 -1
- maxframe/dataframe/reduction/mean.py +1 -1
- maxframe/dataframe/reduction/median.py +1 -1
- maxframe/dataframe/reduction/min.py +1 -1
- maxframe/dataframe/reduction/nunique.py +1 -1
- maxframe/dataframe/reduction/prod.py +1 -1
- maxframe/dataframe/reduction/reduction_size.py +1 -1
- maxframe/dataframe/reduction/sem.py +1 -1
- maxframe/dataframe/reduction/skew.py +1 -1
- maxframe/dataframe/reduction/std.py +1 -1
- maxframe/dataframe/reduction/str_concat.py +1 -1
- maxframe/dataframe/reduction/sum.py +1 -1
- maxframe/dataframe/reduction/tests/__init__.py +1 -1
- maxframe/dataframe/reduction/tests/test_reduction.py +1 -1
- maxframe/dataframe/reduction/unique.py +1 -1
- maxframe/dataframe/reduction/var.py +1 -1
- maxframe/dataframe/sort/__init__.py +1 -1
- maxframe/dataframe/sort/core.py +1 -1
- maxframe/dataframe/sort/sort_index.py +1 -1
- maxframe/dataframe/sort/sort_values.py +1 -1
- maxframe/dataframe/sort/tests/__init__.py +1 -1
- maxframe/dataframe/sort/tests/test_sort.py +1 -1
- maxframe/dataframe/statistics/__init__.py +1 -1
- maxframe/dataframe/statistics/corr.py +1 -1
- maxframe/dataframe/statistics/quantile.py +1 -1
- maxframe/dataframe/statistics/tests/__init__.py +1 -1
- maxframe/dataframe/statistics/tests/test_statistics.py +1 -1
- maxframe/dataframe/tests/__init__.py +1 -1
- maxframe/dataframe/tests/test_initializer.py +1 -1
- maxframe/dataframe/tests/test_utils.py +36 -2
- maxframe/dataframe/tseries/__init__.py +1 -1
- maxframe/dataframe/tseries/tests/__init__.py +1 -1
- maxframe/dataframe/tseries/tests/test_tseries.py +1 -1
- maxframe/dataframe/tseries/to_datetime.py +1 -1
- maxframe/dataframe/ufunc/__init__.py +1 -1
- maxframe/dataframe/ufunc/tensor.py +1 -1
- maxframe/dataframe/ufunc/ufunc.py +1 -1
- maxframe/dataframe/utils.py +22 -2
- maxframe/dataframe/window/__init__.py +1 -1
- maxframe/dataframe/window/aggregation.py +1 -1
- maxframe/dataframe/window/core.py +1 -1
- maxframe/dataframe/window/ewm.py +1 -1
- maxframe/dataframe/window/expanding.py +1 -1
- maxframe/dataframe/window/rolling.py +1 -1
- maxframe/dataframe/window/tests/__init__.py +1 -1
- maxframe/dataframe/window/tests/test_ewm.py +1 -1
- maxframe/dataframe/window/tests/test_expanding.py +1 -1
- maxframe/dataframe/window/tests/test_rolling.py +1 -1
- maxframe/env.py +1 -1
- maxframe/errors.py +5 -1
- maxframe/extension.py +5 -2
- maxframe/io/__init__.py +1 -1
- maxframe/io/objects/__init__.py +1 -1
- maxframe/io/objects/core.py +1 -1
- maxframe/io/objects/tensor.py +1 -1
- maxframe/io/objects/tests/__init__.py +1 -1
- maxframe/io/objects/tests/test_object_io.py +1 -1
- maxframe/io/odpsio/__init__.py +1 -1
- maxframe/io/odpsio/arrow.py +8 -4
- maxframe/io/odpsio/schema.py +75 -3
- maxframe/io/odpsio/tableio.py +10 -4
- maxframe/io/odpsio/tests/__init__.py +1 -1
- maxframe/io/odpsio/tests/test_arrow.py +46 -1
- maxframe/io/odpsio/tests/test_schema.py +19 -1
- maxframe/io/odpsio/tests/test_tableio.py +1 -1
- maxframe/io/odpsio/tests/test_volumeio.py +1 -1
- maxframe/io/odpsio/volumeio.py +1 -1
- maxframe/learn/__init__.py +1 -1
- maxframe/learn/contrib/__init__.py +1 -1
- maxframe/learn/contrib/graph/__init__.py +1 -1
- maxframe/learn/contrib/graph/connected_components.py +1 -1
- maxframe/learn/contrib/graph/tests/__init__.py +1 -1
- maxframe/learn/contrib/graph/tests/test_connected_components.py +1 -1
- maxframe/learn/contrib/llm/__init__.py +1 -1
- maxframe/learn/contrib/llm/core.py +1 -1
- maxframe/learn/contrib/llm/models/__init__.py +1 -1
- maxframe/learn/contrib/llm/models/dashscope.py +1 -1
- maxframe/learn/contrib/llm/multi_modal.py +1 -1
- maxframe/learn/contrib/llm/text.py +1 -1
- maxframe/learn/contrib/pytorch/__init__.py +1 -1
- maxframe/learn/contrib/pytorch/run_function.py +1 -1
- maxframe/learn/contrib/pytorch/run_script.py +1 -1
- maxframe/learn/contrib/pytorch/tests/__init__.py +1 -1
- maxframe/learn/contrib/pytorch/tests/test_pytorch.py +1 -1
- maxframe/learn/contrib/utils.py +1 -1
- maxframe/learn/contrib/xgboost/__init__.py +1 -1
- maxframe/learn/contrib/xgboost/classifier.py +1 -1
- maxframe/learn/contrib/xgboost/core.py +1 -1
- maxframe/learn/contrib/xgboost/dmatrix.py +5 -2
- maxframe/learn/contrib/xgboost/predict.py +1 -1
- maxframe/learn/contrib/xgboost/regressor.py +1 -1
- maxframe/learn/contrib/xgboost/tests/__init__.py +1 -1
- maxframe/learn/contrib/xgboost/tests/test_core.py +1 -1
- maxframe/learn/contrib/xgboost/train.py +1 -1
- maxframe/learn/core.py +1 -1
- maxframe/learn/utils/__init__.py +1 -1
- maxframe/learn/utils/core.py +1 -1
- maxframe/lib/__init__.py +1 -1
- maxframe/lib/aio/__init__.py +1 -1
- maxframe/lib/aio/_runners.py +1 -1
- maxframe/lib/aio/_threads.py +1 -1
- maxframe/lib/aio/base.py +1 -1
- maxframe/lib/aio/file.py +1 -1
- maxframe/lib/aio/isolation.py +1 -1
- maxframe/lib/aio/lru.py +1 -1
- maxframe/lib/aio/parallelism.py +1 -1
- maxframe/lib/aio/tests/__init__.py +1 -1
- maxframe/lib/aio/tests/test_aio_file.py +1 -1
- maxframe/lib/compression.py +1 -1
- maxframe/lib/cython/__init__.py +1 -1
- maxframe/lib/cython/libcpp.pxd +1 -1
- maxframe/lib/dtypes_extension/__init__.py +14 -0
- maxframe/lib/dtypes_extension/dtypes.py +45 -0
- maxframe/lib/dtypes_extension/tests/__init__.py +13 -0
- maxframe/lib/dtypes_extension/tests/test_dtypes.py +38 -0
- maxframe/lib/filesystem/__init__.py +1 -1
- maxframe/lib/filesystem/_glob.py +1 -1
- maxframe/lib/filesystem/_oss_lib/__init__.py +1 -1
- maxframe/lib/filesystem/_oss_lib/common.py +1 -1
- maxframe/lib/filesystem/_oss_lib/glob.py +1 -1
- maxframe/lib/filesystem/_oss_lib/handle.py +1 -1
- maxframe/lib/filesystem/arrow.py +1 -1
- maxframe/lib/filesystem/base.py +1 -1
- maxframe/lib/filesystem/core.py +1 -1
- maxframe/lib/filesystem/fsmap.py +1 -1
- maxframe/lib/filesystem/hdfs.py +1 -1
- maxframe/lib/filesystem/local.py +1 -1
- maxframe/lib/filesystem/oss.py +1 -1
- maxframe/lib/filesystem/tests/__init__.py +1 -1
- maxframe/lib/filesystem/tests/test_filesystem.py +6 -4
- maxframe/lib/filesystem/tests/test_oss.py +1 -1
- maxframe/lib/functools_compat.py +1 -1
- maxframe/lib/mmh3.cp37-win32.pyd +0 -0
- maxframe/lib/mmh3.pyi +1 -1
- maxframe/lib/sparse/__init__.py +1 -1
- maxframe/lib/sparse/array.py +1 -1
- maxframe/lib/sparse/core.py +1 -1
- maxframe/lib/sparse/matrix.py +1 -1
- maxframe/lib/sparse/tests/__init__.py +1 -1
- maxframe/lib/sparse/tests/test_sparse.py +1 -1
- maxframe/lib/sparse/vector.py +1 -1
- maxframe/lib/tests/__init__.py +1 -1
- maxframe/lib/tests/test_wrapped_pickle.py +1 -1
- maxframe/lib/version.py +1 -1
- maxframe/lib/wrapped_pickle.py +1 -1
- maxframe/mixin.py +1 -1
- maxframe/opcodes.py +6 -1
- maxframe/protocol.py +1 -1
- maxframe/remote/__init__.py +1 -1
- maxframe/remote/core.py +1 -1
- maxframe/remote/run_script.py +1 -1
- maxframe/serialization/__init__.py +1 -1
- maxframe/serialization/arrow.py +1 -1
- maxframe/serialization/core.cp37-win32.pyd +0 -0
- maxframe/serialization/core.pxd +1 -1
- maxframe/serialization/core.pyi +1 -1
- maxframe/serialization/core.pyx +9 -6
- maxframe/serialization/exception.py +1 -1
- maxframe/serialization/maxframe_objects.py +1 -1
- maxframe/serialization/numpy.py +1 -1
- maxframe/serialization/pandas.py +1 -1
- maxframe/serialization/scipy.py +1 -1
- maxframe/serialization/serializables/__init__.py +1 -1
- maxframe/serialization/serializables/core.py +95 -90
- maxframe/serialization/serializables/field.py +1 -1
- maxframe/serialization/serializables/field_type.py +1 -1
- maxframe/serialization/serializables/tests/__init__.py +1 -1
- maxframe/serialization/serializables/tests/test_field_type.py +1 -1
- maxframe/serialization/serializables/tests/test_serializable.py +1 -1
- maxframe/serialization/tests/__init__.py +1 -1
- maxframe/serialization/tests/test_serial.py +21 -3
- maxframe/session.py +1 -1
- maxframe/tensor/__init__.py +1 -1
- maxframe/tensor/arithmetic/__init__.py +1 -1
- maxframe/tensor/arithmetic/abs.py +1 -1
- maxframe/tensor/arithmetic/absolute.py +1 -1
- maxframe/tensor/arithmetic/add.py +1 -1
- maxframe/tensor/arithmetic/angle.py +1 -1
- maxframe/tensor/arithmetic/arccos.py +1 -1
- maxframe/tensor/arithmetic/arccosh.py +1 -1
- maxframe/tensor/arithmetic/arcsin.py +1 -1
- maxframe/tensor/arithmetic/arcsinh.py +1 -1
- maxframe/tensor/arithmetic/arctan.py +1 -1
- maxframe/tensor/arithmetic/arctan2.py +1 -1
- maxframe/tensor/arithmetic/arctanh.py +1 -1
- maxframe/tensor/arithmetic/around.py +1 -1
- maxframe/tensor/arithmetic/bitand.py +1 -1
- maxframe/tensor/arithmetic/bitor.py +1 -1
- maxframe/tensor/arithmetic/bitxor.py +1 -1
- maxframe/tensor/arithmetic/cbrt.py +1 -1
- maxframe/tensor/arithmetic/ceil.py +1 -1
- maxframe/tensor/arithmetic/clip.py +1 -1
- maxframe/tensor/arithmetic/conj.py +1 -1
- maxframe/tensor/arithmetic/copysign.py +1 -1
- maxframe/tensor/arithmetic/core.py +1 -1
- maxframe/tensor/arithmetic/cos.py +1 -1
- maxframe/tensor/arithmetic/cosh.py +1 -1
- maxframe/tensor/arithmetic/deg2rad.py +1 -1
- maxframe/tensor/arithmetic/degrees.py +1 -1
- maxframe/tensor/arithmetic/divide.py +1 -1
- maxframe/tensor/arithmetic/equal.py +1 -1
- maxframe/tensor/arithmetic/exp.py +1 -1
- maxframe/tensor/arithmetic/exp2.py +1 -1
- maxframe/tensor/arithmetic/expm1.py +1 -1
- maxframe/tensor/arithmetic/fabs.py +1 -1
- maxframe/tensor/arithmetic/fix.py +1 -1
- maxframe/tensor/arithmetic/float_power.py +1 -1
- maxframe/tensor/arithmetic/floor.py +1 -1
- maxframe/tensor/arithmetic/floordiv.py +1 -1
- maxframe/tensor/arithmetic/fmax.py +1 -1
- maxframe/tensor/arithmetic/fmin.py +1 -1
- maxframe/tensor/arithmetic/fmod.py +1 -1
- maxframe/tensor/arithmetic/frexp.py +1 -1
- maxframe/tensor/arithmetic/greater.py +1 -1
- maxframe/tensor/arithmetic/greater_equal.py +1 -1
- maxframe/tensor/arithmetic/hypot.py +1 -1
- maxframe/tensor/arithmetic/i0.py +1 -1
- maxframe/tensor/arithmetic/imag.py +1 -1
- maxframe/tensor/arithmetic/invert.py +1 -1
- maxframe/tensor/arithmetic/isclose.py +1 -1
- maxframe/tensor/arithmetic/iscomplex.py +1 -1
- maxframe/tensor/arithmetic/isfinite.py +1 -1
- maxframe/tensor/arithmetic/isinf.py +1 -1
- maxframe/tensor/arithmetic/isnan.py +1 -1
- maxframe/tensor/arithmetic/isreal.py +1 -1
- maxframe/tensor/arithmetic/ldexp.py +1 -1
- maxframe/tensor/arithmetic/less.py +1 -1
- maxframe/tensor/arithmetic/less_equal.py +1 -1
- maxframe/tensor/arithmetic/log.py +1 -1
- maxframe/tensor/arithmetic/log10.py +1 -1
- maxframe/tensor/arithmetic/log1p.py +1 -1
- maxframe/tensor/arithmetic/log2.py +1 -1
- maxframe/tensor/arithmetic/logaddexp.py +1 -1
- maxframe/tensor/arithmetic/logaddexp2.py +1 -1
- maxframe/tensor/arithmetic/logical_and.py +1 -1
- maxframe/tensor/arithmetic/logical_not.py +1 -1
- maxframe/tensor/arithmetic/logical_or.py +1 -1
- maxframe/tensor/arithmetic/logical_xor.py +1 -1
- maxframe/tensor/arithmetic/lshift.py +1 -1
- maxframe/tensor/arithmetic/maximum.py +1 -1
- maxframe/tensor/arithmetic/minimum.py +1 -1
- maxframe/tensor/arithmetic/mod.py +1 -1
- maxframe/tensor/arithmetic/modf.py +1 -1
- maxframe/tensor/arithmetic/multiply.py +1 -1
- maxframe/tensor/arithmetic/nan_to_num.py +1 -1
- maxframe/tensor/arithmetic/negative.py +1 -1
- maxframe/tensor/arithmetic/nextafter.py +1 -1
- maxframe/tensor/arithmetic/not_equal.py +1 -1
- maxframe/tensor/arithmetic/positive.py +1 -1
- maxframe/tensor/arithmetic/power.py +1 -1
- maxframe/tensor/arithmetic/rad2deg.py +1 -1
- maxframe/tensor/arithmetic/radians.py +1 -1
- maxframe/tensor/arithmetic/real.py +1 -1
- maxframe/tensor/arithmetic/reciprocal.py +1 -1
- maxframe/tensor/arithmetic/rint.py +1 -1
- maxframe/tensor/arithmetic/rshift.py +1 -1
- maxframe/tensor/arithmetic/setimag.py +1 -1
- maxframe/tensor/arithmetic/setreal.py +1 -1
- maxframe/tensor/arithmetic/sign.py +1 -1
- maxframe/tensor/arithmetic/signbit.py +1 -1
- maxframe/tensor/arithmetic/sin.py +1 -1
- maxframe/tensor/arithmetic/sinc.py +1 -1
- maxframe/tensor/arithmetic/sinh.py +1 -1
- maxframe/tensor/arithmetic/spacing.py +1 -1
- maxframe/tensor/arithmetic/sqrt.py +1 -1
- maxframe/tensor/arithmetic/square.py +1 -1
- maxframe/tensor/arithmetic/subtract.py +1 -1
- maxframe/tensor/arithmetic/tan.py +1 -1
- maxframe/tensor/arithmetic/tanh.py +1 -1
- maxframe/tensor/arithmetic/tests/__init__.py +1 -1
- maxframe/tensor/arithmetic/tests/test_arithmetic.py +1 -1
- maxframe/tensor/arithmetic/truediv.py +1 -1
- maxframe/tensor/arithmetic/trunc.py +1 -1
- maxframe/tensor/arithmetic/utils.py +1 -1
- maxframe/tensor/array_utils.py +1 -1
- maxframe/tensor/core.py +1 -1
- maxframe/tensor/datasource/__init__.py +1 -1
- maxframe/tensor/datasource/arange.py +1 -1
- maxframe/tensor/datasource/array.py +1 -1
- maxframe/tensor/datasource/core.py +1 -1
- maxframe/tensor/datasource/empty.py +1 -1
- maxframe/tensor/datasource/from_dataframe.py +1 -1
- maxframe/tensor/datasource/from_dense.py +1 -1
- maxframe/tensor/datasource/from_sparse.py +1 -1
- maxframe/tensor/datasource/full.py +1 -1
- maxframe/tensor/datasource/ones.py +1 -1
- maxframe/tensor/datasource/scalar.py +1 -1
- maxframe/tensor/datasource/tests/__init__.py +1 -1
- maxframe/tensor/datasource/tests/test_datasource.py +1 -1
- maxframe/tensor/datasource/zeros.py +1 -1
- maxframe/tensor/fetch/__init__.py +1 -1
- maxframe/tensor/fetch/core.py +1 -1
- maxframe/tensor/indexing/__init__.py +1 -1
- maxframe/tensor/indexing/choose.py +1 -1
- maxframe/tensor/indexing/compress.py +1 -1
- maxframe/tensor/indexing/core.py +1 -1
- maxframe/tensor/indexing/extract.py +1 -1
- maxframe/tensor/indexing/fill_diagonal.py +1 -1
- maxframe/tensor/indexing/flatnonzero.py +1 -1
- maxframe/tensor/indexing/getitem.py +1 -1
- maxframe/tensor/indexing/nonzero.py +1 -1
- maxframe/tensor/indexing/setitem.py +1 -1
- maxframe/tensor/indexing/slice.py +1 -1
- maxframe/tensor/indexing/take.py +1 -1
- maxframe/tensor/indexing/tests/__init__.py +1 -1
- maxframe/tensor/indexing/tests/test_indexing.py +1 -1
- maxframe/tensor/indexing/unravel_index.py +1 -1
- maxframe/tensor/merge/__init__.py +1 -1
- maxframe/tensor/merge/concatenate.py +1 -1
- maxframe/tensor/merge/stack.py +1 -1
- maxframe/tensor/merge/tests/__init__.py +1 -1
- maxframe/tensor/merge/tests/test_merge.py +1 -1
- maxframe/tensor/merge/vstack.py +1 -1
- maxframe/tensor/misc/__init__.py +1 -1
- maxframe/tensor/misc/astype.py +1 -1
- maxframe/tensor/misc/atleast_1d.py +1 -1
- maxframe/tensor/misc/atleast_2d.py +1 -1
- maxframe/tensor/misc/atleast_3d.py +1 -1
- maxframe/tensor/misc/broadcast_to.py +1 -1
- maxframe/tensor/misc/ravel.py +1 -1
- maxframe/tensor/misc/tests/__init__.py +1 -1
- maxframe/tensor/misc/tests/test_misc.py +1 -1
- maxframe/tensor/misc/transpose.py +1 -1
- maxframe/tensor/misc/unique.py +1 -1
- maxframe/tensor/misc/where.py +1 -1
- maxframe/tensor/operators.py +1 -1
- maxframe/tensor/random/__init__.py +1 -1
- maxframe/tensor/random/beta.py +1 -1
- maxframe/tensor/random/binomial.py +1 -1
- maxframe/tensor/random/bytes.py +1 -1
- maxframe/tensor/random/chisquare.py +1 -1
- maxframe/tensor/random/choice.py +1 -1
- maxframe/tensor/random/core.py +1 -1
- maxframe/tensor/random/dirichlet.py +1 -1
- maxframe/tensor/random/exponential.py +1 -1
- maxframe/tensor/random/f.py +1 -1
- maxframe/tensor/random/gamma.py +1 -1
- maxframe/tensor/random/geometric.py +1 -1
- maxframe/tensor/random/gumbel.py +1 -1
- maxframe/tensor/random/hypergeometric.py +1 -1
- maxframe/tensor/random/laplace.py +1 -1
- maxframe/tensor/random/logistic.py +1 -1
- maxframe/tensor/random/lognormal.py +1 -1
- maxframe/tensor/random/logseries.py +1 -1
- maxframe/tensor/random/multinomial.py +1 -1
- maxframe/tensor/random/multivariate_normal.py +1 -1
- maxframe/tensor/random/negative_binomial.py +1 -1
- maxframe/tensor/random/noncentral_chisquare.py +1 -1
- maxframe/tensor/random/noncentral_f.py +1 -1
- maxframe/tensor/random/normal.py +1 -1
- maxframe/tensor/random/pareto.py +1 -1
- maxframe/tensor/random/permutation.py +1 -1
- maxframe/tensor/random/poisson.py +1 -1
- maxframe/tensor/random/power.py +1 -1
- maxframe/tensor/random/rand.py +1 -1
- maxframe/tensor/random/randint.py +1 -1
- maxframe/tensor/random/randn.py +1 -1
- maxframe/tensor/random/random_integers.py +1 -1
- maxframe/tensor/random/random_sample.py +1 -1
- maxframe/tensor/random/rayleigh.py +1 -1
- maxframe/tensor/random/shuffle.py +1 -1
- maxframe/tensor/random/standard_cauchy.py +1 -1
- maxframe/tensor/random/standard_exponential.py +1 -1
- maxframe/tensor/random/standard_gamma.py +1 -1
- maxframe/tensor/random/standard_normal.py +1 -1
- maxframe/tensor/random/standard_t.py +1 -1
- maxframe/tensor/random/tests/__init__.py +1 -1
- maxframe/tensor/random/tests/test_random.py +1 -1
- maxframe/tensor/random/triangular.py +1 -1
- maxframe/tensor/random/uniform.py +1 -1
- maxframe/tensor/random/vonmises.py +1 -1
- maxframe/tensor/random/wald.py +1 -1
- maxframe/tensor/random/weibull.py +1 -1
- maxframe/tensor/random/zipf.py +1 -1
- maxframe/tensor/rechunk/__init__.py +1 -1
- maxframe/tensor/rechunk/rechunk.py +1 -1
- maxframe/tensor/reduction/__init__.py +1 -1
- maxframe/tensor/reduction/all.py +1 -1
- maxframe/tensor/reduction/allclose.py +1 -1
- maxframe/tensor/reduction/any.py +1 -1
- maxframe/tensor/reduction/argmax.py +1 -1
- maxframe/tensor/reduction/argmin.py +1 -1
- maxframe/tensor/reduction/array_equal.py +1 -1
- maxframe/tensor/reduction/core.py +1 -1
- maxframe/tensor/reduction/count_nonzero.py +1 -1
- maxframe/tensor/reduction/cumprod.py +1 -1
- maxframe/tensor/reduction/cumsum.py +1 -1
- maxframe/tensor/reduction/max.py +1 -1
- maxframe/tensor/reduction/mean.py +1 -1
- maxframe/tensor/reduction/min.py +1 -1
- maxframe/tensor/reduction/nanargmax.py +1 -1
- maxframe/tensor/reduction/nanargmin.py +1 -1
- maxframe/tensor/reduction/nancumprod.py +1 -1
- maxframe/tensor/reduction/nancumsum.py +1 -1
- maxframe/tensor/reduction/nanmax.py +1 -1
- maxframe/tensor/reduction/nanmean.py +1 -1
- maxframe/tensor/reduction/nanmin.py +1 -1
- maxframe/tensor/reduction/nanprod.py +1 -1
- maxframe/tensor/reduction/nanstd.py +1 -1
- maxframe/tensor/reduction/nansum.py +1 -1
- maxframe/tensor/reduction/nanvar.py +1 -1
- maxframe/tensor/reduction/prod.py +1 -1
- maxframe/tensor/reduction/std.py +1 -1
- maxframe/tensor/reduction/sum.py +1 -1
- maxframe/tensor/reduction/tests/__init__.py +1 -1
- maxframe/tensor/reduction/tests/test_reduction.py +1 -1
- maxframe/tensor/reduction/var.py +1 -1
- maxframe/tensor/reshape/__init__.py +1 -1
- maxframe/tensor/reshape/reshape.py +1 -1
- maxframe/tensor/reshape/tests/__init__.py +1 -1
- maxframe/tensor/reshape/tests/test_reshape.py +1 -1
- maxframe/tensor/statistics/__init__.py +1 -1
- maxframe/tensor/statistics/percentile.py +1 -1
- maxframe/tensor/statistics/quantile.py +1 -1
- maxframe/tensor/ufunc/__init__.py +1 -1
- maxframe/tensor/ufunc/ufunc.py +1 -1
- maxframe/tensor/utils.py +1 -1
- maxframe/tests/__init__.py +1 -1
- maxframe/tests/test_codegen.py +1 -1
- maxframe/tests/test_protocol.py +1 -1
- maxframe/tests/test_utils.py +1 -1
- maxframe/tests/utils.py +1 -1
- maxframe/typing_.py +1 -1
- maxframe/udf.py +6 -1
- maxframe/utils.py +8 -1
- {maxframe-1.1.1.dist-info → maxframe-1.2.1.dist-info}/METADATA +1 -1
- maxframe-1.2.1.dist-info/RECORD +697 -0
- maxframe_client/__init__.py +1 -1
- maxframe_client/clients/__init__.py +1 -1
- maxframe_client/clients/framedriver.py +1 -1
- maxframe_client/conftest.py +1 -1
- maxframe_client/fetcher.py +1 -1
- maxframe_client/session/__init__.py +1 -1
- maxframe_client/session/consts.py +1 -1
- maxframe_client/session/graph.py +1 -1
- maxframe_client/session/odps.py +2 -1
- maxframe_client/session/task.py +1 -1
- maxframe_client/session/tests/__init__.py +1 -1
- maxframe_client/session/tests/test_task.py +1 -1
- maxframe_client/tests/__init__.py +1 -1
- maxframe_client/tests/test_fetcher.py +1 -1
- maxframe_client/tests/test_session.py +1 -1
- maxframe-1.1.1.dist-info/RECORD +0 -675
- {maxframe-1.1.1.dist-info → maxframe-1.2.1.dist-info}/WHEEL +0 -0
- {maxframe-1.1.1.dist-info → maxframe-1.2.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Copyright 1999-2025 Alibaba Group Holding Ltd.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import pandas as pd
|
|
16
|
+
import pytest
|
|
17
|
+
|
|
18
|
+
from .....core import OutputType
|
|
19
|
+
from ....datasource.series import from_pandas as from_pandas_series
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_datetime_method():
|
|
23
|
+
s = pd.Series(
|
|
24
|
+
[pd.Timestamp("2020-1-1"), pd.Timestamp("2020-2-1"), pd.Timestamp("2020-3-1")],
|
|
25
|
+
name="ss",
|
|
26
|
+
)
|
|
27
|
+
series = from_pandas_series(s, chunk_size=2)
|
|
28
|
+
|
|
29
|
+
r = series.dt.year
|
|
30
|
+
assert r.dtype == s.dt.year.dtype
|
|
31
|
+
pd.testing.assert_index_equal(r.index_value.to_pandas(), s.index)
|
|
32
|
+
assert r.shape == s.shape
|
|
33
|
+
assert r.op.output_types[0] == OutputType.series
|
|
34
|
+
assert r.name == s.dt.year.name
|
|
35
|
+
|
|
36
|
+
with pytest.raises(AttributeError):
|
|
37
|
+
_ = from_pandas_series(pd.Series([1])).dt
|
|
38
|
+
with pytest.raises(AttributeError):
|
|
39
|
+
_ = series.dt.non_exist
|
|
40
|
+
|
|
41
|
+
assert "ceil" in dir(series.dt)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Copyright 1999-2025 Alibaba Group Holding Ltd.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _install():
|
|
17
|
+
from ....core import CachedAccessor
|
|
18
|
+
from ...core import SERIES_TYPE
|
|
19
|
+
from .accessor import DictAccessor
|
|
20
|
+
from .contains import series_dict_contains
|
|
21
|
+
from .getitem import series_dict_getitem, series_dict_getitem_with_key_error
|
|
22
|
+
from .length import series_dict_length
|
|
23
|
+
from .remove import series_dict_remove
|
|
24
|
+
from .setitem import series_dict_setitem
|
|
25
|
+
|
|
26
|
+
dict_method_to_handlers = {
|
|
27
|
+
"__getitem__": series_dict_getitem_with_key_error,
|
|
28
|
+
"get": series_dict_getitem,
|
|
29
|
+
"__setitem__": series_dict_setitem,
|
|
30
|
+
"len": series_dict_length,
|
|
31
|
+
"remove": series_dict_remove,
|
|
32
|
+
"contains": series_dict_contains,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
for name, handler in dict_method_to_handlers.items():
|
|
36
|
+
DictAccessor._register(name, handler)
|
|
37
|
+
|
|
38
|
+
for series in SERIES_TYPE:
|
|
39
|
+
series.dict = CachedAccessor("dict", DictAccessor)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
_install()
|
|
43
|
+
del _install
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Copyright 1999-2025 Alibaba Group Holding Ltd.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
from typing import TYPE_CHECKING
|
|
15
|
+
|
|
16
|
+
import pandas as pd
|
|
17
|
+
import pyarrow as pa
|
|
18
|
+
|
|
19
|
+
from ....core import BaseMaxFrameAccessor
|
|
20
|
+
from ....utils import ARROW_DTYPE_NOT_SUPPORTED
|
|
21
|
+
|
|
22
|
+
if TYPE_CHECKING:
|
|
23
|
+
from ...core import Series
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class DictAccessor(BaseMaxFrameAccessor):
|
|
27
|
+
obj: "Series"
|
|
28
|
+
_api_count: int = 0
|
|
29
|
+
|
|
30
|
+
def __init__(self, series):
|
|
31
|
+
super().__init__(series)
|
|
32
|
+
if ARROW_DTYPE_NOT_SUPPORTED:
|
|
33
|
+
raise ImportError("pd.ArrowDtype is not supported in current environment")
|
|
34
|
+
|
|
35
|
+
if not isinstance(series.dtype, pd.ArrowDtype) or not isinstance(
|
|
36
|
+
series.dtype.pyarrow_dtype, pa.MapType
|
|
37
|
+
):
|
|
38
|
+
raise AttributeError("Can only use .dict accessor with dict values")
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Copyright 1999-2025 Alibaba Group Holding Ltd.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import pandas as pd
|
|
16
|
+
import pyarrow as pa
|
|
17
|
+
|
|
18
|
+
from .... import opcodes
|
|
19
|
+
from ....core.entity.output_types import OutputType
|
|
20
|
+
from ....serialization.serializables.field import AnyField
|
|
21
|
+
from ...operators import DataFrameOperator, DataFrameOperatorMixin
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class SeriesDictContainsOperator(DataFrameOperator, DataFrameOperatorMixin):
|
|
25
|
+
_op_type_ = opcodes.SERIES_DICT_CONTAINS
|
|
26
|
+
query_key = AnyField("query_key", default=None)
|
|
27
|
+
|
|
28
|
+
def __init__(self, **kw):
|
|
29
|
+
super().__init__(_output_types=[OutputType.series], **kw)
|
|
30
|
+
|
|
31
|
+
def __call__(self, series):
|
|
32
|
+
return self.new_series(
|
|
33
|
+
[series],
|
|
34
|
+
shape=series.shape,
|
|
35
|
+
dtype=pd.ArrowDtype(pa.bool_()),
|
|
36
|
+
index_value=series.index_value,
|
|
37
|
+
name=None,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def series_dict_contains(series, query_key):
|
|
42
|
+
"""
|
|
43
|
+
Check whether the key is in each dict of the Series.
|
|
44
|
+
|
|
45
|
+
Parameters
|
|
46
|
+
----------
|
|
47
|
+
query_key : Any
|
|
48
|
+
The key to check, must be in the same key type of the dict.
|
|
49
|
+
|
|
50
|
+
Returns
|
|
51
|
+
-------
|
|
52
|
+
Series :
|
|
53
|
+
A Series with data type ``pandas.ArrowDtype(pyarrow.bool_)``. The value will
|
|
54
|
+
be ``True`` if the key is in the dict, ``False`` otherwise, or ``None`` if the
|
|
55
|
+
dict is None.
|
|
56
|
+
|
|
57
|
+
Examples
|
|
58
|
+
--------
|
|
59
|
+
Create a series with dict type data.
|
|
60
|
+
|
|
61
|
+
>>> import maxframe.dataframe as md
|
|
62
|
+
>>> import pyarrow as pa
|
|
63
|
+
>>> from maxframe.lib.dtypes_extension import dict_
|
|
64
|
+
>>> s = md.Series(
|
|
65
|
+
... data=[[("k1", 1), ("k2", 2)], [("k1", 3)], None],
|
|
66
|
+
... index=[1, 2, 3],
|
|
67
|
+
... dtype=map_(pa.string(), pa.int64()),
|
|
68
|
+
... )
|
|
69
|
+
>>> s.execute()
|
|
70
|
+
1 [('k1', 1), ('k2', 2)]
|
|
71
|
+
2 [('k1', 3)]
|
|
72
|
+
3 <NA>
|
|
73
|
+
dtype: map<string, int64>[pyarrow]
|
|
74
|
+
|
|
75
|
+
>>> s.dict.contains("k2").execute()
|
|
76
|
+
1 True
|
|
77
|
+
2 False
|
|
78
|
+
3 <NA>
|
|
79
|
+
dtype: bool[pyarrow]
|
|
80
|
+
"""
|
|
81
|
+
return SeriesDictContainsOperator(query_key=query_key)(series)
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Copyright 1999-2025 Alibaba Group Holding Ltd.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import pandas as pd
|
|
16
|
+
|
|
17
|
+
from .... import opcodes
|
|
18
|
+
from ....core.entity.output_types import OutputType
|
|
19
|
+
from ....serialization.serializables.field import AnyField, BoolField
|
|
20
|
+
from ...operators import DataFrameOperator, DataFrameOperatorMixin
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class SeriesDictGetItemOperator(DataFrameOperator, DataFrameOperatorMixin):
|
|
24
|
+
_op_type_ = opcodes.SERIES_DICT_GETITEM
|
|
25
|
+
query_key = AnyField("query_key", default=None)
|
|
26
|
+
default_value = AnyField("default_value", default=None)
|
|
27
|
+
ignore_key_error = BoolField("ignore_key_error", default=False)
|
|
28
|
+
|
|
29
|
+
def __init__(self, **kw):
|
|
30
|
+
super().__init__(_output_types=[OutputType.series], **kw)
|
|
31
|
+
|
|
32
|
+
def __call__(self, series):
|
|
33
|
+
arrow_map_type = series.dtype.pyarrow_dtype
|
|
34
|
+
return self.new_series(
|
|
35
|
+
[series],
|
|
36
|
+
shape=series.shape,
|
|
37
|
+
dtype=pd.ArrowDtype(arrow_map_type.item_type),
|
|
38
|
+
index_value=series.index_value,
|
|
39
|
+
name=str(self.query_key),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def series_dict_getitem(series, query_key, default_value=None):
|
|
44
|
+
"""
|
|
45
|
+
Get the value by the key of each dict in the Series.
|
|
46
|
+
|
|
47
|
+
Parameters
|
|
48
|
+
----------
|
|
49
|
+
query_key : Any
|
|
50
|
+
The key to check, must be in the same key type of the dict.
|
|
51
|
+
default_value : Any, optional
|
|
52
|
+
The value to return if the key is not in the dict, by default None.
|
|
53
|
+
|
|
54
|
+
Returns
|
|
55
|
+
-------
|
|
56
|
+
Series :
|
|
57
|
+
A Series with the dict value's data type. The value will be ``default_value``
|
|
58
|
+
if the key is not in the dict, or ``None`` if the dict is None.
|
|
59
|
+
|
|
60
|
+
See Also
|
|
61
|
+
--------
|
|
62
|
+
Series.dict.__getitem__: Get the value by the key of each dict in the Series.
|
|
63
|
+
|
|
64
|
+
Examples
|
|
65
|
+
--------
|
|
66
|
+
Create a series with dict type data.
|
|
67
|
+
|
|
68
|
+
>>> import maxframe.dataframe as md
|
|
69
|
+
>>> import pyarrow as pa
|
|
70
|
+
>>> from maxframe.lib.dtypes_extension import dict_
|
|
71
|
+
>>> s = md.Series(
|
|
72
|
+
... data=[[("k1", 1), ("k2", 2)], [("k1", 3)], None],
|
|
73
|
+
... index=[1, 2, 3],
|
|
74
|
+
... dtype=dict_(pa.string(), pa.int64()),
|
|
75
|
+
... )
|
|
76
|
+
>>> s.execute()
|
|
77
|
+
1 [('k1', 1), ('k2', 2)]
|
|
78
|
+
2 [('k1', 3)]
|
|
79
|
+
3 <NA>
|
|
80
|
+
dtype: map<string, int64>[pyarrow]
|
|
81
|
+
|
|
82
|
+
>>> s.dict.get("k2", 9).execute()
|
|
83
|
+
1 2
|
|
84
|
+
2 9
|
|
85
|
+
3 <NA>
|
|
86
|
+
Name: k2, dtype: int64[pyarrow]
|
|
87
|
+
"""
|
|
88
|
+
return SeriesDictGetItemOperator(
|
|
89
|
+
query_key=query_key, default_value=default_value, ignore_key_error=True
|
|
90
|
+
)(series)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def series_dict_getitem_with_key_error(series, query_key):
|
|
94
|
+
"""
|
|
95
|
+
Get the value by the key of each dict in the Series. If the key is not in the dict,
|
|
96
|
+
raise KeyError.
|
|
97
|
+
|
|
98
|
+
Parameters
|
|
99
|
+
----------
|
|
100
|
+
query_key : Any
|
|
101
|
+
The key to check, must be in the same key type of the dict.
|
|
102
|
+
|
|
103
|
+
Returns
|
|
104
|
+
-------
|
|
105
|
+
Series :
|
|
106
|
+
A Series with the dict value's data type. Return ``None`` if the dict is None.
|
|
107
|
+
|
|
108
|
+
Raises
|
|
109
|
+
------
|
|
110
|
+
KeyError
|
|
111
|
+
If the key is not in one dict.
|
|
112
|
+
|
|
113
|
+
See Also
|
|
114
|
+
--------
|
|
115
|
+
Series.dict.get: Get the value by the key of each dict in the Series with an optional
|
|
116
|
+
default value.
|
|
117
|
+
|
|
118
|
+
Examples
|
|
119
|
+
--------
|
|
120
|
+
Create a series with dict type data.
|
|
121
|
+
|
|
122
|
+
>>> import maxframe.dataframe as md
|
|
123
|
+
>>> import pyarrow as pa
|
|
124
|
+
>>> from maxframe.lib.dtypes_extension import dict_
|
|
125
|
+
>>> s = md.Series(
|
|
126
|
+
... data=[[("k1", 1), ("k2", 2)], [("k1", 3)], None],
|
|
127
|
+
... index=[1, 2, 3],
|
|
128
|
+
... dtype=dict_(pa.string(), pa.int64()),
|
|
129
|
+
... )
|
|
130
|
+
>>> s.execute()
|
|
131
|
+
1 [('k1', 1), ('k2', 2)]
|
|
132
|
+
2 [('k1', 3)]
|
|
133
|
+
3 <NA>
|
|
134
|
+
dtype: map<string, int64>[pyarrow]
|
|
135
|
+
|
|
136
|
+
>>> s.dict["k1"].execute()
|
|
137
|
+
1 1
|
|
138
|
+
2 3
|
|
139
|
+
3 <NA>
|
|
140
|
+
Name: k1, dtype: int64[pyarrow]
|
|
141
|
+
"""
|
|
142
|
+
return SeriesDictGetItemOperator(
|
|
143
|
+
query_key=query_key, default_value=None, ignore_key_error=False
|
|
144
|
+
)(series)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Copyright 1999-2025 Alibaba Group Holding Ltd.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
import pandas as pd
|
|
15
|
+
import pyarrow as pa
|
|
16
|
+
|
|
17
|
+
from .... import opcodes
|
|
18
|
+
from ....core.entity.output_types import OutputType
|
|
19
|
+
from ...operators import DataFrameOperator, DataFrameOperatorMixin
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class SeriesDictLengthOperator(DataFrameOperator, DataFrameOperatorMixin):
|
|
23
|
+
_op_type_ = opcodes.SERIES_DICT_LENGTH
|
|
24
|
+
|
|
25
|
+
def __init__(self, **kw):
|
|
26
|
+
super().__init__(_output_types=[OutputType.series], **kw)
|
|
27
|
+
|
|
28
|
+
def __call__(self, series):
|
|
29
|
+
return self.new_series(
|
|
30
|
+
[series],
|
|
31
|
+
shape=series.shape,
|
|
32
|
+
index_value=series.index_value,
|
|
33
|
+
dtype=pd.ArrowDtype(pa.int64()),
|
|
34
|
+
name=None,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def series_dict_length(series):
|
|
39
|
+
"""
|
|
40
|
+
Get the length of each dict of the Series.
|
|
41
|
+
|
|
42
|
+
Returns
|
|
43
|
+
-------
|
|
44
|
+
Series :
|
|
45
|
+
A Series with data type ``pandas.ArrowDtype(pyarrow.int64)``. Each element
|
|
46
|
+
represents the length of the dict, or ``None`` if the dict is ``None``.
|
|
47
|
+
|
|
48
|
+
Examples
|
|
49
|
+
--------
|
|
50
|
+
Create a series with dict type data.
|
|
51
|
+
|
|
52
|
+
>>> import maxframe.dataframe as md
|
|
53
|
+
>>> import pyarrow as pa
|
|
54
|
+
>>> from maxframe.lib.dtypes_extension import dict_
|
|
55
|
+
>>> s = md.Series(
|
|
56
|
+
... data=[[("k1", 1), ("k2", 2)], [("k1", 3)], None],
|
|
57
|
+
... index=[1, 2, 3],
|
|
58
|
+
... dtype=map_(pa.string(), pa.int64()),
|
|
59
|
+
... )
|
|
60
|
+
>>> s.execute()
|
|
61
|
+
1 [('k1', 1), ('k2', 2)]
|
|
62
|
+
2 [('k1', 3)]
|
|
63
|
+
3 <NA>
|
|
64
|
+
dtype: map<string, int64>[pyarrow]
|
|
65
|
+
|
|
66
|
+
>>> s.dict.len().execute()
|
|
67
|
+
1 2
|
|
68
|
+
2 1
|
|
69
|
+
3 <NA>
|
|
70
|
+
dtype: int64[pyarrow]
|
|
71
|
+
"""
|
|
72
|
+
return SeriesDictLengthOperator()(series)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Copyright 1999-2025 Alibaba Group Holding Ltd.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from .... import opcodes
|
|
16
|
+
from ....core.entity.output_types import OutputType
|
|
17
|
+
from ....serialization.serializables.field import AnyField, BoolField
|
|
18
|
+
from ...operators import DataFrameOperator, DataFrameOperatorMixin
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class SeriesDictRemoveOperator(DataFrameOperator, DataFrameOperatorMixin):
|
|
22
|
+
_op_type_ = opcodes.SERIES_DICT_REMOVE
|
|
23
|
+
query_key = AnyField("query_key", default=None)
|
|
24
|
+
ignore_key_error = BoolField("ignore_key_error", default=False)
|
|
25
|
+
|
|
26
|
+
def __init__(self, **kw):
|
|
27
|
+
super().__init__(_output_types=[OutputType.series], **kw)
|
|
28
|
+
|
|
29
|
+
def __call__(self, series):
|
|
30
|
+
return self.new_series(
|
|
31
|
+
[series],
|
|
32
|
+
shape=series.shape,
|
|
33
|
+
index_value=series.index_value,
|
|
34
|
+
dtype=series.dtype,
|
|
35
|
+
name=series.name,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def series_dict_remove(series, query_key, ignore_key_error: bool = False):
|
|
40
|
+
"""
|
|
41
|
+
Remove the item by the key from each dict of the Series.
|
|
42
|
+
|
|
43
|
+
Parameters
|
|
44
|
+
----------
|
|
45
|
+
query_key : Any
|
|
46
|
+
The key to remove, must be in the same key type of the dict.
|
|
47
|
+
ignore_key_error : bool, optional, default False
|
|
48
|
+
When the ``query_key`` is not in the dict, if ``ignore_key_error`` is True,
|
|
49
|
+
nothing will happen in the dict. If ``ignore_key_error`` is ``False``, an
|
|
50
|
+
``KeyError`` will be raised. If the dict is ``None``, returns ``None``.
|
|
51
|
+
|
|
52
|
+
Returns
|
|
53
|
+
-------
|
|
54
|
+
Series :
|
|
55
|
+
A Series with the same data type. If the dict is ``None``.
|
|
56
|
+
Raises
|
|
57
|
+
-------
|
|
58
|
+
KeyError :
|
|
59
|
+
If the ``query_key`` is not in one dict and ``ignore_key_error`` is ``False``.
|
|
60
|
+
|
|
61
|
+
Examples
|
|
62
|
+
--------
|
|
63
|
+
Create a series with dict type data.
|
|
64
|
+
|
|
65
|
+
>>> import maxframe.dataframe as md
|
|
66
|
+
>>> import pyarrow as pa
|
|
67
|
+
>>> from maxframe.lib.dtypes_extension import dict_
|
|
68
|
+
>>> s = md.Series(
|
|
69
|
+
... data=[[("k1", 1), ("k2", 2)], [("k1", 3)], None],
|
|
70
|
+
... index=[1, 2, 3],
|
|
71
|
+
... dtype=map_(pa.string(), pa.int64()),
|
|
72
|
+
... )
|
|
73
|
+
>>> s.execute()
|
|
74
|
+
1 [('k1', 1), ('k2', 2)]
|
|
75
|
+
2 [('k1', 3)]
|
|
76
|
+
3 <NA>
|
|
77
|
+
dtype: map<string, int64>[pyarrow]
|
|
78
|
+
|
|
79
|
+
>>> s.dict.remove("k2", ignore_key_error=True).execute()
|
|
80
|
+
1 [('k1', 1)]
|
|
81
|
+
2 [('k1', 3)]
|
|
82
|
+
3 <NA>
|
|
83
|
+
dtype: map<string, int64>[pyarrow]
|
|
84
|
+
"""
|
|
85
|
+
return SeriesDictRemoveOperator(
|
|
86
|
+
query_key=query_key, ignore_key_error=ignore_key_error
|
|
87
|
+
)(series)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Copyright 1999-2025 Alibaba Group Holding Ltd.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
from .... import opcodes
|
|
15
|
+
from ....core.entity.output_types import OutputType
|
|
16
|
+
from ....serialization.serializables.field import AnyField
|
|
17
|
+
from ...core import TILEABLE_TYPE
|
|
18
|
+
from ...operators import DataFrameOperator, DataFrameOperatorMixin
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class SeriesDictSetItemOperator(DataFrameOperator, DataFrameOperatorMixin):
|
|
22
|
+
_op_type_ = opcodes.SERIES_DICT_SETITEM
|
|
23
|
+
query_key = AnyField("query_key", default=None)
|
|
24
|
+
value = AnyField("default_value", default=None)
|
|
25
|
+
|
|
26
|
+
def __init__(self, **kw):
|
|
27
|
+
super().__init__(_output_types=[OutputType.series], **kw)
|
|
28
|
+
|
|
29
|
+
def __call__(self, series):
|
|
30
|
+
new_series = self.new_series(
|
|
31
|
+
[series],
|
|
32
|
+
shape=series.shape,
|
|
33
|
+
index_value=series.index_value,
|
|
34
|
+
dtype=series.dtype,
|
|
35
|
+
name=series.name,
|
|
36
|
+
)
|
|
37
|
+
series.data = new_series.data
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def series_dict_setitem(series, query_key, value):
|
|
41
|
+
"""
|
|
42
|
+
Set the value with the key to each dict of the Series.
|
|
43
|
+
|
|
44
|
+
Parameters
|
|
45
|
+
----------
|
|
46
|
+
query_key : Any
|
|
47
|
+
The key of the value to set to, must be in the same key type of the dict.
|
|
48
|
+
value : Any
|
|
49
|
+
The value to set, must be in the same value type of the dict. If the ``query_key``
|
|
50
|
+
exists, the value will be replaced. Otherwise, the value will be added. A dict
|
|
51
|
+
will be skipped if it's ``None``.
|
|
52
|
+
|
|
53
|
+
Returns
|
|
54
|
+
-------
|
|
55
|
+
Series :
|
|
56
|
+
A Series with the same data type.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
Examples
|
|
60
|
+
--------
|
|
61
|
+
Create a series with dict type data.
|
|
62
|
+
|
|
63
|
+
>>> import maxframe.dataframe as md
|
|
64
|
+
>>> import pyarrow as pa
|
|
65
|
+
>>> from maxframe.lib.dtypes_extension import dict_
|
|
66
|
+
>>> s = md.Series(
|
|
67
|
+
... data=[[("k1", 1), ("k2", 2)], [("k1", 3)], None],
|
|
68
|
+
... index=[1, 2, 3],
|
|
69
|
+
... dtype=map_(pa.string(), pa.int64()),
|
|
70
|
+
... )
|
|
71
|
+
>>> s.execute()
|
|
72
|
+
1 [('k1', 1), ('k2', 2)]
|
|
73
|
+
2 [('k1', 3)]
|
|
74
|
+
3 <NA>
|
|
75
|
+
dtype: map<string, int64>[pyarrow]
|
|
76
|
+
|
|
77
|
+
>>> s.dict["k2"] = 4
|
|
78
|
+
>>> s.execute()
|
|
79
|
+
1 [('k1', 1), ('k2', 4)]
|
|
80
|
+
2 [('k1', 3), ('k2', 4)]
|
|
81
|
+
3 <NA>
|
|
82
|
+
dtype: map<string, int64>[pyarrow]
|
|
83
|
+
"""
|
|
84
|
+
if isinstance(value, TILEABLE_TYPE):
|
|
85
|
+
raise NotImplementedError(
|
|
86
|
+
"Set the value with a dataframe/series is not allowed yet"
|
|
87
|
+
)
|
|
88
|
+
return SeriesDictSetItemOperator(query_key=query_key, value=value)(series)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Copyright 1999-2025 Alibaba Group Holding Ltd.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|