Skip to content

Conversation

@zhaodongwang-msft
Copy link
Collaborator

@zhaodongwang-msft zhaodongwang-msft commented Jan 30, 2026

updated upload_file function to auto create the file column if it doesn't exist. also included some minor improvments like supporting file column in create_column

Copilot summary:
This pull request introduces improvements to the file upload workflow, focusing on making the upload_file method more robust and user-friendly. The most significant enhancement is the automatic creation of a file column if it does not exist when uploading a file, along with waiting for the new attribute to become visible before proceeding. Additional changes include code cleanup in the advanced file upload example and improved documentation.

File upload improvements:

  • The upload_file method now automatically checks if the specified file column exists; if not, it creates the column and waits for it to become visible in the data API before uploading the file. This ensures smoother uploads without manual column setup. [1] [2] [3]
  • The signature and documentation of _upload_file have been updated to use table_schema_name instead of entity_set, reflecting the new workflow and clarifying parameter expectations. [1] [2]
  • The upload_file method in client.py now passes table_schema_name directly, simplifying the call chain.

Documentation updates:

  • Usage examples in README.md and skill documentation files now clarify that the file column will be created automatically if it doesn't exist. [1] [2]

Example and code cleanup:

  • The advanced file upload example (file_upload.py) was refactored for clarity: variable initialization order was improved, the table schema name was updated for testing, log statements were made dynamic, and redundant attribute creation logic was removed (as this is now handled automatically by the upload method). [1] [2] [3] [4]

@zhaodongwang-msft zhaodongwang-msft requested a review from a team as a code owner January 30, 2026 01:02
Copilot AI review requested due to automatic review settings January 30, 2026 01:02
Copy link
Contributor

Copilot AI left a 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 pull request enhances the file upload workflow by automatically creating file columns if they don't exist when uploading files. The changes consolidate column creation logic from application code into the SDK, making the upload process more user-friendly.

Changes:

  • Modified upload_file method to auto-create file columns and wait for them to become visible in the Data API before proceeding with upload
  • Updated parameter naming from entity_set to table_schema_name for consistency
  • Simplified example code by removing manual file attribute creation logic

Reviewed changes

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

Show a summary per file
File Description
src/PowerPlatform/Dataverse/data/_upload.py Added logic to check for file column existence, create it if missing, and wait for visibility; updated parameter from entity_set to table_schema_name
src/PowerPlatform/Dataverse/data/_odata.py Added _wait_for_attribute_visibility helper method and file attribute payload support in _attribute_payload
src/PowerPlatform/Dataverse/client.py Updated upload_file to pass table_schema_name directly instead of resolving entity_set
README.md Added comment clarifying automatic file column creation
src/PowerPlatform/Dataverse/claude_skill/SKILL.md Added comment clarifying automatic file column creation
.claude/skills/dataverse-sdk/SKILL.md Added comment clarifying automatic file column creation
examples/advanced/file_upload.py Removed manual file attribute creation logic and reordered cleanup prompts for better UX

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

zhaodongwang-msft and others added 5 commits January 29, 2026 17:09
Copy link
Contributor

Copilot AI left a comment

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 1 comment.


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

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.

2 participants