Skip to main content

I have a python caller that is failing and giving me a key error

 

here is the log message:

2020-09-01 10:34:39| 636.8| 0.0|INFORM|Found 561025 features

2020-09-01 10:34:39| 636.8| 0.0|INFORM|Consisting of 26411 transformers, 160252 nodes and 374362 bits of conductor

2020-09-01 10:34:47| 637.9| 1.1|WARN |Python Exception <KeyError>: u'5405483'

2020-09-01 10:34:47| 637.9| 0.0|WARN |Traceback (most recent call last):

 File "<string>", line 119, in close

KeyError: u'5405483'          

 

2020-09-01 10:34:47| 637.9| 0.0|FATAL |PythonCaller_2 (PythonFactory): PythonFactory failed to close properly

2020-09-01 10:34:53| 643.8| 5.9|ERROR |PythonCaller_2 (PythonFactory): A fatal error has occurred. Check the logfile above for details

 

The python script is attached

 

The thing is, it ran perfectly OK one day and then the next day when i ran it and ever since it has kept failing. No changes to the workbench,but data updates overnight. The value referenced '5405483', is in both source tables that are read into the python caller, so should be found, but is not. This value changes each day. But I have checked back with previous version of the results and source table and this feature has not changed.

 

Just at a complete loss, it's also not my code and I am very rusty with python.

 

I ma probably missing something really simple, but just can not see it.

 

let me know if there is anything needed t unpick this problem.

 

Thanks everyone.

 

Cheers

Jacky

I had a small epiphany and double checked by data types.

It appears that the python caller was unhappy with some of the attributes being numeric and other text. I have changed them all to text and so far so good it is now working again :)


Reply