fix: python code with null and undefined (#2932)
Updated pythonCode to include None as replacement to null and undefined
This commit is contained in:
parent
ce7418a688
commit
00df8f8405
2 changed files with 4 additions and 2 deletions
|
|
@ -20,7 +20,8 @@ export default function getPythonApiCode(
|
||||||
}
|
}
|
||||||
tweaksString = JSON.stringify(tweaksObject, null, 2)
|
tweaksString = JSON.stringify(tweaksObject, null, 2)
|
||||||
.replace(/true/g, "True")
|
.replace(/true/g, "True")
|
||||||
.replace(/false/g, "False");
|
.replace(/false/g, "False")
|
||||||
|
.replace(/null|undefined/g, "None");
|
||||||
}
|
}
|
||||||
|
|
||||||
return `import argparse
|
return `import argparse
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ export default function getPythonCode(
|
||||||
}
|
}
|
||||||
tweaksString = JSON.stringify(tweaksObject, null, 2)
|
tweaksString = JSON.stringify(tweaksObject, null, 2)
|
||||||
.replace(/true/g, "True")
|
.replace(/true/g, "True")
|
||||||
.replace(/false/g, "False");
|
.replace(/false/g, "False")
|
||||||
|
.replace(/null|undefined/g, "None");
|
||||||
}
|
}
|
||||||
|
|
||||||
return `from langflow.load import run_flow_from_json
|
return `from langflow.load import run_flow_from_json
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue