Add Files API endpoints#266
Conversation
|
@microsoft-github-policy-service agree company="Ubisoft" |
|
Hi @Flavinou , appreciate the PR. However, could you please remove all the changes that include only whitespace and format changes? Your PR has 215 changed files, and it's super time consuming for me to walk through them one by one. |
|
Sure ! Sorry about that, I blindly followed the contribution guidelines when I should have done it in another PR. |
967c844 to
d7f0815
Compare
There was a problem hiding this comment.
Pull Request Overview
Adds support for Databricks Files API by introducing client-side models, interface, implementation, tests, and sample usage
- Introduce
DirectoryEntryandDirectoriesListmodels to represent file system entries and pagination - Define
IFilesApiand implement it inFilesApiClient, extendingApiClientwith HEAD support and wiring intoDatabricksClient - Add comprehensive unit tests and sample program scenarios for all file and directory operations
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Models/DirectoryEntry.cs | New record for file/directory metadata |
| Models/DirectoriesList.cs | New paginated directory listing model |
| IFilesApi.cs | Interface defining Files API methods |
| FilesApiClient.cs | Implements file and directory operations |
| ApiClient.cs | Refactored to add HEAD support (HttpHead) and shared response helper |
| DatabricksClient.cs | Exposes Files API on the root client and disposes it |
| FilesApiClientTest.cs | Unit tests covering directory and file operations |
| SampleProgram.cs / SampleProgram.Files.cs | Sample scenarios demonstrating Files API usage |
Comments suppressed due to low confidence (2)
csharp/Microsoft.Azure.Databricks.Client/FilesApiClient.cs:31
- Adding tests for
ListDirectoryContentswith non-defaultpageSizeandpageTokenwould catch URL-building bugs and ensure pagination logic is correct.
if (pageSize != null)
csharp/Microsoft.Azure.Databricks.Client/Models/DirectoryEntry.cs:30
- The API returns
last_modifiedas milliseconds since Unix epoch. Ensure you have a custom JSON converter registered (e.g. aJsonConverterfor epoch milliseconds) otherwise deserialization toDateTimeOffsetwill fail or produce incorrect values.
public DateTimeOffset? LastModified { get; set; }
|
@Flavinou I added a commit to your PR to add support for pageable list and also addressed some of the Copilot code review comments. Could you please take a look and kindly test the ListDirectoryContentsPageable and Download functions? |
|
@memoryz Of course, thank you for the follow up I didn't know about the Azure built-in pageable features ! |
|
Tested with a real workspace, it looks fine to me - I edited the sample program to list the directory contents based on the user input, it's minor |
Added Files API endpoints based on documentation (https://docs.databricks.com/api/azure/workspace/files)
Tests
Resolves #235