Skip to content

Commit ad906cc

Browse files
authored
VER: Release 0.19.0
2 parents 1a3fca3 + c137d42 commit ad906cc

File tree

4 files changed

+45
-35
lines changed

4 files changed

+45
-35
lines changed

CHANGELOG.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 0.19.0 - 2025-01-21
4+
5+
### Enhancements
6+
- Upgraded DBN version to 0.27.0:
7+
- Updated enumerations for unreleased US equities datasets and publishers
8+
- Added new venue `EQUS` for consolidated US equities
9+
- Added new dataset `EQUS.MINI` and new publishers `EQUS.MINI.EQUS` and
10+
`XNYS.TRADES.EQUS`
11+
12+
### Bug fixes
13+
- Changed historical metadata methods with `symbols` parameter to use a `POST` request
14+
to allow for requesting supported maximum of 2000 symbols
15+
316
## 0.18.0 - 2025-01-08
417

518
### Enhancements
@@ -15,7 +28,8 @@
1528
- Decoding streams: `MergeDecoder` and `MergeRecordDecoder` structs
1629
- Metadata: `MergeDecoder` struct and `Metadata::merge()` method
1730
- In the CLI: specify more than one input file to initiate a merge
18-
- Eliminated `unsafe` in `From` implementations for record structs from different versions
31+
- Eliminated `unsafe` in `From` implementations for record structs from different
32+
versions
1933

2034
## 0.17.0 - 2024-12-17
2135

@@ -47,8 +61,8 @@
4761

4862
#### Deprecations
4963
- Deprecated `Packaging` enum and `packaging` field on `SubmitJobParams` and `BatchJob`.
50-
These will be removed in a future version. All files from a batch job can be downloaded
51-
with the `batch().download()` method on the historical client
64+
These will be removed in a future version. All files from a batch job can be
65+
downloaded with the `batch().download()` method on the historical client
5266

5367
## 0.15.0 - 2024-10-22
5468

@@ -174,11 +188,13 @@
174188
## 0.9.0 - 2024-05-14
175189

176190
#### Enhancements
177-
- Added `start` and `end` fields to the `DatasetRange` struct which provide time resolution and an exclusive end date
191+
- Added `start` and `end` fields to the `DatasetRange` struct which provide time
192+
resolution and an exclusive end date
178193
- Upgraded DBN version to 0.17.1
179194

180195
#### Deprecations
181-
- The `start_date` and `end_date` fields of the `DatasetRange` struct are deprecated and will be removed in a future release
196+
- The `start_date` and `end_date` fields of the `DatasetRange` struct are deprecated and
197+
will be removed in a future release
182198

183199
## 0.8.0 - 2024-04-01
184200

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "databento"
33
authors = ["Databento <[email protected]>"]
4-
version = "0.18.0"
4+
version = "0.19.0"
55
edition = "2021"
66
repository = "https://github.com/databento/databento-rs"
77
description = "Official Databento client library"
@@ -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.26.0", features = ["async", "serde"] }
26+
dbn = { version = "0.27.0", features = ["async", "serde"] }
2727
# Async stream trait
2828
futures = { version = "0.3", optional = true }
2929
# Used for Live authentication

src/historical/metadata.rs

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,9 @@ impl MetadataClient<'_> {
136136
/// This function returns an error when it fails to communicate with the Databento API
137137
/// or the API indicates there's an issue with the request.
138138
pub async fn get_record_count(&mut self, params: &GetRecordCountParams) -> crate::Result<u64> {
139-
let resp = self
140-
.get("get_record_count")?
141-
.add_to_query(params)
142-
.send()
143-
.await?;
139+
let mut form = Vec::new();
140+
params.add_to_form(&mut form);
141+
let resp = self.post("get_record_count")?.form(&form).send().await?;
144142
handle_response(resp).await
145143
}
146144

@@ -154,11 +152,9 @@ impl MetadataClient<'_> {
154152
&mut self,
155153
params: &GetBillableSizeParams,
156154
) -> crate::Result<u64> {
157-
let resp = self
158-
.get("get_billable_size")?
159-
.add_to_query(params)
160-
.send()
161-
.await?;
155+
let mut form = Vec::new();
156+
params.add_to_form(&mut form);
157+
let resp = self.post("get_billable_size")?.form(&form).send().await?;
162158
handle_response(resp).await
163159
}
164160

@@ -169,13 +165,19 @@ impl MetadataClient<'_> {
169165
/// This function returns an error when it fails to communicate with the Databento API
170166
/// or the API indicates there's an issue with the request.
171167
pub async fn get_cost(&mut self, params: &GetCostParams) -> crate::Result<f64> {
172-
let resp = self.get("get_cost")?.add_to_query(params).send().await?;
168+
let mut form = Vec::new();
169+
params.add_to_form(&mut form);
170+
let resp = self.post("get_cost")?.form(&form).send().await?;
173171
handle_response(resp).await
174172
}
175173

176174
fn get(&mut self, slug: &str) -> crate::Result<RequestBuilder> {
177175
self.inner.get(&format!("metadata.{slug}"))
178176
}
177+
178+
fn post(&mut self, slug: &str) -> crate::Result<RequestBuilder> {
179+
self.inner.post(&format!("metadata.{slug}"))
180+
}
179181
}
180182

181183
/// A type of data feed.
@@ -284,7 +286,6 @@ pub struct DatasetRange {
284286
pub end: time::OffsetDateTime,
285287
}
286288

287-
#[allow(deprecated)]
288289
impl<'de> Deserialize<'de> for DatasetRange {
289290
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
290291
where
@@ -430,20 +431,16 @@ fn deserialize_date<'de, D: serde::Deserializer<'de>>(
430431
let dt_str = String::deserialize(deserializer)?;
431432
time::Date::parse(&dt_str, super::DATE_FORMAT).map_err(serde::de::Error::custom)
432433
}
433-
impl AddToQuery<GetQueryParams> for reqwest::RequestBuilder {
434-
fn add_to_query(mut self, params: &GetQueryParams) -> Self {
435-
self = self
436-
.query(&[
437-
("dataset", params.dataset.as_str()),
438-
("schema", params.schema.as_str()),
439-
("stype_in", params.stype_in.as_str()),
440-
])
441-
.add_to_query(&params.symbols)
442-
.add_to_query(&params.date_time_range);
443-
if let Some(limit) = params.limit {
444-
self = self.query(&[("limit", &limit.to_string())]);
434+
impl GetQueryParams {
435+
fn add_to_form(&self, form: &mut Vec<(&'static str, String)>) {
436+
form.push(("dataset", self.dataset.to_string()));
437+
form.push(("schema", self.schema.to_string()));
438+
form.push(("stype_in", self.stype_in.to_string()));
439+
form.push(("symbols", self.symbols.to_api_string()));
440+
self.date_time_range.add_to_form(form);
441+
if let Some(limit) = self.limit {
442+
form.push(("limit", limit.get().to_string()))
445443
}
446-
self
447444
}
448445
}
449446

@@ -650,7 +647,6 @@ mod tests {
650647
}
651648

652649
#[tokio::test]
653-
#[allow(deprecated)]
654650
async fn test_get_dataset_range() {
655651
const DATASET: &str = "XNAS.ITCH";
656652
let mock_server = MockServer::start().await;
@@ -679,7 +675,6 @@ mod tests {
679675
}
680676

681677
#[tokio::test]
682-
#[allow(deprecated)]
683678
async fn test_get_dataset_range_no_dates() {
684679
const DATASET: &str = "XNAS.ITCH";
685680
let mock_server = MockServer::start().await;

src/live/client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ impl fmt::Debug for Client {
244244
}
245245

246246
#[cfg(test)]
247-
#[allow(deprecated)]
248247
mod tests {
249248
use std::{ffi::c_char, fmt};
250249

0 commit comments

Comments
 (0)