diff --git a/CHANGELOG.md b/CHANGELOG.md index a609419..79f62c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 7267dbf..c5b72db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" ) diff --git a/examples/live/live_smoke_test.cpp b/examples/live/live_smoke_test.cpp index 7f4e93a..24dcc22 100644 --- a/examples/live/live_smoke_test.cpp +++ b/examples/live/live_smoke_test.cpp @@ -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()) { std::stringstream ss; @@ -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; @@ -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()) { @@ -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); } diff --git a/include/databento/batch.hpp b/include/databento/batch.hpp index d42fe5c..d505e3c 100644 --- a/include/databento/batch.hpp +++ b/include/databento/batch.hpp @@ -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; diff --git a/include/databento/enums.hpp b/include/databento/enums.hpp index 46ded96..128bc71 100644 --- a/include/databento/enums.hpp +++ b/include/databento/enums.hpp @@ -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 diff --git a/pkg/PKGBUILD b/pkg/PKGBUILD index 27752cb..7a1c703 100644 --- a/pkg/PKGBUILD +++ b/pkg/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Databento _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') diff --git a/src/batch.cpp b/src/batch.cpp index b3c9dbe..5939c02 100644 --- a/src/batch.cpp +++ b/src/batch.cpp @@ -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(symbol_helper.Finish())) diff --git a/src/enums.cpp b/src/enums.cpp index 084b4aa..65f865a 100644 --- a/src/enums.cpp +++ b/src/enums.cpp @@ -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"; } @@ -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", "str", "unknown value '" + str + '\''}; } diff --git a/src/historical.cpp b/src/historical.cpp index 0ced860..9df88a0 100644 --- a/src/historical.cpp +++ b/src/historical.cpp @@ -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(endpoint, json, "user_id"); - res.bill_id = ParseAt(endpoint, json, "bill_id"); res.cost_usd = ParseAt(endpoint, json, "cost_usd"); res.dataset = ParseAt(endpoint, json, "dataset"); res.symbols = ParseAt>(endpoint, json, "symbols"); diff --git a/tests/src/batch_tests.cpp b/tests/src/batch_tests.cpp index 747f9ff..55d6521 100644 --- a/tests/src/batch_tests.cpp +++ b/tests/src/batch_tests.cpp @@ -8,7 +8,6 @@ namespace databento::tests { TEST(BatchTests, TestBatchJobToString) { const BatchJob target{"aNiD", "USER", - "57db", 12.39, dataset::kXnasItch, {"CL.FUT"}, @@ -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" }, diff --git a/tests/src/historical_tests.cpp b/tests/src/historical_tests.cpp index 9fe2011..c7361f8 100644 --- a/tests/src/historical_tests.cpp +++ b/tests/src/historical_tests.cpp @@ -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}, @@ -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}, @@ -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},