Skip to content

Commit cc05ada

Browse files
Fix duplicate columns in parquet export (#484)
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
1 parent 6750053 commit cc05ada

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.changeset/funny-files-burn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trackio": patch
3+
---
4+
5+
feat:Fix duplicate columns in parquet export

trackio/sqlite_storage.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,8 @@ def _flatten_json_column(df: pd.DataFrame, col: str) -> pd.DataFrame:
294294
index=df.index,
295295
)
296296
df = df.drop(columns=[col])
297-
for c in expanded.columns:
298-
df[c] = expanded[c]
299-
return df
297+
expanded = expanded.loc[:, ~expanded.columns.isin(df.columns)]
298+
return pd.concat([df, expanded], axis=1)
300299

301300
@staticmethod
302301
def _read_table(db_path: Path, table: str) -> pd.DataFrame:

0 commit comments

Comments
 (0)