-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: from_dataframe with empty objects #53161
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
Conversation
@@ -79,7 +79,9 @@ def _from_dataframe(df: DataFrameXchg, allow_copy: bool = True): | |||
raise RuntimeError( | |||
"To join chunks a copy is required which is forbidden by allow_copy=False" | |||
) | |||
if len(pandas_dfs) == 1: | |||
if not pandas_dfs: | |||
pandas_df = pd.DataFrame({col: [] for col in df.column_names()}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we care about the dtype(s)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Using protocol_df_chunk_to_pandas
here will preserve the dtypes
Going to merge, but happy to address any followups. |
* BUG: from_dataframe with empty objects * Use protocol_df_chunk_to_pandas
* BUG: from_dataframe with empty objects * Use protocol_df_chunk_to_pandas
* BUG: from_dataframe with empty objects * Use protocol_df_chunk_to_pandas
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.