Chiusura fase di ristrutturazione e modularizzazione del workflow per favorire sviluppo modulare

This commit is contained in:
2026-08-24 13:32:20 +02:00
parent fa2298653b
commit 6062cb010e
96 changed files with 304 additions and 259 deletions
+3 -1
View File
@@ -5,10 +5,12 @@ from sqlalchemy import Engine
from tht.execute import (
ExecResult,
PlanSummary,
explain as _explain,
require_positive_int,
run_controlled,
)
from tht.execute import (
explain as _explain,
)
DEFAULT_TIMEOUT_MS = 30_000
+5 -3
View File
@@ -45,9 +45,11 @@ def fetch_chain_pem(host: str, port: int = 443, timeout: int = 30) -> list[str]:
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
try:
with socket.create_connection((host, port), timeout=timeout) as sock:
with ctx.wrap_socket(sock, server_hostname=host) as tls:
certs = _unverified_chain(tls)
with (
socket.create_connection((host, port), timeout=timeout) as sock,
ctx.wrap_socket(sock, server_hostname=host) as tls,
):
certs = _unverified_chain(tls)
except (OSError, ssl.SSLError) as e:
raise CaFetchError(
f"Impossibile connettersi a {host}:{port} per recuperare i certificati: {e}"
+3 -3
View File
@@ -92,7 +92,7 @@ def add_examples(engine: Engine, physical: PhysicalSchema, cfg: ExamplesConfig)
''')
try:
rows = conn.execute(q, {"lim": cfg.max_per_column}).fetchall()
except Exception as e: # colonna non leggibile: si salta, non si interrompe
except Exception as e: # noqa: BLE001 - skip any unreadable DWH column
logger.warning("Campionamento saltato per %s.%s: %s", table_name, column_name, e)
continue
column.examples = [str(r[0]) for r in rows]
@@ -164,7 +164,7 @@ def unique_values_for_lsh(
''')
try:
rows = conn.execute(q, {"lim": cfg.max_values_per_column}).fetchall()
except Exception as e:
except Exception as e: # noqa: BLE001 - skip any unreadable DWH column
skipped.append(SkippedColumn(table_name, column_name, f"errore: {e}"))
continue
vals = [str(r[0]) for r in rows]
@@ -205,7 +205,7 @@ def unique_values_for_lsh_rest(
rows = client.top_values(
schema, table_name, column_name, cfg.max_values_per_column
)
except Exception as e:
except Exception as e: # noqa: BLE001 - skip any unreadable REST column
skipped.append(SkippedColumn(table_name, column_name, f"errore: {e}"))
continue
vals = [str(r["value"]) for r in rows if r["value"] not in (None, "")]