Skip to content
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.42.0 - 2025-08-19

### Enhancements
- Added `EndOfInterval` variant to `SystemCode`

### Breaking changes
- Removed `bill_id` field from `BatchJob` struct

## 0.41.0 - 2025-08-12

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24..4.0)

project(
databento
VERSION 0.41.0
VERSION 0.42.0
LANGUAGES CXX
DESCRIPTION "Official Databento client library"
)
Expand Down
10 changes: 4 additions & 6 deletions examples/live/live_smoke_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void ProcessRecords(db::LiveBlocking& client, db::Schema schema,

while (auto record = client.NextRecord(timeout)) {
if (record->RType() == expected_rtype) {
std::cout << "Received expected record type " << expected_rtype << '\n';
std::cout << "Received expected record type \n";
break;
} else if (auto* msg = record->GetIf<db::ErrorMsg>()) {
std::stringstream ss;
Expand All @@ -66,13 +66,11 @@ void ProcessRecords(db::LiveBlocking& client, db::Schema schema,
std::cout << "Finished client\n";
}

void ProcessSnapshotRecords(db::LiveBlocking& client, db::Schema schema) {
void ProcessSnapshotRecords(db::LiveBlocking& client) {
client.Start();

std::cout << "Starting client...\n";

const auto expected_rtype = db::Record::RTypeFromSchema(schema);

constexpr auto timeout = std::chrono::seconds{30};

auto received_snapshot_record = false;
Expand All @@ -82,7 +80,7 @@ void ProcessSnapshotRecords(db::LiveBlocking& client, db::Schema schema) {
if (mbo_msg->flags.IsSnapshot()) {
received_snapshot_record = true;
} else {
std::cout << "Received expected record type " << expected_rtype << '\n';
std::cout << "Received expected record type\n";
break;
}
} else if (auto* error_msg = record->GetIf<db::ErrorMsg>()) {
Expand Down Expand Up @@ -195,7 +193,7 @@ int main(int argc, char* argv[]) {
}

if (use_snapshot) {
ProcessSnapshotRecords(client, schema);
ProcessSnapshotRecords(client);
} else {
ProcessRecords(client, schema, start_from_epoch);
}
Expand Down
1 change: 0 additions & 1 deletion include/databento/batch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace databento {
struct BatchJob {
std::string id;
std::string user_id;
std::string bill_id;
// Cost in US dollars
double cost_usd;
std::string dataset;
Expand Down
3 changes: 3 additions & 0 deletions include/databento/enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,9 @@ enum SystemCode : std::uint8_t {
SlowReaderWarning = 2,
// Indicates a replay subscription has caught up with real-time data.
ReplayCompleted = 3,
// Signals that all records for interval-based schemas have been published for the
// given timestamp.
EndOfInterval = 4,
Unset = 255,
};
} // namespace system_code
Expand Down
2 changes: 1 addition & 1 deletion pkg/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Databento <support@databento.com>
_pkgname=databento-cpp
pkgname=databento-cpp-git
pkgver=0.41.0
pkgver=0.42.0
pkgrel=1
pkgdesc="Official C++ client for Databento"
arch=('any')
Expand Down
1 change: 0 additions & 1 deletion src/batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ std::ostream& operator<<(std::ostream& stream, const BatchJob& batch_job) {
.Build()
.AddField("id", batch_job.id)
.AddField("user_id", batch_job.user_id)
.AddField("bill_id", batch_job.bill_id)
.AddField("cost_usd", batch_job.cost_usd)
.AddField("dataset", batch_job.dataset)
.AddField("symbols", static_cast<std::ostringstream&>(symbol_helper.Finish()))
Expand Down
6 changes: 6 additions & 0 deletions src/enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,9 @@ const char* ToString(SystemCode system_code) {
case SystemCode::ReplayCompleted: {
return "replay_completed";
}
case SystemCode::EndOfInterval: {
return "end_of_interval";
}
default: {
return "Unknown";
}
Expand Down Expand Up @@ -1233,6 +1236,9 @@ SystemCode FromString(const std::string& str) {
if (str == "replay_completed") {
return SystemCode::ReplayCompleted;
}
if (str == "end_of_interval") {
return SystemCode::EndOfInterval;
}
throw InvalidArgumentError{"FromString<SystemCode>", "str",
"unknown value '" + str + '\''};
}
Expand Down
1 change: 0 additions & 1 deletion src/historical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ databento::BatchJob Parse(const std::string& endpoint, const nlohmann::json& jso
databento::BatchJob res;
res.id = CheckedAt(endpoint, json, "id");
res.user_id = ParseAt<std::string>(endpoint, json, "user_id");
res.bill_id = ParseAt<std::string>(endpoint, json, "bill_id");
res.cost_usd = ParseAt<double>(endpoint, json, "cost_usd");
res.dataset = ParseAt<std::string>(endpoint, json, "dataset");
res.symbols = ParseAt<std::vector<std::string>>(endpoint, json, "symbols");
Expand Down
2 changes: 0 additions & 2 deletions tests/src/batch_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace databento::tests {
TEST(BatchTests, TestBatchJobToString) {
const BatchJob target{"aNiD",
"USER",
"57db",
12.39,
dataset::kXnasItch,
{"CL.FUT"},
Expand Down Expand Up @@ -41,7 +40,6 @@ TEST(BatchTests, TestBatchJobToString) {
ASSERT_EQ(res, R"(BatchJob {
id = "aNiD",
user_id = "USER",
bill_id = "57db",
cost_usd = 12.39,
dataset = "XNAS.ITCH",
symbols = { "CL.FUT" },
Expand Down
3 changes: 0 additions & 3 deletions tests/src/historical_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class HistoricalTests : public ::testing::Test {
TEST_F(HistoricalTests, TestBatchSubmitJob) {
const nlohmann::json kResp{
{"actual_size", 2022690},
{"bill_id", "73186317471eb623d161a1"},
{"billed_size", 5156064},
{"compression", nullptr},
{"cost_usd", 0.119089},
Expand Down Expand Up @@ -125,7 +124,6 @@ TEST_F(HistoricalTests, TestBatchSubmitJob) {

TEST_F(HistoricalTests, TestBatchListJobs) {
const nlohmann::json kResp{{{"actual_size", 2022690},
{"bill_id", "a670"},
{"billed_size", 5156064},
{"compression", "zstd"},
{"cost_usd", 0.119089},
Expand Down Expand Up @@ -158,7 +156,6 @@ TEST_F(HistoricalTests, TestBatchListJobs) {
{"ts_received", "2022-10-31 15:26:58.112496+00:00"},
{"user_id", "A_USER"}},
{{"actual_size", 2022690},
{"bill_id", "a1b7"},
{"billed_size", 5156064},
{"compression", "zstd"},
{"cost_usd", 0.119089},
Expand Down
Loading