Skip to content

Commit 0cf4415

Browse files
committed
Consolidate ApplicationId construction to a helper
1 parent 118d617 commit 0cf4415

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

cpp/src/arrow/filesystem/azurefs.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ Status ExceptionToStatus(const Azure::Core::RequestFailedException& exception,
304304
return Status::IOError(std::forward<PrefixArgs>(prefix_args)..., " Azure Error: [",
305305
exception.ErrorCode, "] ", exception.what());
306306
}
307+
308+
std::string BuildApplicationId() {
309+
return "azpartner-arrow/" + GetBuildInfo().version_string;
310+
}
307311
} // namespace
308312

309313
std::string AzureOptions::AccountBlobUrl(const std::string& account_name) const {
@@ -388,8 +392,7 @@ Result<std::unique_ptr<Blobs::BlobServiceClient>> AzureOptions::MakeBlobServiceC
388392
blob_storage_scheme);
389393
}
390394
Blobs::BlobClientOptions client_options;
391-
client_options.Telemetry.ApplicationId =
392-
"azpartner-arrow/" + GetBuildInfo().version_string;
395+
client_options.Telemetry.ApplicationId = BuildApplicationId();
393396
switch (credential_kind_) {
394397
case CredentialKind::kAnonymous:
395398
return std::make_unique<Blobs::BlobServiceClient>(AccountBlobUrl(account_name),
@@ -426,8 +429,7 @@ AzureOptions::MakeDataLakeServiceClient() const {
426429
dfs_storage_scheme);
427430
}
428431
DataLake::DataLakeClientOptions client_options;
429-
client_options.Telemetry.ApplicationId =
430-
"azpartner-arrow/" + GetBuildInfo().version_string;
432+
client_options.Telemetry.ApplicationId = BuildApplicationId();
431433
switch (credential_kind_) {
432434
case CredentialKind::kAnonymous:
433435
return std::make_unique<DataLake::DataLakeServiceClient>(

0 commit comments

Comments
 (0)