Rr 114 expose metadata#119
Conversation
…114-expose-metadata
There was a problem hiding this comment.
Pull request overview
This PR adds support for exposing dataset/version metadata when fetching dataframes from the catalog, and introduces a new dependency to store metadata on Polars objects.
Changes:
- Add
with_metadataandprint_versionparameters toBlobEndpoint.get_dataframe()to optionally attach metadata and control version logging. - Add
polars-config-metaas a project dependency and lock it inuv.lock. - Introduce a new
resolve_version()helper intended to return resolved version/blob URL metadata.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
uv.lock |
Locks the new polars-config-meta dependency. |
pyproject.toml |
Adds polars-config-meta to runtime dependencies. |
cfa/dataops/catalog.py |
Adds metadata/printing options to get_dataframe and introduces resolve_version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…a-dataops into rr-114-expose-metadata
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
cfa/dataops/catalog.py:510
get_dataframe()calls_get_version_blobs()and then callsresolve_version(), which calls_get_version_blobs()again. This is both redundant and can be inconsistent if available versions change between calls; it also breaks ledger endpoints becauseresolve_version()may yieldblob_url=None. Derivefile_ext/fullpathdirectly from the already-fetchedversion_blobsinstead of re-resolving.
version_blobs, _ = self._get_version_blobs(
version_spec=version_spec, selection=selection, print_version=print_version
)
version_meta = self.resolve_version(
version_spec=version_spec, selection=selection
cfa/dataops/catalog.py:489
- The
get_dataframe()signature restrictsselectiontoLiteral["newest", "oldest"], but the docstring still mentions"all". This makes the public API docs inconsistent with the actual callable surface.
version_spec (str, optional): the version of the data to get.
Defaults to "latest".
selection (Literal["newest", "oldest", "all"], optional): whether to get the newest, oldest, or all matching versions. Defaults to "newest".
print_version (bool, optional): whether to print the version being used. Defaults to False.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
damonbayer
left a comment
There was a problem hiding this comment.
I'm pretty confused about _get_version_blobs. Left a comment.
…114-expose-metadata
…114-expose-metadata
| overwrite=False, | ||
| ) | ||
|
|
||
| def resolve_version( |
There was a problem hiding this comment.
This still needs to be added to the stubs.
damonbayer
left a comment
There was a problem hiding this comment.
Thanks so much @ryanraaschCDC!
No description provided.