Skip to content

Commit

Permalink
fix: fix error about schema is not writable pd to pa (#3109)
Browse files Browse the repository at this point in the history
Fix bug : #3108

Co-authored-by: Lei Xu <[email protected]>
  • Loading branch information
Jay-ju and eddyxu authored Nov 15, 2024
1 parent f257489 commit aa49421
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/python/lance/ray/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ def _pd_to_arrow(
return pa.Table.from_pydict(df, schema=schema)
if _PANDAS_AVAILABLE and isinstance(df, pd.DataFrame):
tbl = pa.Table.from_pandas(df, schema=schema)
tbl.schema = tbl.schema.remove_metadata()
return tbl
new_schema = tbl.schema.remove_metadata()
new_table = tbl.replace_schema_metadata(new_schema.metadata)
return new_table
return df


Expand Down

0 comments on commit aa49421

Please sign in to comment.