Skip to content

Commit

Permalink
chore: re-run cargo fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Omkar P <[email protected]>
  • Loading branch information
omkar-foss committed Jan 10, 2025
1 parent 0824abe commit 0da4600
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions crates/catalog-unity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ impl UnityCatalogBuilder {

/// Returns the storage location and temporary token to be used with the
/// Unity Catalog table.
pub async fn get_uc_location_and_token(table_uri: &str) -> Result<(String, String), UnityCatalogError> {
pub async fn get_uc_location_and_token(
table_uri: &str,
) -> Result<(String, String), UnityCatalogError> {
let uri_parts: Vec<&str> = table_uri[5..].split('.').collect();
if uri_parts.len() != 3 {
panic!("Invalid Unity Catalog URI: {}", table_uri);
Expand All @@ -441,15 +443,13 @@ impl UnityCatalogBuilder {
Ok(uc) => uc,
Err(_e) => panic!("Unable to build Unity Catalog."),
};
let storage_location =
match unity_catalog.get_table_storage_location(
Some(catalog_id.to_string()),
database_name,
table_name,
).await {
Ok(s) => s,
Err(_e) => panic!("Unable to find the table's storage location."),
};
let storage_location = match unity_catalog
.get_table_storage_location(Some(catalog_id.to_string()), database_name, table_name)
.await
{
Ok(s) => s,
Err(_e) => panic!("Unable to find the table's storage location."),
};
let token = unity_catalog.get_credential().await?;
let credential = match token.to_str() {
Ok(header_str) => header_str.to_string(),
Expand Down Expand Up @@ -774,10 +774,14 @@ mod tests {
.unwrap();
assert!(matches!(get_table_response, GetTableResponse::Success(_)));

let storage_location = client.get_table_storage_location(
Some("catalog_name".to_string()), "schema_name", "table_name",
).await
.unwrap();
let storage_location = client
.get_table_storage_location(
Some("catalog_name".to_string()),
"schema_name",
"table_name",
)
.await
.unwrap();
assert!(storage_location.eq_ignore_ascii_case("string"));
}
}

0 comments on commit 0da4600

Please sign in to comment.