Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Access to non-exist column in DF result in very unfriendly error msg #61

Open
@wenleix

Description

@wenleix

To reproduce:

import torcharrow as ta
df = ta.DataFrame({"a": [1, 2, 3]})

df["b"]

Output

>>> df["b"]
E20211112 13:52:55.454295 207011328 Exceptions.h:68] /Users/wxie/Code/torcharrow/csrc/velox/velox/velox/type/Type.cpp273getChildIdxindex.has_value()Field not found: bUSERINVALID_ARGUMENT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/wxie/Code/torcharrow/torcharrow/trace.py", line 98, in wrapped
    res = fn(*args, **kwargs)
  File "/Users/wxie/Code/torcharrow/torcharrow/icolumn.py", line 289, in __getitem__
    return self.get_column(arg)
  File "/Users/wxie/Code/torcharrow/torcharrow/velox_rt/dataframe_cpu.py", line 301, in get_column
    idx = self._data.type().get_child_idx(column)
RuntimeError: Exception: VeloxUserError
Error Source: USER
Error Code: INVALID_ARGUMENT
Reason: Field not found: b
Retriable: False
Expression: index.has_value()
Function: getChildIdx
File: /Users/wxie/Code/torcharrow/csrc/velox/velox/velox/type/Type.cpp
Line: 273
Stack trace:

Looks like we didn't check the existence of a column

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions