[MCC-1501157] Python Lib - Use Error Handler, Document and Update Messages Across Studies, Connect, DataSets and Dataset_versions#34
Merged
Conversation
ibaig-mdsol
requested review from
afieraru-mdsol,
butsyk-mdsol,
dsilaghi-mdsol,
nmakarava-mdsol and
slingampalli-mdsol
May 20, 2026 21:52
There was a problem hiding this comment.
Pull request overview
This PR updates the Python DataConnect library’s error handling/normalization to provide more actionable, structured error messages (particularly around authentication/connectivity scenarios), and adjusts service-layer behavior for dataset-related endpoints.
Changes:
- Extended Arrow Flight Enodia error normalization to recognize additional failure cases and provide targeted guidance (e.g., hostname lookup failures).
- Adjusted error payload details to vary the reported “field” depending on the detected failure type.
- Removed client-side validation in
get_datasets()/get_dataset_versions()in favor of upstream validation (thoughget_datasets()now conflicts with existing expectations in the codebase).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
dataconnect/transport/arrow_flight/error_handler.py |
Expands/adjusts normalization of certain Arrow Flight error messages into structured SDK errors. |
dataconnect/service/default.py |
Removes some local input validation and updates docstrings around validation responsibility. |
Comments suppressed due to low confidence (1)
dataconnect/service/default.py:154
- Input validation for
study_environment_uuid,page, andpage_sizewas removed, but this method still assumes numericpage_sizelater (e.g.,total_pages = (total_records + page_size - 1) // page_size). With non-int or <=0 values this can now raiseTypeErroror produce invalid requests, and it also breaks the existing contract tested intests/test_get_datasets_paginated.py(which expectsValidationErroron invalid inputs). Reintroduce the validations (or provide equivalent type/range checks with consistentValidationErrors) before building the request body.
request = ResourceQuery(action=_ACTION_LIST_DATASETS).append_body(
{
"study_environment_uuid": str(study_environment_uuid),
"search_dataset_name": search_dataset_name,
"page": page,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
dataconnect/service/default.py:156
- Input validation for study_environment_uuid/page/page_size was removed, but the SDK has unit tests expecting ValidationError for invalid UUIDs and non-positive/non-int pagination values (see tests/test_get_datasets_paginated.py). Without these checks, invalid inputs will be sent to the transport and pagination metadata can contain invalid values. Either restore the local validations or update the contract/tests and ensure upstream errors are translated consistently.
request = ResourceQuery(action=_ACTION_LIST_DATASETS).append_body(
{
"study_environment_uuid": str(study_environment_uuid),
"search_dataset_name": search_dataset_name,
"page": page,
"page_size": page_size,
}
butsyk-mdsol
approved these changes
May 21, 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.
feature
Python LibMCC-1501157Checklist
git commit --amend --no-editcommand to reduce commit messages when making small file changes (like changing linespacing).tests/folder.doc/folder.Changes Summary
Added/Updated Error Handlers for:
Jupyter file:
MCC-1501157.ipynb
Screenshot
Errors Table
<style type="text/css"></style>