Skip to content

Commit c635b15

Browse files
committed
DEL: Remove deprecated packaging option
1 parent 70c591f commit c635b15

File tree

8 files changed

+20
-78
lines changed

8 files changed

+20
-78
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.26.0 - TBD
4+
5+
### Breaking changes
6+
- Removed deprecated `Packaging` enum and `packaging` field that's no longer supported
7+
by the API
8+
39
## 0.25.0 - 2024-11-12
410

511
### Enhancements

include/databento/batch.hpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <string>
66
#include <vector>
77

8-
#include "databento/enums.hpp" // JobState, Delivery, Packaging, Schema, SType
8+
#include "databento/enums.hpp" // JobState, Delivery, Schema, SType
99

1010
namespace databento {
1111
// Description of a batch job.
@@ -31,8 +31,6 @@ struct BatchJob {
3131
SplitDuration split_duration;
3232
std::uint64_t split_size;
3333
bool split_symbols;
34-
// NOTE: deprecated and will be removed in a future version
35-
Packaging packaging;
3634
Delivery delivery;
3735
std::uint64_t record_count;
3836
// Size in bytes.

include/databento/enums.hpp

-13
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,6 @@ enum class SplitDuration : std::uint8_t {
8585
None,
8686
};
8787

88-
// Represents how a batch job will be packaged.
89-
//
90-
// NOTE: Deprecated now that all batch jobs can be downloaded as a ZIP file.
91-
enum class Packaging : std::uint8_t {
92-
None = 0,
93-
Zip,
94-
TarDeprecated,
95-
};
96-
9788
// Represents how a batch job will be delivered.
9889
enum class Delivery : std::uint8_t {
9990
Download,
@@ -462,7 +453,6 @@ const char* ToString(FeedMode mode);
462453
const char* ToString(Compression compression);
463454
const char* ToString(SType stype);
464455
const char* ToString(SplitDuration duration_interval);
465-
const char* ToString(Packaging packaging);
466456
const char* ToString(Delivery delivery);
467457
const char* ToString(JobState state);
468458
const char* ToString(DatasetCondition condition);
@@ -487,7 +477,6 @@ std::ostream& operator<<(std::ostream& out, FeedMode mode);
487477
std::ostream& operator<<(std::ostream& out, Compression compression);
488478
std::ostream& operator<<(std::ostream& out, SType stype);
489479
std::ostream& operator<<(std::ostream& out, SplitDuration duration_interval);
490-
std::ostream& operator<<(std::ostream& out, Packaging packaging);
491480
std::ostream& operator<<(std::ostream& out, Delivery delivery);
492481
std::ostream& operator<<(std::ostream& out, JobState state);
493482
std::ostream& operator<<(std::ostream& out, DatasetCondition condition);
@@ -522,8 +511,6 @@ SType FromString(const std::string& str);
522511
template <>
523512
SplitDuration FromString(const std::string& str);
524513
template <>
525-
Packaging FromString(const std::string& str);
526-
template <>
527514
Delivery FromString(const std::string& str);
528515
template <>
529516
JobState FromString(const std::string& str);

include/databento/historical.hpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "databento/datetime.hpp" // DateRange, DateTimeRange, UnixNanos
1010
#include "databento/dbn_file_store.hpp"
1111
#include "databento/detail/http_client.hpp" // HttpClient
12-
#include "databento/enums.hpp" // BatchState, Delivery, DurationInterval, Packaging, Schema, SType
12+
#include "databento/enums.hpp" // BatchState, Delivery, DurationInterval, Schema, SType
1313
#include "databento/metadata.hpp" // DatasetConditionDetail, DatasetRange, FieldDetail, PublisherDetail, UnitPricesForMode
1414
#include "databento/symbology.hpp" // SymbologyResolution
1515
#include "databento/timeseries.hpp" // KeepGoing, MetadataCallback, RecordCallback
@@ -52,19 +52,17 @@ class Historical {
5252
Encoding encoding, Compression compression,
5353
bool pretty_px, bool pretty_ts, bool map_symbols,
5454
bool split_symbols, SplitDuration split_duration,
55-
std::uint64_t split_size, Packaging packaging,
56-
Delivery delivery, SType stype_in, SType stype_out,
57-
std::uint64_t limit);
55+
std::uint64_t split_size, Delivery delivery,
56+
SType stype_in, SType stype_out, std::uint64_t limit);
5857
BatchJob BatchSubmitJob(const std::string& dataset,
5958
const std::vector<std::string>& symbols,
6059
Schema schema,
6160
const DateTimeRange<std::string>& datetime_range,
6261
Encoding encoding, Compression compression,
6362
bool pretty_px, bool pretty_ts, bool map_symbols,
6463
bool split_symbols, SplitDuration split_duration,
65-
std::uint64_t split_size, Packaging packaging,
66-
Delivery delivery, SType stype_in, SType stype_out,
67-
std::uint64_t limit);
64+
std::uint64_t split_size, Delivery delivery,
65+
SType stype_in, SType stype_out, std::uint64_t limit);
6866
std::vector<BatchJob> BatchListJobs();
6967
std::vector<BatchJob> BatchListJobs(const std::vector<JobState>& states,
7068
UnixNanos since);

src/batch.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ std::ostream& operator<<(std::ostream& stream, const BatchJob& batch_job) {
4040
.AddField("split_duration", batch_job.split_duration)
4141
.AddField("split_size", batch_job.split_size)
4242
.AddField("split_symbols", batch_job.split_symbols)
43-
.AddField("packaging", batch_job.packaging)
4443
.AddField("delivery", batch_job.delivery)
4544
.AddField("record_count", batch_job.record_count)
4645
.AddField("billed_size", batch_job.billed_size)

src/enums.cpp

-37
Original file line numberDiff line numberDiff line change
@@ -180,23 +180,6 @@ const char* ToString(SplitDuration duration_interval) {
180180
}
181181
}
182182

183-
const char* ToString(Packaging packaging) {
184-
switch (packaging) {
185-
case Packaging::None: {
186-
return "none";
187-
}
188-
case Packaging::Zip: {
189-
return "zip";
190-
}
191-
case Packaging::TarDeprecated: {
192-
return "tar";
193-
}
194-
default: {
195-
return "unknown";
196-
}
197-
}
198-
}
199-
200183
const char* ToString(Delivery delivery) {
201184
switch (delivery) {
202185
case Delivery::Download: {
@@ -804,11 +787,6 @@ std::ostream& operator<<(std::ostream& out, SplitDuration duration_interval) {
804787
return out;
805788
}
806789

807-
std::ostream& operator<<(std::ostream& out, Packaging packaging) {
808-
out << ToString(packaging);
809-
return out;
810-
}
811-
812790
std::ostream& operator<<(std::ostream& out, Delivery delivery) {
813791
out << ToString(delivery);
814792
return out;
@@ -1042,21 +1020,6 @@ SplitDuration FromString(const std::string& str) {
10421020
"unknown value '" + str + '\''};
10431021
}
10441022

1045-
template <>
1046-
Packaging FromString(const std::string& str) {
1047-
if (str == "none") {
1048-
return Packaging::None;
1049-
}
1050-
if (str == "zip") {
1051-
return Packaging::Zip;
1052-
}
1053-
if (str == "tar") {
1054-
return Packaging::TarDeprecated;
1055-
}
1056-
throw InvalidArgumentError{"FromString<Packaging>", "str",
1057-
"unknown value '" + str + '\''};
1058-
}
1059-
10601023
template <>
10611024
Delivery FromString(const std::string& str) {
10621025
if (str == "download") {

src/historical.cpp

+8-15
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ databento::BatchJob Parse(const std::string& endpoint,
6565
using databento::Encoding;
6666
using databento::JobState;
6767
using databento::JsonResponseError;
68-
using databento::Packaging;
6968
using databento::Schema;
7069
using databento::SplitDuration;
7170
using databento::SType;
@@ -100,8 +99,6 @@ databento::BatchJob Parse(const std::string& endpoint,
10099
endpoint, json, "split_duration", SplitDuration::None);
101100
res.split_size = ParseAt<std::uint64_t>(endpoint, json, "split_size");
102101
res.split_symbols = ParseAt<bool>(endpoint, json, "split_symbols");
103-
res.packaging = FromCheckedAtStringOrNull<Packaging>(
104-
endpoint, json, "packaging", Packaging::None);
105102
res.delivery = FromCheckedAtString<Delivery>(endpoint, json, "delivery");
106103
res.record_count = ParseAt<std::uint64_t>(endpoint, json, "record_count");
107104
res.billed_size = ParseAt<std::uint64_t>(endpoint, json, "billed_size");
@@ -170,26 +167,24 @@ databento::BatchJob Historical::BatchSubmitJob(
170167
Schema schema, const DateTimeRange<UnixNanos>& datetime_range) {
171168
return this->BatchSubmitJob(dataset, symbols, schema, datetime_range,
172169
kDefaultEncoding, kDefaultCompression, {}, {}, {},
173-
{}, SplitDuration::Day, {}, Packaging::None,
174-
Delivery::Download, kDefaultSTypeIn,
175-
kDefaultSTypeOut, {});
170+
{}, SplitDuration::Day, {}, Delivery::Download,
171+
kDefaultSTypeIn, kDefaultSTypeOut, {});
176172
}
177173
databento::BatchJob Historical::BatchSubmitJob(
178174
const std::string& dataset, const std::vector<std::string>& symbols,
179175
Schema schema, const DateTimeRange<std::string>& datetime_range) {
180176
return this->BatchSubmitJob(dataset, symbols, schema, datetime_range,
181177
kDefaultEncoding, kDefaultCompression, {}, {}, {},
182-
{}, SplitDuration::Day, {}, Packaging::None,
183-
Delivery::Download, kDefaultSTypeIn,
184-
kDefaultSTypeOut, {});
178+
{}, SplitDuration::Day, {}, Delivery::Download,
179+
kDefaultSTypeIn, kDefaultSTypeOut, {});
185180
}
186181
databento::BatchJob Historical::BatchSubmitJob(
187182
const std::string& dataset, const std::vector<std::string>& symbols,
188183
Schema schema, const DateTimeRange<UnixNanos>& datetime_range,
189184
Encoding encoding, Compression compression, bool pretty_px, bool pretty_ts,
190185
bool map_symbols, bool split_symbols, SplitDuration split_duration,
191-
std::uint64_t split_size, Packaging packaging, Delivery delivery,
192-
SType stype_in, SType stype_out, std::uint64_t limit) {
186+
std::uint64_t split_size, Delivery delivery, SType stype_in,
187+
SType stype_out, std::uint64_t limit) {
193188
httplib::Params params{
194189
{"dataset", dataset},
195190
{"start", ToString(datetime_range.start)},
@@ -202,7 +197,6 @@ databento::BatchJob Historical::BatchSubmitJob(
202197
{"map_symbols", std::to_string(map_symbols)},
203198
{"split_symbols", std::to_string(split_symbols)},
204199
{"split_duration", ToString(split_duration)},
205-
{"packaging", ToString(packaging)},
206200
{"delivery", ToString(delivery)},
207201
{"stype_in", ToString(stype_in)},
208202
{"stype_out", ToString(stype_out)}};
@@ -216,8 +210,8 @@ databento::BatchJob Historical::BatchSubmitJob(
216210
Schema schema, const DateTimeRange<std::string>& datetime_range,
217211
Encoding encoding, Compression compression, bool pretty_px, bool pretty_ts,
218212
bool map_symbols, bool split_symbols, SplitDuration split_duration,
219-
std::uint64_t split_size, Packaging packaging, Delivery delivery,
220-
SType stype_in, SType stype_out, std::uint64_t limit) {
213+
std::uint64_t split_size, Delivery delivery, SType stype_in,
214+
SType stype_out, std::uint64_t limit) {
221215
httplib::Params params{
222216
{"dataset", dataset},
223217
{"start", datetime_range.start},
@@ -230,7 +224,6 @@ databento::BatchJob Historical::BatchSubmitJob(
230224
{"map_symbols", std::to_string(map_symbols)},
231225
{"split_symbols", std::to_string(split_symbols)},
232226
{"split_duration", ToString(split_duration)},
233-
{"packaging", ToString(packaging)},
234227
{"delivery", ToString(delivery)},
235228
{"stype_in", ToString(stype_in)},
236229
{"stype_out", ToString(stype_out)}};

tests/src/batch_tests.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ TEST(BatchTests, TestBatchJobToString) {
2727
SplitDuration::Week,
2828
{},
2929
false,
30-
Packaging::Zip,
3130
Delivery::Download,
3231
10250,
3332
35000000,
@@ -61,7 +60,6 @@ TEST(BatchTests, TestBatchJobToString) {
6160
split_duration = week,
6261
split_size = 0,
6362
split_symbols = false,
64-
packaging = zip,
6563
delivery = download,
6664
record_count = 10250,
6765
billed_size = 35000000,

0 commit comments

Comments
 (0)