11from __future__ import annotations
22
3+ import warnings
34from collections .abc import Iterable
45from datetime import date
56from datetime import datetime
1920from databento .common .parsing import optional_datetime_to_string
2021from databento .common .parsing import optional_symbols_list_to_list
2122from databento .common .publishers import Dataset
23+ from databento .common .types import Default
2224from databento .common .validation import validate_enum
2325from databento .common .validation import validate_semantic_string
2426
@@ -399,7 +401,7 @@ def get_cost(
399401 dataset : Dataset | str ,
400402 start : pd .Timestamp | datetime | date | str | int ,
401403 end : pd .Timestamp | datetime | date | str | int | None = None ,
402- mode : FeedMode | str = "historical-streaming" ,
404+ mode : FeedMode | str | Default [ None ] = Default [ None ]( None ) ,
403405 symbols : Iterable [str | int ] | str | int | None = None ,
404406 schema : Schema | str = "trades" ,
405407 stype_in : SType | str = "raw_symbol" ,
@@ -425,8 +427,8 @@ def get_cost(
425427 Assumes UTC as timezone unless otherwise specified.
426428 If an integer is passed, then this represents nanoseconds since the UNIX epoch.
427429 Defaults to the forward filled value of `start` based on the resolution provided.
428- mode : FeedMode or str {'live', 'historical-streaming', 'historical'}, default 'historical-streaming'
429- The data feed mode for the request.
430+ mode : FeedMode or str {'live', 'historical-streaming', 'historical'}, default `None`
431+ The data feed mode for the request. This parameter has been deprecated.
430432 symbols : Iterable[str | int] or str or int, optional
431433 The instrument symbols to filter for. Takes up to 2,000 symbols per request.
432434 If 'ALL_SYMBOLS' or `None` then will select **all** symbols.
@@ -443,6 +445,13 @@ def get_cost(
443445 The cost in US dollars.
444446
445447 """
448+ if not isinstance (mode , Default ):
449+ warnings .warn (
450+ "The `mode` parameter is deprecated and will be removed in a future release." ,
451+ DeprecationWarning ,
452+ stacklevel = 2 ,
453+ )
454+
446455 stype_in_valid = validate_enum (stype_in , SType , "stype_in" )
447456 symbols_list = optional_symbols_list_to_list (symbols , stype_in_valid )
448457 data : dict [str , str | None ] = {
@@ -453,7 +462,6 @@ def get_cost(
453462 "schema" : str (validate_enum (schema , Schema , "schema" )),
454463 "stype_in" : str (stype_in_valid ),
455464 "stype_out" : str (SType .INSTRUMENT_ID ),
456- "mode" : validate_enum (mode , FeedMode , "mode" ),
457465 }
458466
459467 if limit is not None :
0 commit comments