Skip to content

Commit

Permalink
resolve #1860
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Ulmasov <[email protected]>
  • Loading branch information
r3stl355 authored and rtyler committed Nov 21, 2023
1 parent 2c8c0ec commit 1e0d94e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
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

0 comments on commit 1e0d94e

Please sign in to comment.