From e4ceedc65e37f2ded91063f9aada3d72b0f8e92b Mon Sep 17 00:00:00 2001 From: Sean McCullough Date: Mon, 31 Jul 2023 11:13:41 -0500 Subject: [PATCH 1/2] Fixed issue where pagianted parameter was being sent with DataLakeFileClient.Delete() --- .../src/DataLakePathClient.cs | 1 + .../tests/FileClientTests.cs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs index aa69810a0c6d3..42f21f591b1dd 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakePathClient.cs @@ -1865,6 +1865,7 @@ private async Task DeleteInternal( // Pagination only applies to service version 2023-08-03 and later, when using OAuth. bool? paginated = null; if (_clientConfiguration.ClientOptions.Version >= DataLakeClientOptions.ServiceVersion.V2023_08_03 + && recursive.GetValueOrDefault() && _clientConfiguration.TokenCredential != null) { paginated = true; diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs index 408aece35d7a7..c784e55bcee9a 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs @@ -951,6 +951,20 @@ public async Task DeleteAsync() await fileClient.DeleteAsync(); } + [RecordedTest] + public async Task DeleteAsync_OAuth() + { + DataLakeServiceClient oauthService = GetServiceClient_OAuth(); + await using DisposingFileSystem test = await GetNewFileSystem(oauthService); + DataLakeDirectoryClient directory = await test.FileSystem.CreateDirectoryAsync(GetNewDirectoryName()); + + // Arrange + DataLakeFileClient fileClient = await directory.CreateFileAsync(GetNewFileName()); + + // Act + await fileClient.DeleteAsync(); + } + [RecordedTest] public async Task DeleteFileAsync_Error() { From 5de54ae36c409cdf481f76de13f3d4cb092d0903 Mon Sep 17 00:00:00 2001 From: Sean McCullough Date: Mon, 31 Jul 2023 12:11:26 -0500 Subject: [PATCH 2/2] test recordings --- sdk/storage/Azure.Storage.Files.DataLake/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/assets.json b/sdk/storage/Azure.Storage.Files.DataLake/assets.json index a52ec21ded409..424ad23002c97 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/assets.json +++ b/sdk/storage/Azure.Storage.Files.DataLake/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Files.DataLake", - "Tag": "net/storage/Azure.Storage.Files.DataLake_369e19e7ec" + "Tag": "net/storage/Azure.Storage.Files.DataLake_7989a584e7" }