Skip to content

[MCC-1547223] Python SDK - Include R Dataset Properties in get_datasets Response - #62

Merged
dsilaghi-mdsol merged 2 commits into
mainfrom
feat/MCC-1547223-dataset-response-parity
Sep 9, 2026
Merged

[MCC-1547223] Python SDK - Include R Dataset Properties in get_datasets Response#62
dsilaghi-mdsol merged 2 commits into
mainfrom
feat/MCC-1547223-dataset-response-parity

Conversation

@dsilaghi-mdsol

@dsilaghi-mdsol dsilaghi-mdsol commented Sep 9, 2026

Copy link
Copy Markdown
Contributor
  • Python SDK - Include R Dataset Properties in get_datasets Response
  • MCC-1547223

Checklist

  • Review the pull request to fix typos and ensure variable/function names are intuitive, etc.
  • Make sure the pull request does not have excessive number of unnecessary commits. Utilize the git commit --amend --no-edit command to reduce commit messages when making small file changes (like changing linespacing).
  • Make sure you have added unit tests for the code changes. Tests should be added in the tests/ folder.
  • Modify docs, if required. Add any new documentation in the doc/ folder.
  • Rebase on latest active development branch (develop/main).

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:

  • Added dataset_short_name, type, source, activation_status, dataset_status, collection, last_updated, version, and other_versions to the Dataset model, preserving None/empty-string/empty-list distinctions exactly as returned by the server.
  • Added a lazy frame property (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.
  • Added focused unit tests covering the full 14-field metadata shape, independent pagination, null/empty value preservation, version-string formats, lazy frame semantics, copy/serialization safety, and a get_dataset_versions() regression check.
  • Updated readme/README-v1.1.0.md to document the new fields, null/empty handling, and lazy frame usage.

…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.
@dsilaghi-mdsol dsilaghi-mdsol self-assigned this Sep 9, 2026
@dsilaghi-mdsol dsilaghi-mdsol added enhancement New feature or request Needs Engineer Review python Pull requests that update python code Ready to Merge labels Sep 9, 2026
@dsilaghi-mdsol
dsilaghi-mdsol requested a lite review from Copilot September 9, 2026 12:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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 Dataset model with additional metadata fields and added a lazy frame accessor for on-demand .head() / .collect() retrieval.
  • Updated get_datasets() mapping to populate new metadata fields and attach DatasetFrame instances.
  • 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 a DatasetFrame whenever dataset.dataset_uuid is not None, but resource_to_dataset() defaults missing UUIDs to "". That means a dataset with a missing/empty UUID will still get a frame, and frame.head()/collect() will later raise ValueError when UUID("") 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.

Comment thread dataconnect/models.py
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)
@dsilaghi-mdsol
dsilaghi-mdsol merged commit acd753a into main Sep 9, 2026
4 checks passed
@dsilaghi-mdsol
dsilaghi-mdsol deleted the feat/MCC-1547223-dataset-response-parity branch September 9, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Needs Engineer Review python Pull requests that update python code Ready to Merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants