Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,10 +16,12 @@ model = genai.GenerativeModel('gemini-2.0-flash-thinking-exp')
|
|
| 16 |
def clean_column_name(col_name):
|
| 17 |
"""Clean column names to be compatible with Arrow"""
|
| 18 |
cleaned = re.sub(r"[^\w\s]", " ", str(col_name).lower())
|
| 19 |
-
|
| 20 |
# Preserve currency indicators
|
| 21 |
-
if "usd" in cleaned:
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
return cleaned
|
| 24 |
|
| 25 |
def clean_tin_value(val):
|
|
|
|
| 16 |
def clean_column_name(col_name):
|
| 17 |
"""Clean column names to be compatible with Arrow"""
|
| 18 |
cleaned = re.sub(r"[^\w\s]", " ", str(col_name).lower())
|
| 19 |
+
cleaned = re.sub(r"\s+", "_", cleaned.strip())
|
| 20 |
# Preserve currency indicators
|
| 21 |
+
if "usd" in cleaned:
|
| 22 |
+
return cleaned.replace("usd", "_usd")
|
| 23 |
+
if "zw" in cleaned:
|
| 24 |
+
return cleaned.replace("zw", "_zw")
|
| 25 |
return cleaned
|
| 26 |
|
| 27 |
def clean_tin_value(val):
|