Skip to content

Commit

Permalink
Updated base64 to 0.21 (jorgecarleitao#1408)
Browse files Browse the repository at this point in the history
* dependency update: update base64 to 0.21

* fmt code
  • Loading branch information
WindSoilder authored and ritchie46 committed Apr 5, 2023
1 parent fc83e06 commit b93d806
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ rand = { version = "0.8", optional = true }

itertools = { version = "^0.10", optional = true }

base64 = { version = "0.13.0", optional = true }
base64 = { version = "0.21.0", optional = true }

# to write to parquet as a stream
futures = { version = "0.3", optional = true }
Expand Down
3 changes: 2 additions & 1 deletion src/io/parquet/read/schema/metadata.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use base64::{engine::general_purpose, Engine as _};
pub use parquet2::metadata::KeyValue;

use crate::datatypes::{Metadata, Schema};
Expand All @@ -18,7 +19,7 @@ pub fn read_schema_from_metadata(metadata: &mut Metadata) -> Result<Option<Schem

/// Try to convert Arrow schema metadata into a schema
fn get_arrow_schema_from_metadata(encoded_meta: &str) -> Result<Schema> {
let decoded = base64::decode(encoded_meta);
let decoded = general_purpose::STANDARD.decode(encoded_meta);
match decoded {
Ok(bytes) => {
let slice = if bytes[0..4] == [255u8; 4] {
Expand Down
3 changes: 2 additions & 1 deletion src/io/parquet/write/schema.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use base64::{engine::general_purpose, Engine as _};
use parquet2::{
metadata::KeyValue,
schema::{
Expand Down Expand Up @@ -30,7 +31,7 @@ pub fn schema_to_metadata_key(schema: &Schema) -> KeyValue {
len_prefix_schema.extend_from_slice(&(schema_len as u32).to_le_bytes());
len_prefix_schema.extend_from_slice(&serialized_schema);

let encoded = base64::encode(&len_prefix_schema);
let encoded = general_purpose::STANDARD.encode(&len_prefix_schema);

KeyValue {
key: ARROW_SCHEMA_META_KEY.to_string(),
Expand Down

0 comments on commit b93d806

Please sign in to comment.