Skip to content

Commit

Permalink
MOD: Deprecate packaging in clients
Browse files Browse the repository at this point in the history
  • Loading branch information
threecgreen committed Nov 8, 2024
1 parent cff25fa commit bdccb81
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

## 0.15.0 - TBD
## 0.16.0 - TBD

#### Deprecations
- Deprecated `Packaging` enum and `packaging` field on `SubmitJobParams` and `BatchJob`.
These will be removed in a future version. All files from a batch job can be downloaded
with the `batch().download()` method on the historical client

## 0.15.0 - 2024-10-22

#### Enhancements
- Upgraded DBN version to 0.23.0:
Expand Down
16 changes: 14 additions & 2 deletions src/historical/batch.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! The historical batch download API.
#![allow(deprecated)] // Packaging

use core::fmt;
use std::{
collections::HashMap,
Expand Down Expand Up @@ -209,6 +211,10 @@ pub enum SplitDuration {

/// How the batch job will be packaged.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[deprecated(
since = "0.16.0",
note = "Use the `download()` method to download the whole job`"
)]
pub enum Packaging {
/// ZIP compressed.
Zip,
Expand Down Expand Up @@ -291,6 +297,10 @@ pub struct SubmitJobParams {
pub split_size: Option<NonZeroU64>,
/// The optional archive type to package all batched data files in. Defaults to `None`.
#[builder(default, setter(strip_option))]
#[deprecated(
since = "0.16.0",
note = "Use the `download()` method to download the whole job`"
)]
pub packaging: Option<Packaging>,
/// The delivery mechanism for the batched data files once processed. Defaults to
/// [`Download`](Delivery::Download).
Expand Down Expand Up @@ -357,6 +367,10 @@ pub struct BatchJob {
/// The maximum size for an individual file before splitting into multiple files.
pub split_size: Option<NonZeroU64>,
/// The packaging method of the batch data.
#[deprecated(
since = "0.16.0",
note = "Use the `download()` method to download the whole job`"
)]
pub packaging: Option<Packaging>,
/// The delivery mechanism of the batch data.
pub delivery: Delivery,
Expand Down Expand Up @@ -476,7 +490,6 @@ impl Packaging {
pub const fn as_str(&self) -> &'static str {
match self {
Packaging::Zip => "zip",
#[allow(deprecated)]
Packaging::Tar => "tar",
}
}
Expand All @@ -494,7 +507,6 @@ impl FromStr for Packaging {
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"zip" => Ok(Packaging::Zip),
#[allow(deprecated)]
"tar" => Ok(Packaging::Tar),
_ => Err(crate::Error::bad_arg(
"s",
Expand Down

0 comments on commit bdccb81

Please sign in to comment.