Sql guardrails, Improve error handling, fix precision defaults for float attribute#185
Open
sagebree wants to merge 4 commits into
Open
Sql guardrails, Improve error handling, fix precision defaults for float attribute#185sagebree wants to merge 4 commits into
sagebree wants to merge 4 commits into
Conversation
Contributor
sagebree
commented
May 28, 2026
- SQL guardrails — block statement stacking and writes hidden by comments, string literals, or zero-width prefixes
- DataFrame MultiIndex columns rejected up-front with a flatten hint instead of producing tuple keys that fail deep in the JSON encoder
- records.get() deprecation warning now names both migration paths (retrieve() for single-by-ID and list(filter=...) for filtered queries)
- Server error.innererror.message appended to HttpError.message on both single-request and batch paths, so the offending field/dtype reaches users without inspecting the wire payload
- "float"/"double" shorthand precision default raised from 2 to 5 (max for DoubleAttributeMetadata.Precision) so values like 2.718 round-trip without silent truncation; decimal/money left at 2
… messages for better debugging; update precision defaults for float attributes; add tests for innererror handling and MultiIndex DataFrames.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens Dataverse client validation and improves user-facing diagnostics around SQL safety, pandas DataFrame conversion, deprecated record retrieval, and server error messages.
Changes:
- Adds SQL guardrails for stacked statements, comment-hidden writes, string-literal masking, and zero-width-prefixed write keywords.
- Improves error messages for pandas MultiIndex columns and Dataverse
innererror.messagepayloads. - Updates
records.get()deprecation guidance and changes float/double metadata precision defaults from 2 to 5.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/PowerPlatform/Dataverse/utils/_pandas.py |
Rejects MultiIndex DataFrame columns before record conversion. |
src/PowerPlatform/Dataverse/operations/records.py |
Expands records.get() deprecation warning with retrieve/list migration paths. |
src/PowerPlatform/Dataverse/data/_odata.py |
Appends nested Dataverse inner error details to HttpError messages. |
src/PowerPlatform/Dataverse/data/_odata_base.py |
Updates float precision default and strengthens SQL guardrails. |
src/PowerPlatform/Dataverse/data/_batch_base.py |
Appends nested inner error details for top-level batch failures. |
tests/unit/test_pandas_helpers.py |
Adds MultiIndex rejection coverage. |
tests/unit/data/test_sql_guardrails.py |
Adds SQL guardrail regression coverage. |
tests/unit/data/test_odata_internal.py |
Adds inner-error parsing and precision default tests. |
tests/unit/data/test_batch_edge_cases.py |
Adds batch inner-error parsing coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 2 commits
May 27, 2026 21:57
…ft/PowerPlatform-DataverseClient-Python into users/sagebree/ga_fixes2
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.