Skip to content

fix: skip column-less empty views so an annotation-less dataset materializes and queries#6

Merged
aaronstevenwhite merged 2 commits into
mainfrom
fix/empty-view-parquet-schema
Jun 29, 2026
Merged

fix: skip column-less empty views so an annotation-less dataset materializes and queries#6
aaronstevenwhite merged 2 commits into
mainfrom
fix/empty-view-parquet-schema

Conversation

@aaronstevenwhite

Copy link
Copy Markdown
Contributor

Summary

Fix the Query tab crashing on any dataset without annotations. Found while running the indexation/exploration workflow against repo.layers.pub on 0.4.0: lairs materialize of a dataset with no annotation layers wrote an annotations.parquet with zero columns, and QueryEngine.open (the Query tab) then failed because DuckDB cannot read_parquet a column-less file:

_duckdb.InvalidInputException: Failed to read Parquet file '.../annotations.parquet':
Need at least one non-root column in the file

This blocked lairs tui --data (and the Query tab generally) for every UD treebank on repo.layers.pub, since their annotations are not forward-reachable from the corpus.

Changes

  • fix(store): skip column-less views in materialize. A view whose schema cannot be derived from its rows (an empty view) has no columns; materialize now skips it instead of writing a Parquet that readers reject.
  • fix(tui): harden QueryEngine.open. It now skips any Parquet it cannot register as a view (a column-less or otherwise unreadable file) and raises only when none are readable, so one empty view no longer fails the whole engine open. This also makes it robust to such files left by older materializations.
  • tests. Unit: materialize skips a column-less view (writes only the populated one); QueryEngine.open skips a 0-column Parquet and still queries the good view, and raises when none are readable. Live integration: an annotation-less corpus on the dockerized PDS materializes to an expressions view only and the Query engine opens and queries it.
  • release. 0.4.0 -> 0.4.1.

Verified live against repo.layers.pub: materialize <UD_Nayini> now writes only expressions.parquet, and QueryEngine.run_sql("SELECT id, text FROM expressions") returns its 10 sentences. tui --data opens.

Type of change

  • Bug fix (a non-breaking change that fixes an issue)
  • New feature
  • Breaking change
  • Documentation
  • Refactor, test, or chore

Checklist

  • uv run ruff format --check lairs tests passes
  • uv run ruff check lairs tests passes (including ANN401)
  • uv run ty check --error-on-warning passes
  • uv run pytest passes
  • uv run pytest --run-integration -m integration passes against the Docker test PDS
  • uv run --group docs mkdocs build --strict passes
  • Tests added or updated, mirrored 1:1 under tests/
  • CHANGELOG.md updated (a new ## [0.4.1] Fixed entry)
  • No @dataclass, pydantic, Any, or object annotation introduced; no em-dashes
  • Commits follow Conventional Commits, imperative mood, with no AI-assistant mentions

Related

No tracked issue. Found during live exploration of repo.layers.pub after the 0.4.0 release.

@aaronstevenwhite aaronstevenwhite merged commit 7b4bf30 into main Jun 29, 2026
2 checks passed
@aaronstevenwhite aaronstevenwhite deleted the fix/empty-view-parquet-schema branch June 29, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant