evadb icon indicating copy to clipboard operation
evadb copied to clipboard

Python 3.8 'DataFrame' object has no attribute 'map'

Open xzdandy opened this issue 1 year ago • 1 comments

Search before asking

  • [X] I have searched the EvaDB issues and found no similar bug report.

Bug

evadb/executor/project_executor.py:49: in exec
    batch = apply_project(batch, self.target_list)
evadb/executor/executor_utils.py:69: in apply_project
    batches = [expr.evaluate(batch) for expr in project_list]
evadb/executor/executor_utils.py:69: in <listcomp>
    batches = [expr.evaluate(batch) for expr in project_list]
evadb/expression/function_expression.py:129: in evaluate
    outcomes = self._apply_function_expression(func, batch, **kwargs)
evadb/expression/function_expression.py:188: in _apply_function_expression
    return func_args.apply_function_expression(func)
evadb/models/storage/batch.py:174: in apply_function_expression
    return Batch(expr(self._frames))
evadb/functions/abstract/abstract_function.py:36: in __call__
    return self.forward(args[0])
evadb/functions/helpers/upper.py:37: in forward
    ret["output"] = df.map(lambda s: s.upper() if type(s) is str else s)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self =    input
0  EvaDB, name = 'map'

    def __getattr__(self, name: str):
        """
        After regular attribute access, try looking up the name
        This allows simpler access to columns for interactive use.
        """
        # Note: obj.x will always call obj.__getattribute__('x') prior to
        # calling obj.__getattr__('x').
        if (
            name not in self._internal_names_set
            and name not in self._metadata
            and name not in self._accessors
            and self._info_axis._can_hold_identifiers_and_holds_name(name)
        ):
            return self[name]
>       return object.__getattribute__(self, name)
E       AttributeError: 'DataFrame' object has no attribute 'map'

test_evadb/lib/python3.8/site-packages/pandas/core/generic.py:5989: AttributeError

Environment

https://app.circleci.com/pipelines/github/georgia-tech-db/evadb/6111/workflows/e8c13913-0f88-42f5-86a7-0dd9b61cda2f/jobs/44296

Are you willing to submit a PR?

  • [ ] Yes I'd like to help by submitting a PR!

xzdandy avatar Nov 17 '23 10:11 xzdandy

@gaurav274 @jarulraj Shall we support python 3.8?

DataFrame.map is available after panda 2.1.0. However, it turns that this is not possible with python 3.8. Check the https://app.circleci.com/pipelines/github/georgia-tech-db/evadb/6180/workflows/ca63c7b4-8873-45a5-a5c2-3db4d06bf973/jobs/44816

xzdandy avatar Nov 22 '23 00:11 xzdandy