You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gives an error called Result::unwrap() on an Err value: ComputeError(ErrString("RecordBatch requires an equal number of fields and arrays"))
It seems joins would create duplicated column names, which is very weird behavior.
It would be great if join would automatically rename additional columns to xxx_right2, xxx_right3 etc?
Log output
thread '<unnamed>' panicked at /home/runner/work/polars/polars/crates/polars-arrow/src/record_batch.rs:27:47:
called `Result::unwrap()` on an `Err` value: ComputeError(ErrString("RecordBatch requires an equal number of fields and arrays"))stack backtrace: 0: rust_begin_unwind 1: core::panicking::panic_fmt 2: core::result::unwrap_failed 3: <polars_core::frame::RecordBatchIter as core::iter::traits::iterator::Iterator>::next 4: <core::iter::adapters::GenericShunt<I,R> as core::iter::traits::iterator::Iterator>::next 5: polars_python::dataframe::export::<impl polars_python::dataframe::PyDataFrame>::__pymethod_to_pandas__ 6: pyo3::impl_::trampoline::trampoline 7: polars_python::dataframe::export::_::__INVENTORY::trampoline 8: method_vectorcall_NOARGS at /usr/src/debug/python311/Python-3.11.11/Objects/descrobject.c:453:24 9: _PyObject_VectorcallTstate at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_call.h:92:11 10: PyObject_Vectorcall at /usr/src/debug/python311/Python-3.11.11/Objects/call.c:299:12 11: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:4769:0 12: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 13: _PyEval_Vector at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:6434 14: _PyObject_VectorcallTstate at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_call.h:92:11 15: method_vectorcall at /usr/src/debug/python311/Python-3.11.11/Objects/classobject.c:59 16: _PyVectorcall_Call at /usr/src/debug/python311/Python-3.11.11/Objects/call.c:257:24 17: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:5376:0 18: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 19: _PyEval_Vector at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:6434 20: PyEval_EvalCode at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:1148:0 21: builtin_exec_impl at /usr/src/debug/python311/Python-3.11.11/Python/bltinmodule.c:1077:0 22: builtin_exec at /usr/src/debug/python311/Python-3.11.11/Python/clinic/bltinmodule.c.h:465 23: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:5091:0 24: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 25: gen_send_ex2 at /usr/src/debug/python311/Python-3.11.11/Objects/genobject.c:219 26: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:2585:0 27: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 28: gen_send_ex2 at /usr/src/debug/python311/Python-3.11.11/Objects/genobject.c:219 29: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:2585:0 30: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Inc---------------------------------------------------------------------------PanicException Traceback (most recent call last)/tmp/ipykernel_774697/246086097.py in?()----> 1 df.to_pandas()~/.local/lib/python3.11/site-packages/polars/dataframe/frame.py in?(self, use_pyarrow_extension_array, **kwargs) 2431 return self._to_pandas_with_object_columns( 2432 use_pyarrow_extension_array=use_pyarrow_extension_array, **kwargs 2433 ) 2434 -> 2435 return self._to_pandas_without_object_columns( 2436 self, use_pyarrow_extension_array=use_pyarrow_extension_array, **kwargs 2437 )~/.local/lib/python3.11/site-packages/polars/dataframe/frame.py in?(self, df, use_pyarrow_extension_array, **kwargs) 2482 ) -> pd.DataFrame: 2483 if not df.width: # Empty dataframe, cannot infer schema from batches 2484 returnpd.DataFrame() 2485 -> 2486 record_batches = df._df.to_pandas() 2487 tbl = pa.Table.from_batches(record_batches) 2488 if use_pyarrow_extension_array: 2489 return tbl.to_pandas(PanicException: called `Result::unwrap()` on an `Err` value: ComputeError(ErrString("RecordBatch requires an equal number of fields and arrays"))lude/internal/pycore_ceval.h:73:16 31: gen_send_ex2 at /usr/src/debug/python311/Python-3.11.11/Objects/genobject.c:219 32: gen_send_ex at /usr/src/debug/python311/Python-3.11.11/Objects/genobject.c:287:0 33: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:5221:0 34: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 35: _PyEval_Vector at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:6434 36: _PyObject_VectorcallTstate at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_call.h:92:11 37: method_vectorcall at /usr/src/debug/python311/Python-3.11.11/Objects/classobject.c:59 38: _PyVectorcall_Call at /usr/src/debug/python311/Python-3.11.11/Objects/call.c:257:24 39: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:5376:0 40: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 41: gen_send_ex2 at /usr/src/debug/python311/Python-3.11.11/Objects/genobject.c:219 42: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:2585:0 43: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 44: gen_send_ex2 at /usr/src/debug/python311/Python-3.11.11/Objects/genobject.c:219 45: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:2585:0 46: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 47: gen_send_ex2 at /usr/src/debug/python311/Python-3.11.11/Objects/genobject.c:219 48: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:2585:0 49: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 50: gen_send_ex2 at /usr/src/debug/python311/Python-3.11.11/Objects/genobject.c:219 51: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:2585:0 52: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 53: gen_send_ex2 at /usr/src/debug/python311/Python-3.11.11/Objects/genobject.c:219 54: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:2585:0 55: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 56: gen_send_ex2 at /usr/src/debug/python311/Python-3.11.11/Objects/genobject.c:219 57: task_step_impl at /usr/src/debug/python311/Python-3.11.11/Modules/_asynciomodule.c:2693:22 58: task_step at /usr/src/debug/python311/Python-3.11.11/Modules/_asynciomodule.c:2993:11 59: cfunction_vectorcall_O at /usr/src/debug/python311/Python-3.11.11/Objects/methodobject.c:514:24 60: _PyObject_VectorcallTstate at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_call.h:92:11 61: context_run at /usr/src/debug/python311/Python-3.11.11/Python/context.c:673:29 62: cfunction_vectorcall_FASTCALL_KEYWORDS at /usr/src/debug/python311/Python-3.11.11/Objects/methodobject.c:443:24 63: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:5376:0 64: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 65: _PyEval_Vector at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:6434 66: PyEval_EvalCode at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:1148:0 67: builtin_exec_impl at /usr/src/debug/python311/Python-3.11.11/Python/bltinmodule.c:1077:0 68: builtin_exec at /usr/src/debug/python311/Python-3.11.11/Python/clinic/bltinmodule.c.h:465 69: cfunction_vectorcall_FASTCALL_KEYWORDS at /usr/src/debug/python311/Python-3.11.11/Objects/methodobject.c:443:24 70: _PyObject_VectorcallTstate at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_call.h:92:11 71: PyObject_Vectorcall at /usr/src/debug/python311/Python-3.11.11/Objects/call.c:299:12 72: _PyEval_EvalFrameDefault at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:4769:0 73: _PyEval_EvalFrame at /usr/src/debug/python311/Python-3.11.11/./Include/internal/pycore_ceval.h:73:16 74: _PyEval_Vector at /usr/src/debug/python311/Python-3.11.11/Python/ceval.c:6434 75: PyObject_Call at /usr/src/debug/python311/Python-3.11.11/Objects/call.c:355:12 76: pymain_run_module at /usr/src/debug/python311/Python-3.11.11/Modules/main.c:300 77: pymain_run_python at /usr/src/debug/python311/Python-3.11.11/Modules/main.c:599:0 78: Py_RunMain at /usr/src/debug/python311/Python-3.11.11/Modules/main.c:684 79: <unknown> 80: __libc_start_main 81: _startnote: Some details are omitted, run with `RUST_BACKTRACE=full`for a verbose backtrace.
Checks
Reproducible example
When df has duplicated column names, to_pandas failed
gives an error called
Result::unwrap()
on anErr
value: ComputeError(ErrString("RecordBatch requires an equal number of fields and arrays"))It seems joins would create duplicated column names, which is very weird behavior.
It would be great if join would automatically rename additional columns to xxx_right2, xxx_right3 etc?
Log output
Issue description
As described above
Expected behavior
Should complete without error
Installed versions
The text was updated successfully, but these errors were encountered: