Skip to content

Commit 8818133

Browse files
eddietejedaclaude
andcommitted
fix: fall back to --name as label when --description omitted on create
Without this, omitting --description sent no label to the API, which treats label as required and would return a server-side error. Also corrects the --name help text example from a qualified default.public.my_view to just my_view — the API table_name field expects an unqualified identifier. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 68e4643 commit 8818133

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ pub enum DatasetsCommands {
455455

456456
/// Create a derived view from a SQL query or saved query
457457
Create {
458-
/// SQL table name the dataset is addressable as (e.g. default.public.my_view)
458+
/// SQL table name the dataset is addressable as (e.g. my_view)
459459
#[arg(long)]
460460
name: String,
461461

src/datasets.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ fn create_dataset(
7676
name: &str,
7777
source: serde_json::Value,
7878
) {
79-
let mut body = json!({ "table_name": name, "source": source });
80-
if let Some(desc) = description {
81-
body["label"] = json!(desc);
82-
}
79+
let label = description.unwrap_or(name);
80+
let body = json!({ "table_name": name, "label": label, "source": source });
8381

8482
let (status, resp_body) = api.post_raw("/datasets", &body);
8583

0 commit comments

Comments
 (0)