11//! The historical batch download API.
22
3- #![ allow( deprecated) ] // Packaging
4-
53use core:: fmt;
64use std:: {
75 collections:: HashMap ,
@@ -50,12 +48,6 @@ impl BatchClient<'_> {
5048 ( "map_symbols" , params. map_symbols. to_string( ) ) ,
5149 ( "split_symbols" , params. split_symbols. to_string( ) ) ,
5250 ( "split_duration" , params. split_duration. to_string( ) ) ,
53- (
54- "packaging" ,
55- params
56- . packaging
57- . map_or_else( || "none" . to_owned( ) , |p| p. to_string( ) ) ,
58- ) ,
5951 ( "delivery" , params. delivery. to_string( ) ) ,
6052 ( "stype_in" , params. stype_in. to_string( ) ) ,
6153 ( "stype_out" , params. stype_out. to_string( ) ) ,
@@ -209,20 +201,6 @@ pub enum SplitDuration {
209201 Month ,
210202}
211203
212- /// How the batch job will be packaged.
213- #[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
214- #[ deprecated(
215- since = "0.16.0" ,
216- note = "Use the `download()` method to download the whole job`"
217- ) ]
218- pub enum Packaging {
219- /// ZIP compressed.
220- Zip ,
221- /// Tarball.
222- #[ deprecated( since = "0.13.0" , note = "Users should use Zip instead" ) ]
223- Tar ,
224- }
225-
226204/// How the batch job will be delivered.
227205#[ derive( Clone , Copy , Debug , Default , PartialEq , Eq ) ]
228206pub enum Delivery {
@@ -295,13 +273,6 @@ pub struct SubmitJobParams {
295273 /// Must be an integer between 1e9 and 10e9 inclusive (1GB - 10GB). Defaults to `None`.
296274 #[ builder( default , setter( strip_option) ) ]
297275 pub split_size : Option < NonZeroU64 > ,
298- /// The optional archive type to package all batched data files in. Defaults to `None`.
299- #[ builder( default , setter( strip_option) ) ]
300- #[ deprecated(
301- since = "0.16.0" ,
302- note = "Use the `download()` method to download the whole job`"
303- ) ]
304- pub packaging : Option < Packaging > ,
305276 /// The delivery mechanism for the batched data files once processed. Defaults to
306277 /// [`Download`](Delivery::Download).
307278 #[ builder( default ) ]
@@ -366,12 +337,6 @@ pub struct BatchJob {
366337 pub split_duration : SplitDuration ,
367338 /// The maximum size for an individual file before splitting into multiple files.
368339 pub split_size : Option < NonZeroU64 > ,
369- /// The packaging method of the batch data.
370- #[ deprecated(
371- since = "0.16.0" ,
372- note = "Use the `download()` method to download the whole job`"
373- ) ]
374- pub packaging : Option < Packaging > ,
375340 /// The delivery mechanism of the batch data.
376341 pub delivery : Delivery ,
377342 /// The number of data records (`None` until the job is processed).
@@ -485,47 +450,6 @@ impl<'de> Deserialize<'de> for SplitDuration {
485450 }
486451}
487452
488- impl Packaging {
489- /// Converts the enum to its `str` representation.
490- pub const fn as_str ( & self ) -> & ' static str {
491- match self {
492- Packaging :: Zip => "zip" ,
493- Packaging :: Tar => "tar" ,
494- }
495- }
496- }
497-
498- impl fmt:: Display for Packaging {
499- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
500- f. write_str ( self . as_str ( ) )
501- }
502- }
503-
504- impl FromStr for Packaging {
505- type Err = crate :: Error ;
506-
507- fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
508- match s {
509- "zip" => Ok ( Packaging :: Zip ) ,
510- "tar" => Ok ( Packaging :: Tar ) ,
511- _ => Err ( crate :: Error :: bad_arg (
512- "s" ,
513- format ! (
514- "{s} does not correspond with any {} variant" ,
515- std:: any:: type_name:: <Self >( )
516- ) ,
517- ) ) ,
518- }
519- }
520- }
521-
522- impl < ' de > Deserialize < ' de > for Packaging {
523- fn deserialize < D : Deserializer < ' de > > ( deserializer : D ) -> Result < Self , D :: Error > {
524- let str = String :: deserialize ( deserializer) ?;
525- FromStr :: from_str ( & str) . map_err ( de:: Error :: custom)
526- }
527- }
528-
529453impl Delivery {
530454 /// Converts the enum to its `str` representation.
531455 pub const fn as_str ( & self ) -> & ' static str {
@@ -689,7 +613,6 @@ mod tests {
689613 "split_symbols" : false ,
690614 "split_duration" : "day" ,
691615 "split_size" : null,
692- "packaging" : null,
693616 "delivery" : "download" ,
694617 "state" : "queued" ,
695618 "ts_received" : "2023-07-19T23:00:04.095538123Z" ,
@@ -710,14 +633,14 @@ mod tests {
710633 . batch ( )
711634 . submit_job (
712635 & SubmitJobParams :: builder ( )
713- . dataset ( dbn:: datasets :: XNAS_ITCH )
636+ . dataset ( dbn:: Dataset :: XnasItch )
714637 . schema ( SCHEMA )
715638 . symbols ( "TSLA" )
716639 . date_time_range ( ( START , END ) )
717640 . build ( ) ,
718641 )
719642 . await ?;
720- assert_eq ! ( job_desc. dataset, dbn:: datasets :: XNAS_ITCH ) ;
643+ assert_eq ! ( job_desc. dataset, dbn:: Dataset :: XnasItch . as_str ( ) ) ;
721644 Ok ( ( ) )
722645 }
723646
@@ -754,7 +677,6 @@ mod tests {
754677 "split_symbols" : false ,
755678 "split_duration" : "day" ,
756679 "split_size" : null,
757- "packaging" : null,
758680 "delivery" : "download" ,
759681 "state" : "processing" ,
760682 "ts_received" : "2023-07-19 23:00:04.095538+00:00" ,
0 commit comments