-
Notifications
You must be signed in to change notification settings - Fork 11
Users/zhaodongwang/column helpers #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
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 adds column-level metadata management capabilities to the Dataverse SDK, enabling developers to create and delete individual columns on existing tables without recreating entire tables. It refactors entity/attribute schema normalization into dedicated helper methods and introduces corresponding client APIs with detailed documentation and validation.
- Refactored inline schema normalization into reusable
_normalize_entity_schemaand_normalize_attribute_schemamethods - Added
create_columnsanddelete_columnsmethods to support adding/removing columns on existing tables - Integrated column metadata operations in the quickstart example with validation and retry logic
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/dataverse_sdk/odata.py | Adds helper methods for schema normalization, attribute metadata retrieval, and column create/delete operations with picklist cache management |
| src/dataverse_sdk/error_codes.py | Introduces METADATA_COLUMN_NOT_FOUND error code for column deletion validation |
| src/dataverse_sdk/client.py | Exposes public create_columns and delete_columns methods with comprehensive docstrings |
| examples/quickstart.py | Demonstrates column create/delete workflow with metadata validation and backoff retry logic |
| README.md | Updates feature descriptions and API reference table to reflect column management capabilities |
Comments suppressed due to low confidence (1)
src/dataverse_sdk/odata.py:3
- Import of 'Tuple' is not used.
from typing import Any, Dict, Optional, List, Union, Iterable, Tuple
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/microsoft/PowerPlatform-DataverseClient-Python into users/zhaodongwang/columnHelpers
This pull request adds comprehensive support for creating and deleting columns on existing Dataverse tables, both in the core SDK and the quickstart example. The changes include new high-level methods on the client, robust schema normalization for column names, and detailed error handling for column operations. Documentation and usage examples have also been updated to reflect these new capabilities.
New column management features:
create_columnsanddelete_columnsmethods toDataverseClient, allowing users to add or remove columns from existing tables using a simple schema mapping. These methods return the schema names of affected columns and handle both friendly and schema names. (src/dataverse_sdk/client.py[1]src/dataverse_sdk/odata.py[2]src/dataverse_sdk/odata.py[1] [2] [3]Error handling improvements:
METADATA_COLUMN_NOT_FOUND) and robust error handling in column operations. (src/dataverse_sdk/error_codes.py[1]src/dataverse_sdk/odata.py[2]Documentation and usage examples:
README.mdto document the new column creation and deletion methods, including API docs and usage examples. (README.md[1] [2] [3]examples/quickstart.pyscript to demonstrate column creation and deletion, including metadata verification and error reporting. (examples/quickstart.py[1] [2] [3]Internal consistency and refactoring:
src/dataverse_sdk/odata.py[1] [2]These changes significantly improve the SDK's support for dynamic table schema management in Dataverse.