diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index 8e7e9358d224e..4d9a3f6659716 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -49,11 +49,12 @@ class AzureFileSystem::Impl { : io_context_(io_context), options_(std::move(options)) {} Status Init() { - // TODO: Delete this once we have a proper implementation. This is just here to - // ensure the build is working correctly with the Azure SDK. - auto defaultCredential = std::make_shared(); - auto serviceClient = Azure::Storage::Blobs::BlobServiceClient( - "http://fake-blob-storage-endpoit", defaultCredential); + // TODO: GH-18014 Delete this once we have a proper implementation. This just + // initializes a pointless Azure blob service client with a fake endpoint to ensure + // the build will fail if the Azure SDK build is broken. + auto default_credential = std::make_shared(); + auto service_client = Azure::Storage::Blobs::BlobServiceClient( + "http://fake-blob-storage-endpoint", default_credential); if (options_.backend == AzureBackend::Azurite) { // gen1Client_->GetAccountInfo().Value.IsHierarchicalNamespaceEnabled // throws error in azurite diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index 3d132c3774076..ec34db1a4cd99 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -114,9 +114,9 @@ AzuriteEnv* GetAzuriteEnv() { // Placeholder tests // TODO: GH-18014 Remove once a proper test is added TEST(AzureFileSystem, UploadThenDownload) { - const std::string containerName = "sample-container"; - const std::string blobName = "sample-blob.txt"; - const std::string blobContent = "Hello Azure!"; + const std::string container_name = "sample-container"; + const std::string blob_name = "sample-blob.txt"; + const std::string blob_content = "Hello Azure!"; const std::string& account_name = GetAzuriteEnv()->account_name(); const std::string& account_key = GetAzuriteEnv()->account_key(); @@ -124,26 +124,26 @@ TEST(AzureFileSystem, UploadThenDownload) { auto credential = std::make_shared( account_name, account_key); - auto serviceClient = Azure::Storage::Blobs::BlobServiceClient( + auto service_client = Azure::Storage::Blobs::BlobServiceClient( "http://127.0.0.1:10000/devstoreaccount1", credential); - auto containerClient = serviceClient.GetBlobContainerClient(containerName); - containerClient.CreateIfNotExists(); - auto blobClient = containerClient.GetBlockBlobClient(blobName); + auto container_client = service_client.GetBlobContainerClient(container_name); + container_client.CreateIfNotExists(); + auto blob_client = container_client.GetBlockBlobClient(blob_name); - std::vector buffer(blobContent.begin(), blobContent.end()); - blobClient.UploadFrom(buffer.data(), buffer.size()); + std::vector buffer(blob_content.begin(), blob_content.end()); + blob_client.UploadFrom(buffer.data(), buffer.size()); - std::vector buffer2(blobContent.size()); - blobClient.DownloadTo(buffer2.data(), buffer2.size()); + std::vector buffer2(blob_content.size()); + blob_client.DownloadTo(buffer2.data(), buffer2.size()); - EXPECT_EQ(std::string(buffer2.begin(), buffer2.end()), blobContent); + EXPECT_EQ(std::string(buffer2.begin(), buffer2.end()), blob_content); } TEST(AzureFileSystem, InitializeCredentials) { - auto defaultCredential = std::make_shared(); - auto managedIdentityCredential = + auto default_credential = std::make_shared(); + auto managed_identity_credential = std::make_shared(); - auto servicePrincipalCredential = + auto service_principal_credential = std::make_shared("tenant_id", "client_id", "client_secret"); }