bugfix
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# ==============================================================================
|
||||
# brancheneinstufung.py - Firmen-Datenanreicherungs-Skript
|
||||
# Version 1.6.7
|
||||
# Version 1.7.0
|
||||
# Dieses Skript automatisiert die Anreicherung, Validierung und Standardisierung
|
||||
# von Unternehmensdaten in einem Google Sheet mittels Web Scraping und APIs.
|
||||
# Es beinhaltet auch Datenvorbereitung für ein ML-Modell.
|
||||
@@ -3384,10 +3384,28 @@ class DataProcessor:
|
||||
|
||||
for idx, row in enumerate(data_rows):
|
||||
row_num_in_sheet = idx + header_rows + 1
|
||||
if limit is not None and processed_rows_count >= limit: logging.info(f"Limit ({limit}) erreicht."); break
|
||||
max_needed_idx = max(col_indices.values()); if len(row) <= max_needed_idx: logging.debug(f"Zeile {row_num_in_sheet}: Übersprungen (Zeile zu kurz)."); continue
|
||||
|
||||
ts_ay_val = row[col_indices["SerpAPI Wiki Search Timestamp"]]; if ts_ay_val and ts_ay_val.strip(): skipped_timestamp_ay_count += 1; continue
|
||||
if limit is not None and processed_rows_count >= limit:
|
||||
logging.info(f"Limit ({limit}) für Suche erreicht.")
|
||||
break
|
||||
|
||||
# KORRIGIERTE ZEILEN: Trenne Zuweisung und If-Statement
|
||||
max_needed_idx = max(col_indices.values()) # Zuweisung auf eigener Zeile (z.B. 12 Leerzeichen eingerückt)
|
||||
if len(row) <= max_needed_idx: # If-Statement auf neuer Zeile (dieselbe Einrückung wie die Zuweisung darüber, z.B. 12 Leerzeichen)
|
||||
# Die folgenden Zeilen gehören zum If-Block und müssen weiter eingerückt sein (z.B. 16 Leerzeichen)
|
||||
logging.debug(f"Zeile {row_num_in_sheet}: Übersprungen (Zeile zu kurz).")
|
||||
continue # continue gehört unter das if
|
||||
|
||||
# Diese Zeilen gehören zum normalen Fluss der For-Schleife (z.B. 12 Leerzeichen)
|
||||
ts_ay_val = row[col_indices["SerpAPI Wiki Search Timestamp"]];
|
||||
if ts_ay_val and ts_ay_val.strip():
|
||||
skipped_timestamp_ay_count += 1
|
||||
continue # continue gehört zum if darüber
|
||||
|
||||
m_value = row[col_indices["Wiki URL"]];
|
||||
if m_value and str(m_value).strip().lower() not in ["k.a.", "kein artikel gefunden"]:
|
||||
skipped_m_filled_count += 1
|
||||
continue # continue gehört zum if darüber
|
||||
m_value = row[col_indices["Wiki URL"]]; if m_value and str(m_value).strip().lower() not in ["k.a.", "kein artikel gefunden"]: skipped_m_filled_count += 1; continue
|
||||
|
||||
umsatz_val_str = row[col_indices["CRM Umsatz"]]; ma_val_str = row[col_indices["CRM Anzahl Mitarbeiter"]]
|
||||
|
||||
Reference in New Issue
Block a user