Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VER: Release 0.25.0 #72

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 0.25.0 - 2024-12-17

### Breaking changes
- Renamed `VersionUpgradePolicy::Upgrade` to `UpgradeToV2` in preparation for a future
DBN version 3

### Enhancements
- Added `v1` and `v2` modules to allow unambiguously referring to the record types for
a given DBN version regardless of whether the record type has changed. Previously
versioned aliases only existed for record types that have changed between DBN versions
- Added identical namespaces to `databento_dbn` Python package
- Changed `dataset()` method on `MetadataBuilder` to accept an `impl ToString` so now
`Dataset` and `&str` can be passed directly
- Added type aliases for `TBBOMsg`, `BBO1SMsg`, `BBO1MMsg`, `TCBBOMsg`, `CBBO1SMsg`,
`CBBO1MMsg` in Python

### Deprecations
- Deprecated `dataset` module. The top-level `Dataset` enum and its `const` `as_str()`
method provide the same functionality for all datasets. This module will be removed in
a future version

## 0.24.0 - 2024-12-10

### Enhancements
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resolver = "2"
[workspace.package]
authors = ["Databento <[email protected]>"]
edition = "2021"
version = "0.24.0"
version = "0.25.0"
documentation = "https://databento.com/docs"
repository = "https://github.com/databento/dbn"
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "databento-dbn"
version = "0.24.0"
version = "0.25.0"
description = "Python bindings for encoding and decoding Databento Binary Encoding (DBN)"
authors = ["Databento <[email protected]>"]
license = "Apache-2.0"
Expand All @@ -17,7 +17,7 @@ build-backend = "maturin"

[project]
name = "databento-dbn"
version = "0.24.0"
version = "0.25.0"
authors = [
{ name = "Databento", email = "[email protected]" }
]
Expand Down
16 changes: 13 additions & 3 deletions python/python/databento_dbn/_lib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -784,13 +784,15 @@ class VersionUpgradePolicy(Enum):

AS_IS
Decode data from previous versions as-is.
UPGRADE
Decode data from previous versions converting it to the latest version.
UPGRADE_TO_V2
Decode and convert data from DBN versions prior to version 2 to that version.
Attempting to decode data from newer versions (when they're introduced) will
fail.

"""

AS_IS: int
UPGRADE: int
UPGRADE_TO_V2: int

class Metadata(SupportsBytes):
"""
Expand Down Expand Up @@ -5324,3 +5326,11 @@ def update_encoded_metadata(
When the file update fails.

"""

# Aliases
TBBOMsg = MBOMsg
BBO1SMsg = BBOMsg
BBO1MMsg = BBOMsg
TCBBOMsg = CMBP1Msg
CBBO1SMsg = CBBOMsg
CBBO1MMsg = CBBOMsg
25 changes: 25 additions & 0 deletions python/python/databento_dbn/v1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ruff: noqa: F401, F811
from ._lib import BBOMsg
from ._lib import CBBOMsg
from ._lib import CMBP1Msg
from ._lib import ErrorMsgV1 as ErrorMsg
from ._lib import ImbalanceMsg
from ._lib import InstrumentDefMsgV1 as InstrumentDefMsg
from ._lib import MBOMsg
from ._lib import MBP1Msg
from ._lib import MBP10Msg
from ._lib import OHLCVMsg
from ._lib import StatMsg
from ._lib import StatusMsg
from ._lib import SymbolMappingMsgV1 as SymbolMappingMsg
from ._lib import SystemMsgV1 as SystemMsg
from ._lib import TradeMsg


# Aliases
TBBOMsg = MBP1Msg
BBO1SMsg = BBOMsg
BBO1MMsg = BBOMsg
TCBBOMsg = CMBP1Msg
CBBO1SMsg = CBBOMsg
CBBO1MMsg = CBBOMsg
25 changes: 25 additions & 0 deletions python/python/databento_dbn/v2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ruff: noqa: F401, F811
from ._lib import BBOMsg
from ._lib import CBBOMsg
from ._lib import CMBP1Msg
from ._lib import ErrorMsg
from ._lib import ImbalanceMsg
from ._lib import InstrumentDefMsg
from ._lib import MBOMsg
from ._lib import MBP1Msg
from ._lib import MBP10Msg
from ._lib import OHLCVMsg
from ._lib import StatMsg
from ._lib import StatusMsg
from ._lib import SymbolMappingMsg
from ._lib import SystemMsg
from ._lib import TradeMsg


# Aliases
TBBOMsg = MBP1Msg
BBO1SMsg = BBOMsg
BBO1MMsg = BBOMsg
TCBBOMsg = CMBP1Msg
CBBO1SMsg = CBBOMsg
CBBO1MMsg = CBBOMsg
7 changes: 3 additions & 4 deletions python/src/dbn_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,10 @@ impl DbnDecoder {
#[cfg(test)]
mod tests {
use dbn::{
datasets::XNAS_ITCH,
encode::{dbn::Encoder, EncodeRecord},
enums::{rtype, SType, Schema},
record::{ErrorMsg, OhlcvMsg, RecordHeader},
MetadataBuilder, DBN_VERSION,
Dataset, MetadataBuilder, DBN_VERSION,
};
use pyo3::{py_run, types::PyString};

Expand All @@ -148,7 +147,7 @@ mod tests {
let mut encoder = Encoder::new(
buffer,
&MetadataBuilder::new()
.dataset(XNAS_ITCH.to_owned())
.dataset(Dataset::XnasItch.to_string())
.schema(Some(Schema::Trades))
.stype_in(Some(SType::RawSymbol))
.stype_out(SType::InstrumentId)
Expand Down Expand Up @@ -191,7 +190,7 @@ mod tests {
let mut encoder = Encoder::new(
buffer,
&MetadataBuilder::new()
.dataset(XNAS_ITCH.to_owned())
.dataset(Dataset::XnasItch.to_string())
.schema(Some(Schema::Ohlcv1S))
.stype_in(Some(SType::RawSymbol))
.stype_out(SType::InstrumentId)
Expand Down
13 changes: 6 additions & 7 deletions python/src/transcoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,9 @@ mod tests {
use std::{io::Read, num::NonZeroU64};

use dbn::{
datasets::XNAS_ITCH,
encode::{DbnEncoder, EncodeRecord},
rtype, ErrorMsg, MappingInterval, MetadataBuilder, OhlcvMsg, RecordHeader, SType, Schema,
SymbolMapping, SymbolMappingMsg, WithTsOut, DBN_VERSION, UNDEF_TIMESTAMP,
rtype, Dataset, ErrorMsg, MappingInterval, MetadataBuilder, OhlcvMsg, RecordHeader, SType,
Schema, SymbolMapping, SymbolMappingMsg, WithTsOut, DBN_VERSION, UNDEF_TIMESTAMP,
};
use rstest::rstest;
use time::macros::{date, datetime};
Expand Down Expand Up @@ -508,7 +507,7 @@ mod tests {
let mut encoder = DbnEncoder::new(
Vec::new(),
&MetadataBuilder::new()
.dataset(XNAS_ITCH.to_owned())
.dataset(Dataset::XnasItch.to_string())
.schema(Some(Schema::Trades))
.stype_in(Some(SType::RawSymbol))
.stype_out(SType::InstrumentId)
Expand Down Expand Up @@ -579,7 +578,7 @@ mod tests {
let mut encoder = DbnEncoder::new(
buffer,
&MetadataBuilder::new()
.dataset(XNAS_ITCH.to_owned())
.dataset(Dataset::XnasItch.to_string())
.schema(Some(Schema::Ohlcv1S))
.stype_in(Some(SType::RawSymbol))
.stype_out(SType::InstrumentId)
Expand Down Expand Up @@ -657,7 +656,7 @@ mod tests {
let mut encoder = DbnEncoder::new(
buffer,
&MetadataBuilder::new()
.dataset(XNAS_ITCH.to_owned())
.dataset(Dataset::XnasItch.to_string())
.schema(Some(Schema::Ohlcv1S))
.stype_in(Some(SType::RawSymbol))
.stype_out(SType::InstrumentId)
Expand Down Expand Up @@ -783,7 +782,7 @@ mod tests {
let mut encoder = DbnEncoder::new(
buffer,
&MetadataBuilder::new()
.dataset(XNAS_ITCH.to_owned())
.dataset(Dataset::XnasItch.to_string())
.schema(None) // Live: mixed schema
.stype_in(Some(SType::RawSymbol))
.stype_out(SType::InstrumentId)
Expand Down
2 changes: 1 addition & 1 deletion rust/dbn-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name = "dbn"
path = "src/main.rs"

[dependencies]
dbn = { path = "../dbn", version = "=0.24.0", default-features = false }
dbn = { path = "../dbn", version = "=0.25.0", default-features = false }

anyhow = { workspace = true }
clap = { version = "4.5", features = ["derive", "wrap_help"] }
Expand Down
2 changes: 1 addition & 1 deletion rust/dbn-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl Args {

pub fn upgrade_policy(&self) -> VersionUpgradePolicy {
if self.should_upgrade {
VersionUpgradePolicy::Upgrade
VersionUpgradePolicy::UpgradeToV2
} else {
VersionUpgradePolicy::AsIs
}
Expand Down
2 changes: 1 addition & 1 deletion rust/dbn/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ serde = ["dep:serde", "time/parsing", "time/serde"]
trivial_copy = []

[dependencies]
dbn-macros = { version = "=0.24.0", path = "../dbn-macros" }
dbn-macros = { version = "=0.25.0", path = "../dbn-macros" }

async-compression = { version = "0.4.18", features = ["tokio", "zstd"], optional = true }
csv = { workspace = true }
Expand Down
Loading
Loading