-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with data field in input JSON #204
Comments
What does your command line look like? |
Hi, I am not using the command line, I am using the load function imported to a python file to create a model object. |
I'll have to go back to that part of the code. Did you try to save a model as JSON and then load it back again? |
Hi @izar , apologies for such a belated response on this! One thing I have tried is running your unit tests but renaming output.json to input.json as this is a much more complete model in terms of different functions. The test now fails with the following: ======================================================================
|
thanks for the report! I'll take a look at it as soon as time permits. |
any news about this issue? |
When using the JSON model format as input to create a report I am getting an error "expecting a list of pytm.Data, item number 0 is a <class 'str'>" (line 213 in the code snippet).
https://github.com/izar/pytm/blob/679ea0df19b7b92e7d8359891d53f7ed794d54a3/pytm/pytm.py#L194-L218
My input JSON for data and flows looks like this:
"flows": [
{
"name": "Actor 1 to Actor 2",
"source": "Actor 1",
"sink": "Actor 2",
"order": 1,
"data": [
"Data"
]
},{
"name": "Actor 2 to Actor 3",
"source": "Actor 2",
"sink": "Actor 3",
"description": "Another data flow",
"data": [
]
}
],
"data": [
{
"name": "Data",
"format": "Text",
"isPII": true
}
]
Which I believe matches the JSON format when using the JSON output of the CLI tool. Below is the function which leads to calling varData when it creates the Dataflow object. It seems like the varData function doesn't deal with a list of data name strings. input.json in the tests folder doesn't have a data field in it. Since data objects are not in either the boundaries, elements or flows section of the JSON should they be dealt with using their own function e.g. decode_data?
https://github.com/izar/pytm/blob/679ea0df19b7b92e7d8359891d53f7ed794d54a3/pytm/json.py#L92-L107
The text was updated successfully, but these errors were encountered: