Update app.py
Browse files
app.py
CHANGED
|
@@ -59,10 +59,11 @@ def get_active_csv_path():
|
|
| 59 |
return DEFAULT_CSV_PATH
|
| 60 |
|
| 61 |
def create_engine_and_load_db(csv_path, sql_db_path):
|
| 62 |
-
print(csv_path.dtypes)
|
| 63 |
logging.info(f"[ENGINE] Criando engine com CSV: {csv_path}")
|
| 64 |
engine = create_engine(f"sqlite:///{sql_db_path}")
|
| 65 |
df = pd.read_csv(csv_path, sep=";", on_bad_lines="skip")
|
|
|
|
|
|
|
| 66 |
df.to_sql("tabela", engine, index=False, if_exists="replace")
|
| 67 |
logging.info(f"[ENGINE] Banco criado com sucesso com {len(df)} linhas e {len(df.columns)} colunas")
|
| 68 |
|
|
|
|
| 59 |
return DEFAULT_CSV_PATH
|
| 60 |
|
| 61 |
def create_engine_and_load_db(csv_path, sql_db_path):
|
|
|
|
| 62 |
logging.info(f"[ENGINE] Criando engine com CSV: {csv_path}")
|
| 63 |
engine = create_engine(f"sqlite:///{sql_db_path}")
|
| 64 |
df = pd.read_csv(csv_path, sep=";", on_bad_lines="skip")
|
| 65 |
+
print("[DEBUG] Tipos das colunas:")
|
| 66 |
+
print(df.dtypes)
|
| 67 |
df.to_sql("tabela", engine, index=False, if_exists="replace")
|
| 68 |
logging.info(f"[ENGINE] Banco criado com sucesso com {len(df)} linhas e {len(df.columns)} colunas")
|
| 69 |
|