|
29 | 29 | from databento.common.enums import Delivery |
30 | 30 | from databento.common.enums import Packaging |
31 | 31 | from databento.common.enums import SplitDuration |
| 32 | +from databento.common.error import BentoDeprecationWarning |
32 | 33 | from databento.common.error import BentoError |
33 | 34 | from databento.common.error import BentoHttpError |
34 | 35 | from databento.common.error import BentoWarning |
|
39 | 40 | from databento.common.parsing import optional_values_list_to_string |
40 | 41 | from databento.common.parsing import symbols_list_to_list |
41 | 42 | from databento.common.publishers import Dataset |
| 43 | +from databento.common.types import Default |
42 | 44 | from databento.common.validation import validate_enum |
43 | 45 | from databento.common.validation import validate_path |
44 | 46 | from databento.common.validation import validate_semantic_string |
@@ -73,7 +75,7 @@ def submit_job( |
73 | 75 | split_symbols: bool = False, |
74 | 76 | split_duration: SplitDuration | str = "day", |
75 | 77 | split_size: int | None = None, |
76 | | - packaging: Packaging | str | None = None, |
| 78 | + packaging: Packaging | str | None = Default(None), # type: ignore [assignment] |
77 | 79 | delivery: Delivery | str = "download", |
78 | 80 | stype_in: SType | str = "raw_symbol", |
79 | 81 | stype_out: SType | str = "instrument_id", |
@@ -148,6 +150,15 @@ def submit_job( |
148 | 150 | """ |
149 | 151 | stype_in_valid = validate_enum(stype_in, SType, "stype_in") |
150 | 152 | symbols_list = symbols_list_to_list(symbols, stype_in_valid) |
| 153 | + |
| 154 | + if isinstance(packaging, Default): |
| 155 | + packaging = packaging.value |
| 156 | + else: |
| 157 | + warnings.warn( |
| 158 | + message="The `packaging` parameter is deprecated and will be removed in a future release.", |
| 159 | + category=BentoDeprecationWarning, |
| 160 | + ) |
| 161 | + |
151 | 162 | data: dict[str, object | None] = { |
152 | 163 | "dataset": validate_semantic_string(dataset, "dataset"), |
153 | 164 | "start": datetime_to_string(start), |
|
0 commit comments