Skip to content

feat: add xlsx support in clean layer#10

Merged
Gabrymi93 merged 1 commit intomainfrom
feat/xlsx
Mar 3, 2026
Merged

feat: add xlsx support in clean layer#10
Gabrymi93 merged 1 commit intomainfrom
feat/xlsx

Conversation

@Gabrymi93
Copy link
Copy Markdown
Member

Closes #9

Summary

Questa PR introduce un primo supporto .xlsx nel layer CLEAN.

La pipeline resta coerente:

  • RAW conserva il workbook originale
  • CLEAN legge direttamente il file Excel
  • MART non cambia

Scope

Supporto iniziale limitato e intenzionale:

  • solo .xlsx
  • nessun supporto .xls
  • nuova opzione clean.read.sheet_name
  • riuso di header, skip, columns, trim_whitespace

Scelte implementative

  • aggiunta di openpyxl come dipendenza runtime
  • estensione del riconoscimento input in CLEAN per .xlsx
  • lettura workbook via pandas.read_excel(..., engine=\"openpyxl\")
  • default al primo foglio se sheet_name non e' specificato
  • validazione dello schema esplicito quando clean.read.columns e' presente

Perche'

Il caso reale terna-domanda-22.xlsx mostrava bene il limite attuale:

  • il file originale e' Excel
  • per usare il toolkit era necessaria una conversione manuale a CSV

Con questa PR, il workbook puo' restare nel suo formato originale e il runtime gestisce la lettura nel punto giusto della pipeline.

Testing

Eseguito:

py -m pytest tests/test_clean_duckdb_read.py tests/test_clean_input_selection.py -q
py -m pytest -q

Esito:

  • test mirati: 28 passed
  • suite completa: 152 passed

Smoke reale eseguito con:

  • terna-domanda-22.xlsx

Esito:

  • run all: SUCCESS
  • validate all: SUCCESS
  • status: SUCCESS

Stress test reali aggiuntivi nel laboratorio locale:

  • case_11_civile_flussi_2014_2024
    • workbook con foglio Read me + foglio data
    • validazione utile di clean.read.sheet_name
  • case_12_consumi_gas_2023_2024_zona_climatica
    • workbook grande e multi-anno
    • validazione utile su volume reale senza conversione preventiva a CSV

Esito anche per questi due casi:

  • run all: SUCCESS
  • validate all: SUCCESS
  • status: SUCCESS
  • inspect paths: SUCCESS

Note

  • questa PR non introduce conversioni implicite in RAW
  • il supporto e' volutamente minimo e centrato su .xlsx
  • eventuali estensioni future (.xls, multi-sheet piu' avanzato, profiling Excel) restano fuori da questo scope

@Gabrymi93 Gabrymi93 added the enhancement New feature or request label Mar 3, 2026
@Gabrymi93 Gabrymi93 linked an issue Mar 3, 2026 that may be closed by this pull request
@github-project-automation github-project-automation bot moved this to Backlog in Open Board Mar 3, 2026
@Gabrymi93 Gabrymi93 merged commit 72ef3be into main Mar 3, 2026
5 checks passed
@Gabrymi93 Gabrymi93 deleted the feat/xlsx branch March 3, 2026 18:43
@github-project-automation github-project-automation bot moved this from Backlog to ✅ Completato in Open Board Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: ✅ Completato

Development

Successfully merging this pull request may close these issues.

Supportare .xlsx nel layer CLEAN mantenendo il workbook originale in RAW

1 participant