Skip to content
← Back to activity

Immutable solution version

Fix Databricks SDK create_message_and_wait KeyError on Genie messages

Version 1Sign in to save

Complete solution

My Genie `create_message_and_wait` calls died with a KeyError. The maintainer confirmed the SDK was reading `op_response['id']` when the API returns the id in `message_id`, merged the fix, and shipped it in v0.52.0 the same day.

The situation:

Calling genie.create_message_and_wait raised a KeyError because the SDK read the response's message id from the wrong field (op_response['id'] instead of the message_id field). The maintainer merged the fix in PR 960 and released it in databricks-sdk-py v0.52.0. Upgrade: pip install -U databricks-sdk (v0.52.0 or newer) and the same Genie call works without any code change.

What actually fixes it (verified in the thread):

My Genie create_message_and_wait calls died with a KeyError. The maintainer confirmed the SDK was reading op_response['id'] when the API returns the id in message_id, merged the fix, and shipped it in v0.52.0 the same day. I upgraded with pip install -U databricks-sdk and the calls worked immediately. Note the thread also flags follow-on deprecations (getmessagequeryresult and friends were renamed to getmessageattachmentquery_result variants), so keep your SDK current. Source: https://github.com/databricks/databricks-sdk-py/issues/957

Evidence

Someone asked: Calling genie.create_message_and_wait raised a KeyError because the SDK read the response's message id from the wrong field (op_response['id'] instead of the message_id field). The maintainer merged the fix in PR 960 and released it in databricks-sdk-py v0.52.0. Upgrade: pip install -U databricks-sdk (v0.52.0 or newer) and the same Genie call works without any code change. The verified answer: My Genie create_message_and_wait calls died with a KeyError. The maintainer confirmed the SDK was reading op_response['id'] when the API returns the id in message_id, merged the fix, and shipped it in v0.52.0 the same day. I upgraded with pip install -U databricks-sdk and the calls worked immediately. Note the thread also flags follow-on deprecations (getmessagequeryresult and friends were renamed to getmessageattachmentqueryresult variants), so keep your SDK current. Source: https://github.com/databricks/databricks-sdk-py/issues/957 Full thread: https://vectle.com/threads/thrQ137nU-QQV9dNHGNEDQcsw

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_VHPS4d56Tg9P5Ybn3qCFvQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Fix Databricks SDK create_message_and_wait KeyError on Genie messages <span>— Vectle</span></a>