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

Clean up and expand log path parsing utilities #347

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion acceptance/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{TestCaseInfo, TestResult};
pub async fn read_golden(path: &Path, _version: Option<&str>) -> DeltaResult<RecordBatch> {
let expected_root = path.join("expected").join("latest").join("table_content");
let store = Arc::new(LocalFileSystem::new_with_prefix(&expected_root)?);
let files = store.list(None).try_collect::<Vec<_>>().await?;
let files: Vec<_> = store.list(None).try_collect().await?;
let mut batches = vec![];
let mut schema = None;
for meta in files.into_iter() {
Expand Down
2 changes: 2 additions & 0 deletions ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ pub enum KernelError {
InvalidStructDataError,
InternalError,
InvalidExpression,
InvalidLogPath,
}

impl From<Error> for KernelError {
Expand Down Expand Up @@ -374,6 +375,7 @@ impl From<Error> for KernelError {
backtrace: _,
} => Self::from(*source),
Error::InvalidExpressionEvaluation(_) => KernelError::InvalidExpression,
Error::InvalidLogPath(_) => KernelError::InvalidLogPath,
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions kernel/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ pub enum Error {
/// Expressions did not parse or evaluate correctly
#[error("Invalid expression evaluation: {0}")]
InvalidExpressionEvaluation(String),

/// Unable to parse the name of a log path
#[error("Invalid log path: {0}")]
InvalidLogPath(String),
}

// Convenience constructors for Error types that take a String argument
Expand Down Expand Up @@ -203,6 +207,9 @@ impl Error {
pub fn invalid_expression(msg: impl ToString) -> Self {
Self::InvalidExpressionEvaluation(msg.to_string())
}
pub(crate) fn invalid_log_path(msg: impl ToString) -> Self {
Self::InvalidLogPath(msg.to_string())
}

pub fn internal_error(msg: impl ToString) -> Self {
Self::InternalError(msg.to_string()).with_backtrace()
Expand Down
5 changes: 5 additions & 0 deletions kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ pub mod engine_data;
pub mod error;
pub mod expressions;
pub mod features;

#[cfg(feature = "developer-visibility")]
pub mod path;
#[cfg(not(feature = "developer-visibility"))]
pub(crate) mod path;

pub mod scan;
pub mod schema;
pub mod snapshot;
Expand Down
Loading
Loading