{"record":{"id":"3ea9298547ca9a9d","repo":"larksuite/cli","slug":"unsupported-type-q","errorCode":null,"errorMessage":"unsupported type %q","messagePattern":"unsupported type %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/sheets/lark_sheet_table_io.go","lineNumber":712,"sourceCode":"\t\tcell[\"value\"] = n\n\tcase \"bool\":\n\t\tb, ok := raw.(bool)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"bool expects true/false, got %s\", describeJSONType(raw)) //nolint:forbidigo // intermediate error; callers wrap it into a typed --sheets/--values validation error with row/column context\n\t\t}\n\t\tcell[\"value\"] = b\n\tcase \"date\":\n\t\tstr, ok := raw.(string)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"date expects an ISO yyyy-mm-dd string, got %s\", describeJSONType(raw)) //nolint:forbidigo // intermediate error; callers wrap it into a typed --sheets/--values validation error with row/column context\n\t\t}\n\t\tserial, err := isoDateToSerial(str)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcell[\"value\"] = serial\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported type %q\", col.Type) //nolint:forbidigo // intermediate error; callers wrap it into a typed --sheets/--values validation error with row/column context\n\t}\n\treturn cell, nil\n}\n\n// stringifyCellValue renders any JSON scalar as the literal text a string\n// column should hold. json.Number keeps its exact digits (no scientific\n// notation), so IDs / postcodes survive as written.\nfunc stringifyCellValue(raw interface{}) string {\n\tswitch v := raw.(type) {\n\tcase string:\n\t\treturn v\n\tcase json.Number:\n\t\treturn v.String()\n\tcase bool:\n\t\tif v {\n\t\t\treturn \"TRUE\"\n\t\t}\n\t\treturn \"FALSE\"","sourceCodeStart":694,"sourceCodeEnd":730,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/sheets/lark_sheet_table_io.go#L694-L730","documentation":"buildTypedCell only supports the declared column dtypes the table-put machinery knows (e.g. string, number, bool, date, object). An unrecognized col.Type string hits the default case and throws this error before any rows are processed; callers wrap it with typed validation context.","triggerScenarios":"Typo in a column type, e.g. {\"type\":\"integer\"} or {\"type\":\"datetime\"} or {\"type\":\"Number\"} instead of a supported dtype.","commonSituations":"Guessing dtype names from generic spreadsheet vocabulary (\"integer\", \"float\", \"timestamp\") instead of the CLI's schema; case-sensitivity slips after editing JSON by hand.","solutions":["Run the schema/help (lark sheet table-put --print-schema or --help) to list supported dtypes and use one exactly","Fix the type spelling/case in the --sheets payload","Use \"object\" (text) as the safe catch-all dtype for unsupported value kinds"],"exampleFix":"// before\n{\"name\":\"Age\",\"type\":\"integer\"}\n// after\n{\"name\":\"Age\",\"type\":\"number\"}","handlingStrategy":"validation","validationCode":"const SUPPORTED_DTYPES = new Set(['string','number','bool','date','object']); // confirm via --print-schema\nfunction assertDtypes(cols) {\n  cols.forEach(c => { if (!SUPPORTED_DTYPES.has(c.type)) throw new Error(`unsupported dtype '${c.type}' for column ${c.name}`); });\n}","typeGuard":"function hasSupportedDtype(col, supported) { return supported.includes(col.type); }","tryCatchPattern":"try {\n  await run(['lark','sheet','table-put','--sheets',payload]);\n} catch (e) {\n  if (/unsupported type /.test(e.message)) {\n    // fix col.Type to a supported dtype (see --print-schema) and retry\n  }\n  throw e;\n}","preventionTips":["Check supported dtype names with table-put --help or --print-schema before authoring payloads","Never invent dtypes (\"integer\", \"datetime\"); map them to the CLI's vocabulary","Copy dtype names exactly (case-sensitive) from the schema"],"tags":["cli","validation","sheets","dtype"],"backgroundTag":"schema-validation-failed","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}