mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-25 16:02:11 +00:00
feat: add sql as a valid type in Python
This commit is contained in:
@@ -104,6 +104,7 @@ pub fn parse_python_signature(code: &str) -> error::Result<MainArgSignature> {
|
||||
"bytes" => Typ::Bytes,
|
||||
"datetime" => Typ::Datetime,
|
||||
"datetime.datetime" => Typ::Datetime,
|
||||
"Sql" | "sql" => Typ::Sql,
|
||||
_ => Typ::Resource(id),
|
||||
},
|
||||
_ => Typ::Unknown,
|
||||
|
||||
@@ -60,9 +60,15 @@
|
||||
localStorage.removeItem(script.path)
|
||||
|
||||
script.schema = script.schema ?? emptySchema()
|
||||
if (!script.schema) {
|
||||
try {
|
||||
await inferArgs(script.language, script.content, script.schema)
|
||||
} catch (error) {
|
||||
sendUserToast(
|
||||
`Impossible to infer the schema. Assuming this is a script without main function`,
|
||||
true
|
||||
)
|
||||
}
|
||||
|
||||
const newHash = await ScriptService.createScript({
|
||||
workspace: $workspaceStore!,
|
||||
requestBody: {
|
||||
@@ -87,7 +93,13 @@
|
||||
async function changeStep(step: number) {
|
||||
if (step > 1) {
|
||||
script.schema = script.schema ?? emptySchema()
|
||||
await inferArgs(script.language, script.content, script.schema)
|
||||
try {
|
||||
await inferArgs(script.language, script.content, script.schema)
|
||||
} catch (error) {
|
||||
console.info(
|
||||
'Impossible to infer the schema. Assuming this is a script without main function'
|
||||
)
|
||||
}
|
||||
}
|
||||
goto(`?step=${step}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user