Skip to content

feat(business-contract): parse Tables + Columns workbook with cell-level errors #1450

Open

Description

@malon64

Parent #1449; depends on approved template #1448. Floe 1.1.

Context

One workbook/domain, two data sheets Tables and Columns plus instructional Guide, no Rules sheet. Use existing optional fastexcel (xlsx extra); src/floe/read/xlsx.py is an ingestion data reader, not the contract-importer parser.

Scope

  • Implement read-only workbook parsing into typed in-memory domain, table records, ordered column records, and Excel cell provenance.
  • Parse the v5 English headers exactly as in docs(business-contract): English three-tab domain Excel template, keys before quality #1448, including the three visual groups (group rows must not be mistaken for table headers).
  • Parse X/blank flags: primary_key, unique, not_null; string unique_group identifiers; FK target references; optional min/max/allowed_values/pattern and severity fields; source_column optional, target_type required.
  • Read Guide domain/version/default severity or an explicitly documented equivalent header; do not evaluate arbitrary formulas/macros. Allow worksheet reordering; ignore wholly blank data rows.
  • Validate unique table_id within domain and unique (table_id, target_column), safe file identifiers, source and output name collisions, blank required cells, invalid X values, unknown table references, missing/partial FK metadata and invalid/inconsistent group labels. When an FK points to a table inside the same workbook, validate its target column as metadata only. Cross-domain/external FK references are allowed but unresolved (warn/document rather than reject); do not imply runtime RI checks.
  • Keep table and column order stable; aggregate independent errors where possible; report sheet+Excel row+column, e.g. Columns!C248.
  • No requirement for any source.path, catalog, sink format, partition or technical project config before parsing.

Acceptance

  • Correctly reads three sheets and validates only the two data sheets.
  • Missing Rules worksheet is NOT an error; a Rules worksheet is not used.
  • Can express different source_dataset vs target_table, and source_column vs target_column.
  • Supports repeated field names across unrelated tables, composite PK and unique groups, FK metadata and severity inheritance.
  • Invalid/duplicate/missing headers, refs, flags or key group declarations have precise cell diagnostics and stop before output.
  • Real XLSX fixtures (not mocked dicts only), consistent deterministic records; no new dependency/config YAML keys.

Tests first

test_missing_tables_sheet, test_rejects_unknown_table_id_with_cell_location, test_preserves_composite_pk_column_order, test_reads_unique_group_and_fk_metadata, test_rejects_duplicate_target_column, test_parse_without_technical_configuration.

Stay within AGENTS.md limits; split structural validation from I/O if too large.

Activity

  1. added this to the Floe 1.1 milestone on Nov 23, 2026
  2. changed the title [-]feat(business-contract): read domain workbooks and validate table/column references[/-] [+]feat(business-contract): parse Tables + Columns workbook with cell-level errors[/+] on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions