Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: #9394

Closed
1 task done
TGoel29 opened this issue Jun 15, 2024 · 3 comments
Closed
1 task done

bug: #9394

TGoel29 opened this issue Jun 15, 2024 · 3 comments
Labels
bug Incorrect behavior inside of ibis

Comments

@TGoel29
Copy link

TGoel29 commented Jun 15, 2024

What happened?

Getting this error

File ~/Desktop/logistics/backend/.venv/lib/python3.11/site-packages/ibis/backends/pandas/executor.py:142, in PandasExecutor.visit(cls, op, **operands)
140 return cls.elementwise(func, **kwargs)
141 else:
--> 142 raise OperationNotDefinedError(
143 "No columnwise, serieswise, rowwise or elementwise "
144 f"implementation found for multi-argument operation {typ}"
145 )
146 else: # noqa: PLR5501
147 if func := cls.kernels.serieswise.get(typ):

OperationNotDefinedError: No columnwise, serieswise, rowwise or elementwise implementation found for multi-argument operation <class 'ibis.expr.operations.structs.StructColumn'>

What version of ibis are you using?

9.0.0

What backend(s) are you using, if any?

pandas

Relevant log output

def create_unpivot_table(df, columns_to_merge):
    # Connect to the Pandas DataFrame
    con = ibis.pandas.connect({"df": df})
    table = con.table("df")

    # Use pivot_longer to unpivot the table

    unpivot_table = table.pivot_longer(
        names_to="New Column (1)",
        values_to="New Column (2)",
        col=sel.where(lambda col: col.get_name() in columns_to_merge),
    ).execute()

    return unpivot_table

df = pd.DataFrame({
    "A": ["foo", "foo", "foo", "foo", "foo", "bar", "bar", "bar", "bar"],
    "B": ["one", "one", "one", "two", "two", "one", "one", "two", "two"],
    "C": ["small", "large", "large", "small", "small", "large", "small", "small", "large"],
    "D": [1, 2, 2, 3, 3, 4, 5, 6, 7],
    "E": [2, 4, 5, 5, 6, 6, 8, 9, 9]
})

create_unpivot_table(df, ["D", "E"])

File ~/Desktop/logistics/backend/.venv/lib/python3.11/site-packages/ibis/backends/pandas/executor.py:142, in PandasExecutor.visit(cls, op, **operands)
    140         return cls.elementwise(func, **kwargs)
    141     else:
--> 142         raise OperationNotDefinedError(
    143             "No columnwise, serieswise, rowwise or elementwise "
    144             f"implementation found for multi-argument operation {typ}"
    145         )
    146 else:  # noqa: PLR5501
    147     if func := cls.kernels.serieswise.get(typ):

OperationNotDefinedError: No columnwise, serieswise, rowwise or elementwise implementation found for multi-argument operation <class 'ibis.expr.operations.structs.StructColumn'>

Code of Conduct

  • I agree to follow this project's Code of Conduct
@TGoel29 TGoel29 added the bug Incorrect behavior inside of ibis label Jun 15, 2024
@cpcloud
Copy link
Member

cpcloud commented Jun 15, 2024

Can you use the duckdb backend instead?

This operation isn't implemented for the pandas backend and we aren't planning to do it anytime soon.

@TGoel29
Copy link
Author

TGoel29 commented Jun 15, 2024

Thanks @cpcloud for a quick turnaround

@TGoel29
Copy link
Author

TGoel29 commented Jun 15, 2024

Closing this for now.

@TGoel29 TGoel29 closed this as completed Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis
Projects
Archived in project
Development

No branches or pull requests

2 participants