Skip to content

Add FetchXML query support to Dataverse client - #131

Open
maksii wants to merge 9 commits into
microsoft:mainfrom
maksii:feature/fetchxml
Open

maksii wants to merge 9 commits into
microsoft:mainfrom
maksii:feature/fetchxml

Conversation

@maksii

@maksii maksii commented Feb 28, 2026

Copy link
Copy Markdown
  • Introduced fetchxml method in QueryOperations for executing FetchXML queries with automatic paging.
  • Added validation for FetchXML input, including checks for string type, non-empty content, and proper structure.
  • Implemented FetchXML query extraction logic in _ODataClient to ensure valid entity extraction.
  • Updated documentation in README and SKILL.md to include FetchXML usage examples.
  • Added unit tests for FetchXML functionality, covering basic queries, pagination, and validation errors.

This enhancement allows users to leverage FetchXML for more complex queries within the Dataverse client.

- Introduced `fetchxml` method in `QueryOperations` for executing FetchXML queries with automatic paging.
- Added validation for FetchXML input, including checks for string type, non-empty content, and proper structure.
- Implemented FetchXML query extraction logic in `_ODataClient` to ensure valid entity extraction.
- Updated documentation in README and SKILL.md to include FetchXML usage examples.
- Added unit tests for FetchXML functionality, covering basic queries, pagination, and validation errors.

This enhancement allows users to leverage FetchXML for more complex queries within the Dataverse client.
- Updated the page_size validation to raise a ValidationError for boolean values, ensuring only integers are accepted.
- Added unit tests to cover scenarios where boolean values are passed as page_size, confirming appropriate error handling for both True and False values.
- Introduced additional tests for handling incorrect entity names and attribute names in FetchXML queries, ensuring robust error propagation for various edge cases.
@maksii
maksii requested a review from a team as a code owner February 28, 2026 07:12
@maksii

maksii commented Feb 28, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI review requested due to automatic review settings March 7, 2026 18:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class FetchXML query execution to the Dataverse client, enabling users to run FetchXML via client.query.fetchxml() with automatic paging-cookie handling and validation.

Changes:

  • Introduces QueryOperations.fetchxml() API and corresponding _ODataClient._query_fetchxml() implementation (validation, entity extraction, paging loop).
  • Adds new validation error subcodes for FetchXML.
  • Updates docs (README + SKILL) and adds unit tests for FetchXML parsing/validation/paging.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/PowerPlatform/Dataverse/operations/query.py Adds QueryOperations.fetchxml() public API wrapper.
src/PowerPlatform/Dataverse/data/_odata.py Implements FetchXML parsing/entity extraction, validation, and paging-cookie loop.
src/PowerPlatform/Dataverse/core/_error_codes.py Adds FetchXML-related validation subcodes.
tests/unit/test_query_operations.py Adds unit tests for client.query.fetchxml() wrapper behavior.
tests/unit/data/test_fetchxml.py Adds unit tests for _ODataClient._extract_entity_from_fetchxml and _query_fetchxml() validation/paging.
README.md Documents FetchXML usage and limitations.
.claude/skills/dataverse-sdk-use/SKILL.md Adds FetchXML usage examples for the SDK skill doc.

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

Comment thread tests/unit/test_query_operations.py Resolved
Comment thread tests/unit/data/test_fetchxml.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


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

Comment thread README.md Resolved
maksii added 2 commits March 23, 2026 22:08
# Conflicts:
#	README.md
#	tests/unit/test_query_operations.py
Resolve import conflict in _odata.py: keep both FetchXML validation
error codes from feature branch and VALIDATION_UNSUPPORTED_COLUMN_TYPE
from upstream.

Made-with: Cursor
@AlexandreIntelcom

Copy link
Copy Markdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants