Skip to content

feat(view): View object API#3338

Open
gabeiglio wants to merge 4 commits into
apache:mainfrom
gabeiglio:view-api
Open

feat(view): View object API#3338
gabeiglio wants to merge 4 commits into
apache:mainfrom
gabeiglio:view-api

Conversation

@gabeiglio
Copy link
Copy Markdown
Contributor

@gabeiglio gabeiglio commented May 8, 2026

Rationale for this change

Add view api to abstract away access to the metadata

Are these changes tested?

Yes, created tests/test_view.py

Are there any user-facing changes?

Yes, a new api is available for views

@gabeiglio gabeiglio marked this pull request as ready for review May 8, 2026 10:56
@gabeiglio gabeiglio changed the title View object API feat(view): View object API May 11, 2026
Copy link
Copy Markdown
Contributor

@rambleraptor rambleraptor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a couple of places where we use @property on Table. We should match those. It's a little awkward for the API to be table.properties and view.properties()

"""Get the version of this history view."""
return self.metadata.version_log

def properties(self) -> dict[str, str]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use @property to match Table.

"""Get the version of this view."""
return next(version for version in self.metadata.versions if version.version_id == self.metadata.current_version_id)

def versions(self) -> list[ViewVersion]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

2 participants