Skip to content

fix: Robin materializer empty schema edge case (#475)#485

Merged
eddiethedean merged 1 commit intov4.0.0from
fix/475-robin-empty-schema
Feb 12, 2026
Merged

fix: Robin materializer empty schema edge case (#475)#485
eddiethedean merged 1 commit intov4.0.0from
fix/475-robin-empty-schema

Conversation

@eddiethedean
Copy link
Owner

Summary

Fixes #475: handle empty schema in Robin materializer deterministically.

Changes

  • materializer.py: When schema.fields is empty:
    • If operations is empty: return data as list of rows (no-op), using _data_to_robin_rows(data, []) and wrapping in Row(..., schema=schema).
    • If operations is non-empty: raise a clear ValueError with message "Robin backend does not support empty schema when operations are applied; ensure at least one column."
  • test_robin_materializer.py: Add TestRobinMaterializerEmptySchema with:
    • test_empty_schema_no_operations_returns_rows: materialize([], StructType([]), []) returns [].
    • test_empty_schema_with_operations_raises: materialize([], StructType([]), [("limit", 5)]) raises ValueError matching "does not support empty schema when".

Made with Cursor

- When schema.fields is empty and operations is empty, return data as rows
  (no-op) instead of raising.
- When schema is empty but operations are present, raise a clear ValueError.
- Add TestRobinMaterializerEmptySchema with tests for both cases.

Co-authored-by: Cursor <cursoragent@cursor.com>
@eddiethedean eddiethedean merged commit fe3daec into v4.0.0 Feb 12, 2026
5 of 6 checks passed
@eddiethedean eddiethedean deleted the fix/475-robin-empty-schema branch February 12, 2026 16:12
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