Skip to content

Commit 920c7d1

Browse files
authored
VER: 0.31.0
2 parents 9fa2466 + 2d876b3 commit 920c7d1

File tree

13 files changed

+215
-80
lines changed

13 files changed

+215
-80
lines changed

CHANGELOG.md

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

3+
## 0.31.0 - 2025-04-01
4+
5+
### Enhancements
6+
- Added `Ord` and `PartialOrd` implementations for all enums and `FlagSet` to allow
7+
for use in ordered containers like `BTreeMap`
8+
- Added `decode_records()` method to `AsyncDbnDecoder` and `AsyncDbnRecordDecoder`
9+
which is similar to the sync decoder methods of the same name
10+
- Upgraded `pyo3` version to 0.24.1
11+
- Upgraded `time` version to 0.3.41
12+
13+
### Breaking changes
14+
- Removed deprecated `dataset` module. The top-level `Dataset` enum and its `const` `as_str()`
15+
method provide the same functionality for all datasets
16+
- Removed deprecated `SymbolIndex::get_for_rec_ref()` method
17+
18+
### Bug fixes
19+
- Fixed Python type annotation for `SystemMsg::is_heartbeat()` method that was previously
20+
annotated as a property
21+
322
## 0.30.0 - 2025-03-25
423

524
### Enhancements

Cargo.lock

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ resolver = "2"
1111
[workspace.package]
1212
authors = ["Databento <[email protected]>"]
1313
edition = "2021"
14-
version = "0.30.0"
14+
version = "0.31.0"
1515
documentation = "https://databento.com/docs"
1616
repository = "https://github.com/databento/dbn"
1717
license = "Apache-2.0"
1818

1919
[workspace.dependencies]
2020
anyhow = "1.0.97"
2121
csv = "1.3"
22-
pyo3 = "0.24.0"
23-
pyo3-build-config = "0.24.0"
22+
pyo3 = "0.24.1"
23+
pyo3-build-config = "0.24.1"
2424
rstest = "0.25.0"
2525
serde = { version = "1.0", features = ["derive"] }
26-
time = ">=0.3.35"
26+
time = "0.3.41"
2727
zstd = "0.13"

python/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "databento-dbn"
3-
version = "0.30.0"
3+
version = "0.31.0"
44
description = "Python bindings for encoding and decoding Databento Binary Encoding (DBN)"
55
authors = ["Databento <[email protected]>"]
66
license = "Apache-2.0"
@@ -17,7 +17,7 @@ build-backend = "maturin"
1717

1818
[project]
1919
name = "databento-dbn"
20-
version = "0.30.0"
20+
version = "0.31.0"
2121
authors = [
2222
{ name = "Databento", email = "[email protected]" }
2323
]

python/python/databento_dbn/_lib.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6094,10 +6094,9 @@ class SystemMsgV1(Record):
60946094
60956095
"""
60966096

6097-
@property
60986097
def is_heartbeat(self) -> bool:
60996098
"""
6100-
`true` if this message is a heartbeat, used to indicate the connection
6099+
Return `true` if this message is a heartbeat, used to indicate the connection
61016100
with the gateway is still open.
61026101
61036102
Returns

rust/dbn-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ name = "dbn"
1616
path = "src/main.rs"
1717

1818
[dependencies]
19-
dbn = { path = "../dbn", version = "=0.30.0", default-features = false }
19+
dbn = { path = "../dbn", version = "=0.31.0", default-features = false }
2020

2121
anyhow = { workspace = true }
2222
clap = { version = "4.5", features = ["derive", "wrap_help"] }

rust/dbn/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ serde = ["dep:serde", "time/parsing", "time/serde"]
2525
trivial_copy = []
2626

2727
[dependencies]
28-
dbn-macros = { version = "=0.30.0", path = "../dbn-macros" }
28+
dbn-macros = { version = "=0.31.0", path = "../dbn-macros" }
2929

3030
async-compression = { version = "0.4.22", features = ["tokio", "zstd"], optional = true }
3131
csv = { workspace = true }

rust/dbn/src/decode/dbn/async.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,20 @@ where
123123
self.decoder.decode().await
124124
}
125125

126+
/// Tries to decode all records into a `Vec`. This eagerly decodes the data.
127+
///
128+
/// # Errors
129+
/// This function returns an error if the underlying reader returns an error. If
130+
/// the next record is of a different type than `T`, this function returns a
131+
/// [`Error::Conversion`](crate::Error::Conversion) error.
132+
///
133+
/// # Cancel safety
134+
/// This method is not cancellation safe. If used within a `tokio::select!` statement
135+
/// partially decoded records will be lost and the stream may be corrupted.
136+
pub async fn decode_records<T: HasRType + Clone>(&mut self) -> Result<Vec<T>> {
137+
self.decoder.decode_records().await
138+
}
139+
126140
/// Tries to decode a single record and returns a reference to the record that
127141
/// lasts until the next method call. Returns `Ok(None)` if `reader` has been
128142
/// exhausted.
@@ -335,6 +349,24 @@ where
335349
}
336350
}
337351

352+
/// Tries to decode all records into a `Vec`. This eagerly decodes the data.
353+
///
354+
/// # Errors
355+
/// This function returns an error if the underlying reader returns an error. If
356+
/// the next record is of a different type than `T`, this function returns a
357+
/// [`Error::Conversion`](crate::Error::Conversion) error.
358+
///
359+
/// # Cancel safety
360+
/// This method is not cancellation safe. If used within a `tokio::select!` statement
361+
/// partially decoded records will be lost and the stream may be corrupted.
362+
pub async fn decode_records<T: HasRType + Clone>(&mut self) -> Result<Vec<T>> {
363+
let mut res = Vec::new();
364+
while let Some(rec) = self.decode::<T>().await? {
365+
res.push(rec.clone());
366+
}
367+
Ok(res)
368+
}
369+
338370
/// Tries to decode a single record and returns a reference to the record that
339371
/// lasts until the next method call. Returns `None` if `reader` has been
340372
/// exhausted.

0 commit comments

Comments
 (0)