-
Notifications
You must be signed in to change notification settings - Fork 11
auto create file column if it doesnt exist #94
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
base: main
Are you sure you want to change the base?
auto create file column if it doesnt exist #94
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 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_filemethod 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_settotable_schema_namefor 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… waiting for newly created column
…logical name for better column creation support
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
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.
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_filemethod 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:
upload_filemethod 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]_upload_filehave been updated to usetable_schema_nameinstead ofentity_set, reflecting the new workflow and clarifying parameter expectations. [1] [2]upload_filemethod inclient.pynow passestable_schema_namedirectly, simplifying the call chain.Documentation updates:
README.mdand skill documentation files now clarify that the file column will be created automatically if it doesn't exist. [1] [2]Example and code cleanup:
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]