Skip to content

Commit

Permalink
Rename ion-rs to ion-rs_old in preparation of upgrade (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpschorr authored Sep 5, 2024
1 parent deff7a8 commit 370bb96
Show file tree
Hide file tree
Showing 17 changed files with 109 additions and 99 deletions.
1 change: 0 additions & 1 deletion extension/partiql-extension-ddl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ bench = false
[dependencies]
partiql-types = { path = "../../partiql-types", version = "0.10.*" }

ion-rs = "0.18.1"
thiserror = "1.0"
miette = { version = "7.2", features = ["fancy"] }
time = { version = "0.3", features = ["formatting", "parsing", "serde"] }
Expand Down
3 changes: 0 additions & 3 deletions extension/partiql-extension-ddl/src/ddl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use ion_rs::IonError;
use miette::Diagnostic;
use partiql_types::{
AnyOf, ArrayType, BagType, PartiqlShape, ShapeResultError, Static, StaticType, StructType,
Expand All @@ -13,8 +12,6 @@ use thiserror::Error;
pub enum ShapeEncodingError {
#[error("UnsupportedEncoding: {0}")]
UnsupportedEncoding(String),
#[error("IonEncodingError: {0}")]
IonEncodingError(#[from] IonError),
#[error("DateTimeEncodingError e: {0}")]
DateTimeEncodingError(#[from] time::error::Format),
#[error("Invalid Simulation Configuration e: {0}")]
Expand Down
2 changes: 1 addition & 1 deletion extension/partiql-extension-ion-functions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ itertools = "0.10.*"
unicase = "2.6"
rust_decimal = { version = "1.25.0", default-features = false, features = ["std"] }
rust_decimal_macros = "1.26"
ion-rs = "0.18"
ion-rs_old = { version = "0.18", package = "ion-rs" }
time = { version = "0.3", features = ["macros"] }
once_cell = "1"
regex = "1.7"
Expand Down
4 changes: 2 additions & 2 deletions extension/partiql-extension-ion-functions/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![deny(rust_2018_idioms)]
#![deny(clippy::all)]

use ion_rs::data_source::ToIonDataSource;
use ion_rs_old::data_source::ToIonDataSource;
use partiql_catalog::call_defs::{CallDef, CallSpec, CallSpecArg};
use partiql_catalog::TableFunction;
use partiql_catalog::{
Expand Down Expand Up @@ -152,7 +152,7 @@ fn parse_ion_read<'a>(mut reader: impl 'a + Read + Seek) -> BaseTableExprResult<

fn parse_ion_buff<'a, I: 'a + ToIonDataSource>(input: I) -> BaseTableExprResult<'a> {
let err_map = |e| Box::new(e) as BaseTableExprResultError;
let reader = ion_rs::ReaderBuilder::new().build(input).unwrap();
let reader = ion_rs_old::ReaderBuilder::new().build(input).unwrap();
let decoder =
IonDecoderBuilder::new(IonDecoderConfig::default().with_mode(Encoding::Ion)).build(reader);
let decoder = decoder.map_err(err_map)?.map(move |it| it.map_err(err_map));
Expand Down
2 changes: 1 addition & 1 deletion extension/partiql-extension-ion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ itertools = "0.10.*"
unicase = "2.6"
rust_decimal = { version = "1.25.0", default-features = false, features = ["std"] }
rust_decimal_macros = "1.26"
ion-rs = "0.18"
ion-rs_old = { version = "0.18", package = "ion-rs" }
time = { version = "0.3", features = ["macros"] }
once_cell = "1"
regex = "1.7"
Expand Down
2 changes: 1 addition & 1 deletion extension/partiql-extension-ion/src/decode.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use delegate::delegate;
use ion_rs::{Decimal, Int, IonError, IonReader, IonType, StreamItem, Symbol};
use ion_rs_old::{Decimal, Int, IonError, IonReader, IonType, StreamItem, Symbol};
use once_cell::sync::Lazy;
use partiql_value::{Bag, DateTime, List, Tuple, Value};
use regex::RegexSet;
Expand Down
10 changes: 5 additions & 5 deletions extension/partiql-extension-ion/src/encode.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use delegate::delegate;

use ion_rs::{IonError, IonType, IonWriter};
use ion_rs_old::{IonError, IonType, IonWriter};
use ordered_float::OrderedFloat;
use partiql_value::{Bag, DateTime, List, Tuple, Value};
use rust_decimal::Decimal;
Expand Down Expand Up @@ -218,7 +218,7 @@ where
fn encode_decimal(&mut self, val: &Decimal) -> IonEncodeResult {
let scale = i64::from(val.scale());
let mantissa = val.mantissa();
let dec = ion_rs::Decimal::new(mantissa, -scale);
let dec = ion_rs_old::Decimal::new(mantissa, -scale);
Ok(self.writer.write_decimal(&dec)?)
}

Expand All @@ -233,7 +233,7 @@ where
fn encode_datetime(&mut self, val: &DateTime) -> IonEncodeResult {
match val {
DateTime::Timestamp(ts) => {
let ts = ion_rs::Timestamp::with_ymd(
let ts = ion_rs_old::Timestamp::with_ymd(
ts.year() as u32,
ts.month() as u32,
u32::from(ts.day()),
Expand All @@ -249,7 +249,7 @@ where
Ok(self.writer.write_timestamp(&ts)?)
}
DateTime::TimestampWithTz(ts) => {
let ts = ion_rs::Timestamp::with_ymd(
let ts = ion_rs_old::Timestamp::with_ymd(
ts.year() as u32,
ts.month() as u32,
u32::from(ts.day()),
Expand Down Expand Up @@ -334,7 +334,7 @@ where
self.inner
.writer
.set_annotations(std::iter::once(DATE_ANNOT));
let ts = ion_rs::Timestamp::with_ymd(
let ts = ion_rs_old::Timestamp::with_ymd(
date.year() as u32,
date.month() as u32,
u32::from(date.day()),
Expand Down
Loading

0 comments on commit 370bb96

Please sign in to comment.