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>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
cfa/dataops/catalog.py:486
get_dataframe()calls_get_version_blobs()to resolve and validate the version (and derivefile_ext), but the non-lazy path then callsread_blobs(), which calls_get_version_blobs()again. This contradicts the "Fetch version blobs once" comment and can double Azure listings and introduce racey inconsistency if blobs change between calls.
# Fetch version blobs once and validate before deriving file extension.
version_blobs = self._get_version_blobs(
version_spec=version_spec, selection=selection, print_version=print_version
)
if not version_blobs:
raise ValueError(
f"No blobs found for version '{version_spec}' in container '{self.container}'."
)
damonbayer
left a comment
There was a problem hiding this comment.
Looking good, but a few changes requested. Thanks @ryanraaschCDC!
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:509
get_dataframe()calls_get_version_blobs()and then immediately callsresolve_version(), which internally calls_get_version_blobs()again. That duplicates the (potentially expensive) blob-walk/version resolution and contradicts the nearby comment about fetching blobs once; it also makesfile_extdepend on parsingblob_urlrather than the actual blob name.
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:487
- The
selectiondocstring still mentions"all", but this method’s signature restrictsselectiontoLiteral["newest", "oldest"]. This is misleading for users and for generated docs.
selection (Literal["newest", "oldest", "all"], optional): whether to get the newest, oldest, or all matching versions. Defaults to "newest".
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…a-dataops into rr-114-expose-metadata
No description provided.