aliyun / alibabacloud-odps-maxframe-client

Apache License 2.0
3 stars 1 forks source link

DataFrame.round result not equal to pandas #18

Open snowljs opened 1 week ago

snowljs commented 1 week ago
df = pd.DataFrame([(.21, .32), (.01, .67), (.66, .03), (.21, .18)],
                  columns=['dogs', 'cats'])
print(df.round(1))

df = md.DataFrame([(.21, .32), (.01, .67), (.66, .03), (.21, .18)],
                  columns=['dogs', 'cats'])
df.round(1).execute()

image

snowljs commented 6 days ago
s = md.Series([0.1, 1.3, 2.7])
s.round().execute()
File [/apsara/odps/KubeTempRoot/releasea/executor-releasea-142/MAXFRAME_TASK_default_2024-06-20-18-15-23-2916_1_11923_1/python/framedriver/maxframe_framedriver/mcsql_codegen/dataframe/projection_with_same_index.py:36](http://localhost:8888/apsara/odps/KubeTempRoot/releasea/executor-releasea-142/MAXFRAME_TASK_default_2024-06-20-18-15-23-2916_1_11923_1/python/framedriver/maxframe_framedriver/mcsql_codegen/dataframe/projection_with_same_index.py#line=35), in generate_code()

File [/apsara/odps/KubeTempRoot/releasea/executor-releasea-142/MAXFRAME_TASK_default_2024-06-20-18-15-23-2916_1_11923_1/python/framedriver/maxframe_framedriver/mcsql_codegen/dataframe/projection_with_same_index.py:122](http://localhost:8888/apsara/odps/KubeTempRoot/releasea/executor-releasea-142/MAXFRAME_TASK_default_2024-06-20-18-15-23-2916_1_11923_1/python/framedriver/maxframe_framedriver/mcsql_codegen/dataframe/projection_with_same_index.py#line=121), in generate_expression()

File [/apsara/odps/KubeTempRoot/releasea/executor-releasea-142/MAXFRAME_TASK_default_2024-06-20-18-15-23-2916_1_11923_1/python/framedriver/maxframe_framedriver/mcsql_codegen/dataframe/expression.py:205](http://localhost:8888/apsara/odps/KubeTempRoot/releasea/executor-releasea-142/MAXFRAME_TASK_default_2024-06-20-18-15-23-2916_1_11923_1/python/framedriver/maxframe_framedriver/mcsql_codegen/dataframe/expression.py#line=204), in generate_output_expressions()

File [~/Projcect/maxframe/core/maxframe/_utils.pyx:170](http://localhost:8888/lab/tree/~/Projcect/maxframe/core/maxframe/_utils.pyx#line=169), in maxframe._utils.TypeDispatcher.get_handler()
    168     self._lazy_handlers = dict()
    169 
--> 170 cpdef get_handler(self, object type_):
    171     try:
    172         return self._handlers[type_]

File [~/Projcect/maxframe/core/maxframe/_utils.pyx:194](http://localhost:8888/lab/tree/~/Projcect/maxframe/core/maxframe/_utils.pyx#line=193), in maxframe._utils.TypeDispatcher.get_handler()
    192                 self._inherit_handlers[type_] = handler
    193                 return handler
--> 194         raise KeyError(f'Cannot dispatch type {type_}')
    195 
    196 def __call__(self, object obj, *args, **kwargs):

KeyError: "Cannot dispatch type <class 'maxframe.dataframe.arithmetic.around.DataFrameAround'>"