Pickle data from KNIME python script node

Hi,

I usually write my python codes in spyder before I use them in KNIME python script nodes. Sometimes the data is only available in KNIME, so I usually pickle it and load the pickle to spyder to write the script. Pickles created with the python script node (AP version 4.6.4) work completely fine. Pickle created with the Labs python script node (I think this version is the normal python script node in AP 4.7) are not possible to open in spyder, I get a ModuleNotFoundError: No module named ‘knime_arrow_pandas’ error. I use the same python environment in both systems. Any suggestions ?

I also tried to pickle the data with the normal (older) script node, that I can load seamlessly, but the json data type is saved different and the script I build using that is not working in the Lab node.

Thanks,
Agnes

The script I use to save the data:
image

Can you try sth like this
response = knio.write_table(df)
br

@Agi the import has been changed to:

import knime.scripting.io as knio

While the syntax about the to_pandas() should be correct. Not sure if this will affect the pickle thing.

Parquet might be another format you could use to transfer data. Where you can switch out the import in Spyder by the one you will use in knime.

2 Likes

@Daniel_Weikert I think this syntax is the older one and while it might work with the old import … syntax it might be best to move to the latest version.

There seem to have been some package and syntax changes while moving from lab to production with the new Python environment. I adapted a lot of examples that I have created with the labs version.

1 Like

@mlauber71
appreciate that. Thanks for the update
br

1 Like

Thanks @mlauber71 and @Daniel_Weikert . I still use the old syntax on purpose in the Labs scripting node, as our production server is not yet ready to accept the latest version. I will check again after we upgraded our server, as of now I need to go with the old version in terms of scripting and also in terms of node itself.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.