Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve catalog failure error message, add missing Glue native-tls feature dependency #1883

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions crates/deltalake-core/src/data_catalog/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use unity::*;

#[cfg(feature = "unity-experimental")]
pub mod client;
#[cfg(feature = "glue")]
#[cfg(any(feature = "glue", feature = "glue-native-tls"))]
pub mod glue;
#[cfg(feature = "datafusion")]
pub mod storage;
Expand Down Expand Up @@ -49,15 +49,15 @@ pub enum DataCatalogError {
},

/// Missing metadata in the catalog
#[cfg(feature = "glue")]
#[cfg(any(feature = "glue", feature = "glue-native-tls"))]
#[error("Missing Metadata {metadata} in the Data Catalog ")]
MissingMetadata {
/// The missing metadata property
metadata: String,
},

/// Glue Glue Data Catalog Error
#[cfg(feature = "glue")]
#[cfg(any(feature = "glue", feature = "glue-native-tls"))]
#[error("Catalog glue error: {source}")]
GlueError {
/// The underlying Glue Data Catalog Error
Expand All @@ -66,7 +66,7 @@ pub enum DataCatalogError {
},

/// Error caused by the http request dispatcher not being able to be created.
#[cfg(feature = "glue")]
#[cfg(any(feature = "glue", feature = "glue-native-tls"))]
#[error("Failed to create request dispatcher: {source}")]
AWSHttpClient {
/// The underlying Rusoto TlsError
Expand All @@ -75,7 +75,7 @@ pub enum DataCatalogError {
},

/// Error representing a failure to retrieve AWS credentials.
#[cfg(feature = "glue")]
#[cfg(any(feature = "glue", feature = "glue-native-tls"))]
#[error("Failed to retrieve AWS credentials: {source}")]
AWSCredentials {
/// The underlying Rusoto CredentialsError
Expand Down Expand Up @@ -138,7 +138,7 @@ pub fn get_data_catalog(
"azure" => unimplemented!("Azure Data Catalog is not implemented"),
#[cfg(feature = "hdfs")]
"hdfs" => unimplemented!("HDFS Data Catalog is not implemented"),
#[cfg(feature = "glue")]
#[cfg(any(feature = "glue", feature = "glue-native-tls"))]
"glue" => Ok(Box::new(glue::GlueDataCatalog::new()?)),
#[cfg(feature = "unity-experimental")]
"unity" => {
Expand Down
5 changes: 5 additions & 0 deletions crates/deltalake-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ compile_error!(
"Features s3 and s3-native-tls are mutually exclusive and cannot be enabled together"
);

#[cfg(all(feature = "glue", feature = "glue-native-tls"))]
compile_error!(
"Features glue and glue-native-tls are mutually exclusive and cannot be enabled together"
);

pub mod data_catalog;
pub mod errors;
pub mod kernel;
Expand Down
4 changes: 1 addition & 3 deletions python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ impl RawDeltaTable {
catalog_options: Option<HashMap<String, String>>,
) -> PyResult<String> {
let data_catalog = deltalake::data_catalog::get_data_catalog(data_catalog, catalog_options)
.map_err(|_| {
PyValueError::new_err(format!("Catalog '{}' not available.", data_catalog))
})?;
.map_err(|e| PyValueError::new_err(format!("{}", e)))?;
let table_uri = rt()?
.block_on(data_catalog.get_table_storage_location(
data_catalog_id,
Expand Down
Loading