Skip to content

Commit a3275e6

Browse files
committed
fix: name only the scheme when an Azure store gets a non-Azure URL
The message no longer needs the host, so the redacted helper that built it is removed.
1 parent 5fbb8fd commit a3275e6

2 files changed

Lines changed: 4 additions & 16 deletions

File tree

‎native/core/src/parquet/objectstore/azure.rs‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ use object_store::{
7979
ObjectStore, ObjectStoreScheme,
8080
};
8181

82-
use super::url_redaction::{display_authority, redacted, without_credentials, without_secrets};
82+
use super::url_redaction::{display_authority, without_credentials, without_secrets};
8383

8484
const MARKER_RESOLUTION: &str = "comet.azure.resolution";
8585
const MARKER_AUTH_TYPE: &str = "comet.azure.auth.type";
@@ -126,7 +126,7 @@ pub fn create_store(
126126
if scheme != ObjectStoreScheme::MicrosoftAzure {
127127
return Err(config_error(format!(
128128
"Scheme of URL is not Azure: {}",
129-
redacted(url)
129+
url.scheme()
130130
)));
131131
}
132132
let path = Path::parse(path)?;
@@ -552,13 +552,10 @@ mod tests {
552552
"s3://alice:{SECRET}@bucket/dir/file.parquet?sig=SAS-MARKER"
553553
));
554554
assert!(
555-
not_azure.contains("Scheme of URL is not Azure: s3://bucket"),
555+
not_azure.ends_with("Scheme of URL is not Azure: s3"),
556556
"{not_azure}"
557557
);
558-
assert!(
559-
!not_azure.contains("file.parquet"),
560-
"path echoed: {not_azure}"
561-
);
558+
assert!(!not_azure.contains("bucket"), "host echoed: {not_azure}");
562559
error_for(format!(
563560
"foo://alice:{SECRET}@host/dir/file.parquet?sig=SAS-MARKER"
564561
));

‎native/core/src/parquet/objectstore/url_redaction.rs‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,3 @@ pub(crate) fn authority_without_password(url: &Url) -> Cow<'_, str> {
5555
pub(crate) fn display_authority(url: &Url) -> String {
5656
format!("{}://{}", url.scheme(), authority_without_password(url))
5757
}
58-
59-
/// `scheme://host[:port]` of a URL that may not be Azure, for messages.
60-
pub(crate) fn redacted(url: &Url) -> String {
61-
format!(
62-
"{}://{}",
63-
url.scheme(),
64-
&url[Position::BeforeHost..Position::AfterPort]
65-
)
66-
}

0 commit comments

Comments
 (0)