Skip to content

Commit

Permalink
Address clippy concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
dispanser committed Dec 6, 2023
1 parent 54a3daf commit 40bc81f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions crates/deltalake-core/src/logstore/s3/lock_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ pub struct DynamoDbLockClient {
impl DynamoDbLockClient {
/// Creates a new DynamoDbLockClient from the supplied storage options.
///
/// Options are described in [s3_storage_options].
/// Options are described in [crate::table::builder::s3_storage_options].
pub fn try_new(options: &S3StorageOptions) -> Result<Self, DynamoDbConfigError> {
let dynamodb_client = create_dynamodb_client(&options)?;
let dynamodb_client = create_dynamodb_client(options)?;
let lock_table_name = options
.extra_opts
.get(constants::LOCK_TABLE_KEY_NAME)
.map_or(constants::DEFAULT_LOCK_TABLE_NAME.to_owned(), Clone::clone);
let billing_mode = options
.extra_opts
.get(constants::BILLING_MODE_KEY_NAME)
.map(|bm| BillingMode::from_str(&bm))
.map(|bm| BillingMode::from_str(bm))
.unwrap_or(Ok(BillingMode::PayPerRequest))?;
Ok(Self {
dynamodb_client,
Expand Down Expand Up @@ -133,7 +133,7 @@ impl DynamoDbLockClient {
table_path: &str,
entry: &CommitEntry,
) -> Result<(), LockClientError> {
let item = create_value_map(&entry, table_path);
let item = create_value_map(entry, table_path);
let input = PutItemInput {
condition_expression: Some(constants::CONDITION_EXPR_CREATE.to_owned()),
table_name: self.get_lock_table_name(),
Expand Down Expand Up @@ -192,7 +192,7 @@ impl DynamoDbLockClient {
.items
.unwrap()
.iter()
.map(|item| CommitEntry::try_from(item))
.map(CommitEntry::try_from)
.collect()
}

Expand Down Expand Up @@ -290,7 +290,7 @@ fn create_value_map(
let mut value_map = maplit::hashmap! {
constants::ATTR_TABLE_PATH.to_owned() => string_attr(table_path),
constants::ATTR_FILE_NAME.to_owned() => string_attr(format!("{:020}.json", commit_entry.version)),
constants::ATTR_TEMP_PATH.to_owned() => string_attr(&temp_path),
constants::ATTR_TEMP_PATH.to_owned() => string_attr(temp_path),
constants::ATTR_COMPLETE.to_owned() => string_attr(if commit_entry.complete { "true" } else { "false" }),
};
commit_entry.expire_time.as_ref().map(|t| {
Expand Down
8 changes: 4 additions & 4 deletions crates/deltalake-core/src/logstore/s3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl S3DynamoDbLogStore {
s3_options: &S3StorageOptions,
object_store: ObjectStoreRef,
) -> DeltaResult<Self> {
let lock_client = DynamoDbLockClient::try_new(&s3_options).map_err(|err| {
let lock_client = DynamoDbLockClient::try_new(s3_options).map_err(|err| {
DeltaTableError::ObjectStore {
source: object_store::Error::Generic {
store: STORE_NAME,
Expand Down Expand Up @@ -112,7 +112,7 @@ impl S3DynamoDbLogStore {
source: Box::new(err),
}) {
Ok(x) => return Ok(Self::map_retry_result(x, copy_performed)),
Err(err) if retry == MAX_REPAIR_RETRIES => return Err(err.into()),
Err(err) if retry == MAX_REPAIR_RETRIES => return Err(err),
Err(err) => log::debug!(
"retry #{retry} on log entry {entry:?} failed to update lock db: '{err}'"
),
Expand Down Expand Up @@ -226,8 +226,8 @@ impl LogStore for S3DynamoDbLogStore {

/// Representation of a log entry stored in DynamoDb
/// dynamo db item consists of:
/// - tablePath: String - part of primary key, configured in [`DeltaObjectStore`]
/// - fileName: String - commit version.json (part of primary key), stored as i64 here
/// - tablePath: String - tracked in the log store implementation
/// - fileName: String - commit version.json (part of primary key), stored as i64 in this struct
/// - tempPath: String - name of temporary file containing commit info
/// - complete: bool - operation completed, i.e. atomic rename from `tempPath` to `fileName` succeeded
/// - expireTime: Option<SystemTime> - epoch seconds at which this external commit entry is safe to be deleted
Expand Down
2 changes: 1 addition & 1 deletion crates/deltalake-core/src/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl<'de> Deserialize<'de> for DeltaTable {
.next_element()?
.ok_or_else(|| A::Error::invalid_length(0, &self))?;
let log_store = configure_log_store(
&storage_config.location.to_string(),
storage_config.location.as_ref(),
storage_config.options,
None,
)
Expand Down

0 comments on commit 40bc81f

Please sign in to comment.