From a63e3149df09f22ce8973d9e6eac24c339956b7e Mon Sep 17 00:00:00 2001 From: joe-prosser Date: Mon, 6 Nov 2023 17:53:09 +0000 Subject: [PATCH] feat(commands): transform tag optional on create bucket (#237) --- CHANGELOG.md | 2 +- cli/src/commands/create/bucket.rs | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd5571d2..edf812c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ ## Unreleased - Fix url used for fetching streams - Return `is_end_sequence` on stream fetch +- Make `transform_tag` optional on `create bucket` - Retry `put_emails` requests - ## v0.20.0 - Add ability to get dataset stats diff --git a/cli/src/commands/create/bucket.rs b/cli/src/commands/create/bucket.rs index 89206420..f7f4f8b1 100644 --- a/cli/src/commands/create/bucket.rs +++ b/cli/src/commands/create/bucket.rs @@ -1,6 +1,7 @@ use crate::printer::Printer; use anyhow::{Context, Result}; use log::info; +use once_cell::sync::Lazy; use reinfer_client::{BucketFullName, BucketType, Client, NewBucket, TransformTag}; use structopt::StructOpt; @@ -21,9 +22,12 @@ pub struct CreateBucketArgs { #[structopt(long = "transform-tag")] /// Set the transform tag of the new bucket. You will be given this value /// by a Re:infer engineer. - transform_tag: TransformTag, + transform_tag: Option, } +static DEFAULT_TRANSFORM_TAG: Lazy = + Lazy::new(|| TransformTag("generic.0.CONVKER5".to_string())); + pub fn create(client: &Client, args: &CreateBucketArgs, printer: &Printer) -> Result<()> { let CreateBucketArgs { name, @@ -32,6 +36,12 @@ pub fn create(client: &Client, args: &CreateBucketArgs, printer: &Printer) -> Re transform_tag, } = args; + let transform_tag = &if let Some(transform_tag) = transform_tag { + transform_tag.clone() + } else { + DEFAULT_TRANSFORM_TAG.clone() + }; + let bucket = client .create_bucket( name,