From b5b88cf77249b0fd2725883d1631737ee7983424 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 8 Aug 2025 13:59:40 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Add=20index=20column=20as=20regu?= =?UTF-8?q?lar=20column,=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes gh-63. --- src/mods4pandas/lib.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mods4pandas/lib.py b/src/mods4pandas/lib.py index 6e1005b..96644ed 100644 --- a/src/mods4pandas/lib.py +++ b/src/mods4pandas/lib.py @@ -423,6 +423,9 @@ def insert_into_db_multiple(con, table, ld: List[Dict]): def convert_db_to_parquet(con, table, index_col, output_file): df = pd.read_sql_query(f"SELECT * FROM {table}", con, index_col) + # Add index column as regular column, too + df[index_col] = df.index + # Convert Python column type into Pandas type for c in df.columns: column_type = current_columns_types[table][c]