Bug: JSON input line errors don't match with the editor
znicholasbrown opened this issue · 1 comments
znicholasbrown commented
Using flow:
from typing import List
from prefect import flow
@flow
def json_input_bug(arr: List[str] = []):
pass
if __name__ == '__main__':
json_input_bug.serve(
name='default',
)
Steps to reproduce:
- Run the above script (and so create a new deployment)
- Navigate to the deployment page, click "Run" -> "Custom run"
- Change the input for the arr property to JSON input
- Enter the following into the editor and click "Run" (note the trailing comma, which is invalid JSON)
[
"Hello World",
]
The following error will be displayed:
InvalidJSON() is not of type 'array' and Invalid JSON: Expecting value: line 3 column 1 (char 19)
which doesn't match what's in the editor
jakekaplan commented
cc @pleek91
I took a quick look at this I think we can close it unless I'm misunderstanding.
The json that gets passed is "[\n \"Hello World\",\n]"
. The comma itself is not the cause of error, the error is that there is value expected after a comma. But where it expects a value it sees ]
, which is line 3 column 1.