fix: python code with null and undefined (#2932)

Updated pythonCode to include None as replacement to null and undefined
This commit is contained in:
Lucas Oliveira 2024-07-24 18:09:55 -03:00 committed by GitHub
commit 00df8f8405
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -20,7 +20,8 @@ export default function getPythonApiCode(
}
tweaksString = JSON.stringify(tweaksObject, null, 2)
.replace(/true/g, "True")
.replace(/false/g, "False");
.replace(/false/g, "False")
.replace(/null|undefined/g, "None");
}
return `import argparse

View file

@ -16,7 +16,8 @@ export default function getPythonCode(
}
tweaksString = JSON.stringify(tweaksObject, null, 2)
.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