Skip to content

Commit 3b90daf

Browse files
authored
VER: Release 0.17.0
2 parents e9bdb35 + d5ea8b1 commit 3b90daf

File tree

7 files changed

+37
-95
lines changed

7 files changed

+37
-95
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
# Changelog
22

3-
## 0.16.0 - TBD
3+
## 0.17.0 - 2024-12-17
4+
5+
### Enhancements
6+
- Upgraded DBN version to 0.25.0:
7+
- Added `v1` and `v2` namespaces in DBN to allow unambiguously referring to the record
8+
types for a given DBN version regardless of whether the record type has changed
9+
- Changed `dataset()` method on `MetadataBuilder` to accept an `impl ToString` so now
10+
`Dataset` and `&str` can be passed directly
11+
- Changed async DBN decoding to return `Ok(None)` when an incomplete record remains in
12+
the stream. This matches the existing behavior of sync DBN decoding
13+
- Upgraded `thiserror` version to 2.0
14+
15+
### Breaking changes
16+
- Removed deprecated `Packaging` enum and `packaging` field that's no longer supported
17+
by the API
18+
- As part of the DBN version upgrade:
19+
- `VersionUpgradePolicy::Upgrade` was renamed to `UpgradeToV2`
20+
- Changed async DBN decoding to return `Ok(None)` when an incomplete record remains in
21+
the stream
22+
23+
## 0.16.0 - 2024-11-12
424

525
#### Enhancements
626
- Upgraded DBN version to 0.23.1:

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ historical = ["dep:futures", "dep:reqwest", "dep:serde", "dep:tokio-util", "dep:
2323
live = ["dep:hex", "dep:sha2", "tokio/net"]
2424

2525
[dependencies]
26-
dbn = { version = "0.23.1", features = ["async", "serde"] }
26+
dbn = { version = "0.25.0", features = ["async", "serde"] }
2727
# Async stream trait
2828
futures = { version = "0.3", optional = true }
2929
# Used for Live authentication
@@ -33,7 +33,7 @@ serde = { version = "1.0", optional = true, features = ["derive"] }
3333
serde_json = { version = "1.0", optional = true }
3434
# Used for Live authentication
3535
sha2 = { version = "0.10", optional = true }
36-
thiserror = "1.0"
36+
thiserror = "2.0"
3737
time = { version = ">=0.3.35", features = ["macros", "parsing", "serde"] }
3838
tokio = { version = ">=1.28", features = ["io-util", "macros"] }
3939
# Stream utils
@@ -42,10 +42,10 @@ tracing = "0.1"
4242
typed-builder = "0.20"
4343

4444
[dev-dependencies]
45-
anyhow = "1.0.91"
46-
async-compression = { version = "0.4.13", features = ["tokio", "zstd"] }
47-
clap = { version = "4.5.20", features = ["derive"] }
48-
tempfile = "3.13.0"
49-
tokio = { version = "1.41", features = ["full"] }
50-
tracing-subscriber = "0.3.18"
45+
anyhow = "1.0.94"
46+
async-compression = { version = "0.4.18", features = ["tokio", "zstd"] }
47+
clap = { version = "4.5.23", features = ["derive"] }
48+
tempfile = "3.14.0"
49+
tokio = { version = "1.42", features = ["full"] }
50+
tracing-subscriber = "0.3.19"
5151
wiremock = "0.6"

src/historical/batch.rs

Lines changed: 2 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! The historical batch download API.
22
3-
#![allow(deprecated)] // Packaging
4-
53
use core::fmt;
64
use std::{
75
collections::HashMap,
@@ -50,12 +48,6 @@ impl BatchClient<'_> {
5048
("map_symbols", params.map_symbols.to_string()),
5149
("split_symbols", params.split_symbols.to_string()),
5250
("split_duration", params.split_duration.to_string()),
53-
(
54-
"packaging",
55-
params
56-
.packaging
57-
.map_or_else(|| "none".to_owned(), |p| p.to_string()),
58-
),
5951
("delivery", params.delivery.to_string()),
6052
("stype_in", params.stype_in.to_string()),
6153
("stype_out", params.stype_out.to_string()),
@@ -209,20 +201,6 @@ pub enum SplitDuration {
209201
Month,
210202
}
211203

212-
/// How the batch job will be packaged.
213-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
214-
#[deprecated(
215-
since = "0.16.0",
216-
note = "Use the `download()` method to download the whole job`"
217-
)]
218-
pub enum Packaging {
219-
/// ZIP compressed.
220-
Zip,
221-
/// Tarball.
222-
#[deprecated(since = "0.13.0", note = "Users should use Zip instead")]
223-
Tar,
224-
}
225-
226204
/// How the batch job will be delivered.
227205
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
228206
pub enum Delivery {
@@ -295,13 +273,6 @@ pub struct SubmitJobParams {
295273
/// Must be an integer between 1e9 and 10e9 inclusive (1GB - 10GB). Defaults to `None`.
296274
#[builder(default, setter(strip_option))]
297275
pub split_size: Option<NonZeroU64>,
298-
/// The optional archive type to package all batched data files in. Defaults to `None`.
299-
#[builder(default, setter(strip_option))]
300-
#[deprecated(
301-
since = "0.16.0",
302-
note = "Use the `download()` method to download the whole job`"
303-
)]
304-
pub packaging: Option<Packaging>,
305276
/// The delivery mechanism for the batched data files once processed. Defaults to
306277
/// [`Download`](Delivery::Download).
307278
#[builder(default)]
@@ -366,12 +337,6 @@ pub struct BatchJob {
366337
pub split_duration: SplitDuration,
367338
/// The maximum size for an individual file before splitting into multiple files.
368339
pub split_size: Option<NonZeroU64>,
369-
/// The packaging method of the batch data.
370-
#[deprecated(
371-
since = "0.16.0",
372-
note = "Use the `download()` method to download the whole job`"
373-
)]
374-
pub packaging: Option<Packaging>,
375340
/// The delivery mechanism of the batch data.
376341
pub delivery: Delivery,
377342
/// The number of data records (`None` until the job is processed).
@@ -485,47 +450,6 @@ impl<'de> Deserialize<'de> for SplitDuration {
485450
}
486451
}
487452

488-
impl Packaging {
489-
/// Converts the enum to its `str` representation.
490-
pub const fn as_str(&self) -> &'static str {
491-
match self {
492-
Packaging::Zip => "zip",
493-
Packaging::Tar => "tar",
494-
}
495-
}
496-
}
497-
498-
impl fmt::Display for Packaging {
499-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
500-
f.write_str(self.as_str())
501-
}
502-
}
503-
504-
impl FromStr for Packaging {
505-
type Err = crate::Error;
506-
507-
fn from_str(s: &str) -> Result<Self, Self::Err> {
508-
match s {
509-
"zip" => Ok(Packaging::Zip),
510-
"tar" => Ok(Packaging::Tar),
511-
_ => Err(crate::Error::bad_arg(
512-
"s",
513-
format!(
514-
"{s} does not correspond with any {} variant",
515-
std::any::type_name::<Self>()
516-
),
517-
)),
518-
}
519-
}
520-
}
521-
522-
impl<'de> Deserialize<'de> for Packaging {
523-
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
524-
let str = String::deserialize(deserializer)?;
525-
FromStr::from_str(&str).map_err(de::Error::custom)
526-
}
527-
}
528-
529453
impl Delivery {
530454
/// Converts the enum to its `str` representation.
531455
pub const fn as_str(&self) -> &'static str {
@@ -689,7 +613,6 @@ mod tests {
689613
"split_symbols": false,
690614
"split_duration": "day",
691615
"split_size": null,
692-
"packaging": null,
693616
"delivery": "download",
694617
"state": "queued",
695618
"ts_received": "2023-07-19T23:00:04.095538123Z",
@@ -710,14 +633,14 @@ mod tests {
710633
.batch()
711634
.submit_job(
712635
&SubmitJobParams::builder()
713-
.dataset(dbn::datasets::XNAS_ITCH)
636+
.dataset(dbn::Dataset::XnasItch)
714637
.schema(SCHEMA)
715638
.symbols("TSLA")
716639
.date_time_range((START, END))
717640
.build(),
718641
)
719642
.await?;
720-
assert_eq!(job_desc.dataset, dbn::datasets::XNAS_ITCH);
643+
assert_eq!(job_desc.dataset, dbn::Dataset::XnasItch.as_str());
721644
Ok(())
722645
}
723646

@@ -754,7 +677,6 @@ mod tests {
754677
"split_symbols": false,
755678
"split_duration": "day",
756679
"split_size": null,
757-
"packaging": null,
758680
"delivery": "download",
759681
"state": "processing",
760682
"ts_received": "2023-07-19 23:00:04.095538+00:00",

src/historical/symbology.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ mod tests {
210210
.symbology()
211211
.resolve(
212212
&ResolveParams::builder()
213-
.dataset(dbn::datasets::GLBX_MDP3)
213+
.dataset(dbn::Dataset::GlbxMdp3)
214214
.symbols(vec!["ES.c.0", "ES.d.0"])
215215
.stype_in(SType::Continuous)
216216
.date_range((date!(2023 - 06 - 14), date!(2023 - 06 - 17)))

src/historical/timeseries.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub struct GetRangeParams {
160160
#[builder(default)]
161161
pub limit: Option<NonZeroU64>,
162162
/// How to decode DBN from prior versions. Defaults to upgrade.
163-
#[builder(default = VersionUpgradePolicy::Upgrade)]
163+
#[builder(default = VersionUpgradePolicy::UpgradeToV2)]
164164
pub upgrade_policy: VersionUpgradePolicy,
165165
}
166166

@@ -191,7 +191,7 @@ pub struct GetRangeToFileParams {
191191
#[builder(default)]
192192
pub limit: Option<NonZeroU64>,
193193
/// How to decode DBN from prior versions. Defaults to upgrade.
194-
#[builder(default = VersionUpgradePolicy::Upgrade)]
194+
#[builder(default = VersionUpgradePolicy::UpgradeToV2)]
195195
pub upgrade_policy: VersionUpgradePolicy,
196196
/// The file path to persist the stream data to.
197197
#[builder(default, setter(transform = |p: impl Into<PathBuf>| p.into()))]
@@ -285,7 +285,7 @@ mod tests {
285285
.timeseries()
286286
.get_range(
287287
&GetRangeParams::builder()
288-
.dataset(dbn::datasets::XNAS_ITCH)
288+
.dataset(dbn::Dataset::XnasItch)
289289
.schema(SCHEMA)
290290
.symbols(vec!["SPOT", "AAPL"])
291291
.date_time_range((START, END))

src/live.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl Default for ClientBuilder<Unset, Unset> {
6464
key: Unset,
6565
dataset: Unset,
6666
send_ts_out: false,
67-
upgrade_policy: VersionUpgradePolicy::Upgrade,
67+
upgrade_policy: VersionUpgradePolicy::UpgradeToV2,
6868
heartbeat_interval: None,
6969
}
7070
}

src/live/protocol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl<'a> Challenge<'a> {
186186
}
187187
}
188188

189-
impl<'a> Display for Challenge<'a> {
189+
impl Display for Challenge<'_> {
190190
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
191191
write!(f, "{}", self.0)
192192
}

0 commit comments

Comments
 (0)