Update app/mapper.py
Browse files- app/mapper.py +2 -1
app/mapper.py
CHANGED
|
@@ -45,7 +45,8 @@ def ensure_canonical_table(duck: duckdb.DuckDBPyConnection, df: pd.DataFrame) ->
|
|
| 45 |
""")
|
| 46 |
|
| 47 |
# Get existing columns (lowercase for comparison)
|
| 48 |
-
existing_cols_raw = duck.execute(f"PRAGMA table_info('{table_name}')").fetchall()
|
|
|
|
| 49 |
|
| 50 |
# ✅ BULLETPROOF: Add missing columns with safe name handling
|
| 51 |
for col in df.columns:
|
|
|
|
| 45 |
""")
|
| 46 |
|
| 47 |
# Get existing columns (lowercase for comparison)
|
| 48 |
+
existing_cols_raw = duck.execute(f"PRAGMA table_info('{table_name}')").fetchall()
|
| 49 |
+
existing_cols = {str(r[0]).lower() for r in existing_cols_raw}
|
| 50 |
|
| 51 |
# ✅ BULLETPROOF: Add missing columns with safe name handling
|
| 52 |
for col in df.columns:
|