Allow passing display_name parameter when creating tables#164
Allow passing display_name parameter when creating tables#164abelmilash-msft wants to merge 7 commits intomainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…patch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new optional display_name parameter to table-creation APIs so callers can set a human-friendly Dataverse table display name instead of being forced to use the schema name (default behavior remains unchanged when omitted).
Changes:
- Extend
client.tables.create()andbatch.tables.create()to accept optionaldisplay_nameand forward it through internal layers. - Update
_ODataClient._create_table()and_ODataClient._build_create_entity()to use the provided display name (falling back to schema name). - Add/adjust unit tests to cover payload construction and forwarding for both direct and batch creation paths.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/PowerPlatform/Dataverse/operations/tables.py |
Adds display_name to TableOperations.create() and forwards it to _create_table. |
src/PowerPlatform/Dataverse/operations/batch.py |
Adds display_name to BatchTableOperations.create() and stores it on _TableCreate. |
src/PowerPlatform/Dataverse/data/_odata.py |
Adds display_name plumbing and uses it in create payloads for both immediate and batch-built entity creation. |
src/PowerPlatform/Dataverse/data/_batch.py |
Extends _TableCreate intent and forwards display_name into _build_create_entity. |
tests/unit/test_tables_operations.py |
Verifies display_name is forwarded from tables.create() into _create_table. |
tests/unit/test_client_deprecations.py |
Updates expectations for the extra forwarded arg into _create_table (default None). |
tests/unit/data/test_odata_internal.py |
Adds coverage for _create_table/_build_create_entity payload label behavior with/without display_name. |
tests/unit/data/test_batch_serialization.py |
Verifies batch resolver forwards display_name into _build_create_entity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ss fallback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pe+empty check Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d _build_create_entity Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…coverage Adds 12 tests covering HTTP structure (method, URL, solution query param), payload fields (SchemaName, OwnershipType, Description), primary column derivation (prefix, explicit, no-underscore default), column inclusion, and unsupported column type error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b9f13b2 to
bf45a33
Compare
| schema: Dict[str, Any], | ||
| solution_unique_name: Optional[str] = None, | ||
| primary_column_schema_name: Optional[str] = None, | ||
| display_name: Optional[str] = None, |
There was a problem hiding this comment.
in one of the existing integration tests, pass the display name to make sure coverage.
| "DisplayCollectionName": self._label(table + "s"), | ||
| "Description": self._label(f"Custom entity for {table}"), | ||
| "DisplayName": self._label(label), | ||
| "DisplayCollectionName": self._label(label + "s"), |
There was a problem hiding this comment.
this will be wrong if the DisplayName is 'Person'. Instead of computing, there should be a library we are using to convert to plural. Try to use that.
Summary
display_nameparameter toclient.tables.create(),batch.tables.create(), and the internal_create_table/_build_create_entitymethodsTests
TestBuildCreateEntity— direct payload tests for_build_create_entitywith and withoutdisplay_nametest_dispatch_table_create_forwards_display_name— verifies batch path forwards the valuetest_display_name_used_in_payload_when_provided/test_display_name_defaults_to_schema_name— verifies_create_tablebehaviorCloses #163