[MCC-1547223] Python SDK - Include R Dataset Properties in get_datasets Response - #62
Merged
Merged
Conversation
…ts response Preserve nullable metadata and empty collections, attach lazy frames through existing fetch_data, and retain per-page listing and dataset-version behavior. TDD: baseline 186 passed / 1 unrelated logging-header failure; new regression tests failed before implementation; final focused suite 24 passed, full suite 203 passed / same baseline failure. Ruff and pre-commit pass. Mypy has the same three transport errors as the baseline commit.
There was a problem hiding this comment.
🟡 Changes recommended
get_datasets() can attach a DatasetFrame for missing/empty dataset UUIDs (due to mapper defaults), which can later fail at runtime when the frame is used.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Extends the Python SDK dataset-listing surface area to match the R SDK by returning additional dataset metadata fields from get_datasets() and introducing a lazy, on-demand row retrieval handle (DatasetFrame) on each Dataset.
Changes:
- Expanded
Datasetmodel with additional metadata fields and added a lazyframeaccessor for on-demand.head()/.collect()retrieval. - Updated
get_datasets()mapping to populate new metadata fields and attachDatasetFrameinstances. - Added/extended tests and updated README documentation to cover the new response shape and lazy frame semantics.
File summaries
| File | Description |
|---|---|
dataconnect/models.py |
Adds DatasetFrame and extends Dataset with additional metadata fields plus the new frame field. |
dataconnect/service/mappers.py |
Maps additional dataset metadata fields from transport tickets into the Dataset model. |
dataconnect/service/default.py |
Attaches a DatasetFrame to datasets returned from get_datasets() for lazy row fetching. |
tests/test_get_datasets_paginated.py |
Adds unit tests covering new metadata fields, null/empty preservation, and lazy frame behavior across pages. |
readme/README-v1.1.0.md |
Documents updated get_datasets() output shape, new dataset metadata fields, and lazy frame usage guidance. |
Review details
Suppressed comments (1)
dataconnect/service/default.py:162
get_datasets()attaches aDatasetFramewheneverdataset.dataset_uuid is not None, butresource_to_dataset()defaults missing UUIDs to"". That means a dataset with a missing/empty UUID will still get aframe, andframe.head()/collect()will later raiseValueErrorwhenUUID("")is attempted. Consider only attaching a frame when the UUID is present and parseable.
search_dataset_name: Full or partial dataset name filter.
page: Page number for paginated results.
page_size: Number of results per page.
Returns:
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| last_updated: str | None = None | ||
| version: str | None = None | ||
| other_versions: list[dict[str, str]] | None = field(default=None, hash=False) | ||
| frame: DatasetFrame | None = field(default=None, repr=False, compare=False) |
abutsyk-mdsol
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_datasetsResponseMCC-1547223Checklist
git commit --amend --no-editcommand to reduce commit messages when making small file changes (like changing linespacing).tests/folder.doc/folder.Changes Summary
get_datasets()now returns the full set of dataset properties already exposed by the R SDK, without changing pagination or existing retrieval behavior:dataset_short_name,type,source,activation_status,dataset_status,collection,last_updated,version, andother_versionsto theDatasetmodel, preservingNone/empty-string/empty-list distinctions exactly as returned by the server.frameproperty (DatasetFrame) exposing.head(n)and.collect()for on-demand row retrieval, mirroring the R SDK's dataset reference without eagerly fetching data.get_dataset_versions()behavior and response shape are unchanged.get_dataset_versions()regression check.readme/README-v1.1.0.mdto document the new fields, null/empty handling, and lazy frame usage.