Python script error: BDC is null

I am trying to execute a basic Python script.

The following error is being raised on execution. Execute failed: Cannot invoke “org.knime.core.node.BufferedDataContainer.close()” because “bdc” is null

It is not clear to me how to fix this. Any suggestions would be helpful.

import pandas as pd

Create a simple DataFrame

data = {‘Column1’: [1, 2, 3], ‘Column2’: [‘A’, ‘B’, ‘C’]}
output_table = pd.DataFrame(data)

Thanks,
Marc.

Hello @nbt1032b,

I adapted your script just a bit, and I am able to run in using the ‘Python Script’ node. Try using the script below:

import knime.scripting.io as knio
import pandas as pd

# Create a simple DataFrame
data = {'Column1': [1, 2, 3], 'Column2': ['A', 'B', 'C']}
df = pd.DataFrame(data)

# Output the DataFrame to the first output table port
knio.output_tables[0] = knio.Table.from_pandas(df)

Here was my test workflow setup showing it executing properly:

image

Were you using any of the Schrodinger nodes for the python script?

Hope this helps,
TL

2 Likes

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