Skip to content

[MCC-1487221] - Error Handling#28

Merged
butsyk-mdsol merged 6 commits into
mainfrom
features/MCC-1487221-1
May 12, 2026
Merged

[MCC-1487221] - Error Handling#28
butsyk-mdsol merged 6 commits into
mainfrom
features/MCC-1487221-1

Conversation

@slingampalli-mdsol

Copy link
Copy Markdown
Contributor

[MCC-1487221] - Error Handling

Changes

  • Added error handling framework across layers
  • Commented all tests for later refactoring

Copilot AI review requested due to automatic review settings May 12, 2026 10:51

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.

Pull request overview

This PR introduces a new structured error-handling framework spanning the Arrow Flight transport layer, service layer, and public exception types, aiming to normalize server/SDK errors into consistent error_code/message/timestamp/details shapes.

Changes:

  • Added Arrow Flight exception parsing/normalization (parse_dataconnect_error) and updated transport to raise structured transport errors.
  • Added service-layer error translation (translate_error) and updated DefaultDataConnectService to use structured ValidationError for input validation.
  • Converted public exceptions to dataclasses and removed some previously exported exception types; all existing tests were commented out.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test_service.py Entire test module commented out (disables service behavior coverage).
tests/test_service_default.py Entire test module commented out (disables get_studies validation/request-body coverage).
tests/test_client.py Entire test module commented out (disables client delegation/connect/close coverage).
dataconnect/transport/errors.py Reworked transport errors into structured dataclasses with optional details.
dataconnect/transport/arrow_flight/transport.py Uses centralized error parser and raises structured validation errors for unsupported actions.
dataconnect/transport/arrow_flight/error_handler.py New: parses/normalizes Arrow Flight error messages into typed TransportError variants.
dataconnect/service/error_handler.py New: translates transport errors into public DataConnectError variants.
dataconnect/service/default.py Uses translate_error; adds structured input validation but changes/weakens validation in get_studies and inconsistently handles mapping errors.
dataconnect/exceptions.py Reworked public exceptions into structured dataclasses (introduces constructor/signature breaking changes).
dataconnect/init.py Removes ConnectionError/QueryError from public exports.
Comments suppressed due to low confidence (1)

dataconnect/service/default.py:44

  • Input validation for search_study_name is currently commented out. As a result, passing a non-string truthy value (e.g., 123) will raise AttributeError on .strip() before the try/except, leaking a raw exception instead of a ValidationError/DataConnectError. Please reinstate validate_search_study_name (or add an explicit type check) and ensure request-building is covered by error translation.
        # validate_search_study_name(search_study_name)

        request = ResourceQuery(action=_ACTION_LIST_STUDIES)
        if search_study_name and search_study_name.strip() != "":
            request = request.append_body({"search_study_name": search_study_name})

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_service.py Outdated
Comment thread tests/test_service_default.py
Comment thread tests/test_client.py
Comment thread dataconnect/service/default.py
Comment thread dataconnect/service/default.py
Comment thread dataconnect/exceptions.py
Comment thread dataconnect/service/error_handler.py
Comment thread dataconnect/__init__.py
@butsyk-mdsol
butsyk-mdsol merged commit 2839afb into main May 12, 2026
3 checks passed
@butsyk-mdsol
butsyk-mdsol deleted the features/MCC-1487221-1 branch May 12, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants