Skip to main content
Solved

Python Caller KeyError

  • September 1, 2020
  • 1 reply
  • 139 views

jackyd
Supporter
Forum|alt.badge.img+16

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

Best answer by jackyd

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 :)

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

jackyd
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • 62 replies
  • Best Answer
  • September 1, 2020

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 :)