Skip to content

refactor: change cardinality() method to property#6

Merged
rustyconover merged 5 commits into
mainfrom
cardinality-property
Jan 5, 2026
Merged

refactor: change cardinality() method to property#6
rustyconover merged 5 commits into
mainfrom
cardinality-property

Conversation

@rustyconover

Copy link
Copy Markdown
Contributor

Summary

  • Change cardinality() method to cardinality property for API consistency with output_schema
  • Both return immutable data, so consistent access patterns improve the API

Changes

  • vgi/table_function.py: Add @property decorator to cardinality
  • vgi/examples/table.py: Add @property to all cardinality overrides
  • vgi/examples/table_in_out.py: Add @property to all cardinality overrides
  • Tests: Update test overrides and call sites (.cardinality instead of .cardinality())
  • docs/generator-api.md: Update example to use @property

Test plan

  • All 529 tests pass
  • mypy type checking passes
  • ruff lint and format checks pass

Closes: vgi-python-bku

🤖 Generated with Claude Code

rustyconover and others added 5 commits January 4, 2026 20:07
Change cardinality from a method to a property for API consistency
with output_schema. Both return immutable data, so having consistent
access patterns improves the API.

Changes:
- vgi/table_function.py: Add @Property decorator to cardinality
- vgi/examples/table.py: Add @Property to all cardinality overrides
- vgi/examples/table_in_out.py: Add @Property to all cardinality overrides
- tests/: Update test overrides and call sites (.cardinality instead of .cardinality())
- docs/generator-api.md: Update example to use @Property

Closes: vgi-python-bku

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rustyconover rustyconover merged commit b88995a into main Jan 5, 2026
0 of 16 checks passed
@rustyconover rustyconover deleted the cardinality-property branch January 5, 2026 02:36
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