<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Databricks app calling Genie API has empty data array in Generative AI</title>
    <link>https://community.databricks.com/t5/generative-ai/databricks-app-calling-genie-api-has-empty-data-array/m-p/146599#M1599</link>
    <description>&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Hello,&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;You can use the Genie&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;statement_id&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and the Statement Execution API to retrieve the SQL result set, then read&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;result.result.data_array&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to build your DataFrame.&lt;SPAN class="inline-flex" aria-label="Chat with a Genie Space" data-state="closed"&gt;​&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;A working example is provided in the Databricks Apps Cookbook:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="inline-flex" aria-label="Chat with a Genie Space" data-state="closed"&gt;&lt;SPAN class="text-box-trim-both"&gt;&lt;A href="https://apps-cookbook.dev/docs/dash/bi/genie_api/" target="_self"&gt;https://apps-cookbook.dev/docs/dash/bi/genie_api/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;&lt;SPAN class="inline-flex" aria-label="Chat with a Genie Space" data-state="closed"&gt;Hope this helps!​&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Feb 2026 16:46:55 GMT</pubDate>
    <dc:creator>anshu_roy</dc:creator>
    <dc:date>2026-02-02T16:46:55Z</dc:date>
    <item>
      <title>Databricks app calling Genie API has empty data array</title>
      <link>https://community.databricks.com/t5/generative-ai/databricks-app-calling-genie-api-has-empty-data-array/m-p/144439#M1560</link>
      <description>&lt;P&gt;I have a Databricks app that makes calls to Genie API, it successfully returns a response containing the text response and the generated SQL query. However, the actual result of the SQL query is missing, in the result object, there is the metadata for the result but the data array is None.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;result=ResultData(byte_count=None, chunk_index=0, data_array=None, external_links=[], next_chunk_index=None, next_chunk_internal_link=None, row_count=1, row_offset=0)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When I inspect in monitoring, there is also no SQL result whereas if I use the exact same prompt in the Genie web interface then there is a result (As shown in the attached screenshots).&lt;BR /&gt;&lt;BR /&gt;Any idea of the issue here?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2026 13:42:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/databricks-app-calling-genie-api-has-empty-data-array/m-p/144439#M1560</guid>
      <dc:creator>lewissolarin</dc:creator>
      <dc:date>2026-01-19T13:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks app calling Genie API has empty data array</title>
      <link>https://community.databricks.com/t5/generative-ai/databricks-app-calling-genie-api-has-empty-data-array/m-p/144683#M1568</link>
      <description>&lt;P&gt;Can you inspect &lt;STRONG&gt;data_typed_array&lt;/STRONG&gt; if &lt;STRONG&gt;data_array&lt;/STRONG&gt; is None.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jan 2026 03:38:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/databricks-app-calling-genie-api-has-empty-data-array/m-p/144683#M1568</guid>
      <dc:creator>pradeep_singh</dc:creator>
      <dc:date>2026-01-21T03:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks app calling Genie API has empty data array</title>
      <link>https://community.databricks.com/t5/generative-ai/databricks-app-calling-genie-api-has-empty-data-array/m-p/146599#M1599</link>
      <description>&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Hello,&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;You can use the Genie&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;statement_id&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and the Statement Execution API to retrieve the SQL result set, then read&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;result.result.data_array&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to build your DataFrame.&lt;SPAN class="inline-flex" aria-label="Chat with a Genie Space" data-state="closed"&gt;​&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;A working example is provided in the Databricks Apps Cookbook:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="inline-flex" aria-label="Chat with a Genie Space" data-state="closed"&gt;&lt;SPAN class="text-box-trim-both"&gt;&lt;A href="https://apps-cookbook.dev/docs/dash/bi/genie_api/" target="_self"&gt;https://apps-cookbook.dev/docs/dash/bi/genie_api/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;&lt;SPAN class="inline-flex" aria-label="Chat with a Genie Space" data-state="closed"&gt;Hope this helps!​&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 16:46:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/databricks-app-calling-genie-api-has-empty-data-array/m-p/146599#M1599</guid>
      <dc:creator>anshu_roy</dc:creator>
      <dc:date>2026-02-02T16:46:55Z</dc:date>
    </item>
    <item>
      <title>Hi @lewissolarin,  The behavior you are seeing, where dat...</title>
      <link>https://community.databricks.com/t5/generative-ai/databricks-app-calling-genie-api-has-empty-data-array/m-p/150235#M1660</link>
      <description>Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/209727"&gt;@lewissolarin&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;The behavior you are seeing, where data_array is None and external_links is empty, is expected at a certain stage of the Genie API workflow. The Genie API uses the EXTERNAL_LINKS disposition for returning query results, which means data_array will always be None. The actual result data comes back through external_links (presigned URLs), but you need to call the right endpoint at the right time to get them.&lt;BR /&gt;&lt;BR /&gt;Here is the typical end-to-end workflow when calling the Genie API from a Databricks App:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;STEP 1: START A CONVERSATION OR SEND A MESSAGE&lt;BR /&gt;&lt;BR /&gt;Use start_conversation (or create_message for follow-ups) and wait for the message to reach COMPLETED status:&lt;BR /&gt;&lt;BR /&gt;  from databricks.sdk import WorkspaceClient&lt;BR /&gt;  import time&lt;BR /&gt;&lt;BR /&gt;  w = WorkspaceClient()&lt;BR /&gt;&lt;BR /&gt;  space_id = "&lt;YOUR-GENIE-SPACE-ID&gt;"&lt;BR /&gt;&lt;BR /&gt;  # Start a new conversation&lt;BR /&gt;  message = w.genie.start_conversation_and_wait(&lt;BR /&gt;      space_id=space_id,&lt;BR /&gt;      content="What were total sales last month?"&lt;BR /&gt;  )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;STEP 2: EXTRACT THE ATTACHMENT ID&lt;BR /&gt;&lt;BR /&gt;Once the message is completed, look at the attachments to find the query attachment. The attachment contains the SQL that Genie generated. You need its ID to fetch the query result:&lt;BR /&gt;&lt;BR /&gt;  # Get the message details&lt;BR /&gt;  msg = w.genie.get_message(&lt;BR /&gt;      space_id=space_id,&lt;BR /&gt;      conversation_id=message.conversation_id,&lt;BR /&gt;      message_id=message.id&lt;BR /&gt;  )&lt;BR /&gt;&lt;BR /&gt;  # Find the query attachment&lt;BR /&gt;  attachment_id = None&lt;BR /&gt;  if msg.attachments:&lt;BR /&gt;      for att in msg.attachments:&lt;BR /&gt;          if att.query:&lt;BR /&gt;              attachment_id = att.id&lt;BR /&gt;              break&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;STEP 3: FETCH THE QUERY RESULT&lt;BR /&gt;&lt;BR /&gt;This is the step that is likely missing or incomplete in your code. You need to call get_message_attachment_query_result with the attachment_id:&lt;BR /&gt;&lt;BR /&gt;  if attachment_id:&lt;BR /&gt;      result = w.genie.get_message_attachment_query_result(&lt;BR /&gt;          space_id=space_id,&lt;BR /&gt;          conversation_id=message.conversation_id,&lt;BR /&gt;          message_id=message.id,&lt;BR /&gt;          attachment_id=attachment_id&lt;BR /&gt;      )&lt;BR /&gt;&lt;BR /&gt;The result object is a GenieGetMessageQueryResultResponse. The actual data is in the statement_response field, which follows the same structure as the SQL Statement Execution API.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;STEP 4: READ THE DATA FROM EXTERNAL LINKS&lt;BR /&gt;&lt;BR /&gt;Because the Genie API uses EXTERNAL_LINKS disposition, you need to download the data from the presigned URLs provided in the result:&lt;BR /&gt;&lt;BR /&gt;  import requests&lt;BR /&gt;  import json&lt;BR /&gt;&lt;BR /&gt;  # Access the result chunks&lt;BR /&gt;  statement_response = result.statement_response&lt;BR /&gt;  if statement_response and statement_response.result:&lt;BR /&gt;      ext_links = statement_response.result.external_links&lt;BR /&gt;      if ext_links:&lt;BR /&gt;          for link in ext_links:&lt;BR /&gt;              # Download the data (do NOT include Databricks auth headers)&lt;BR /&gt;              resp = requests.get(link.external_link)&lt;BR /&gt;              # Process the downloaded data based on format&lt;BR /&gt;              data = resp.content&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;COMMON CAUSES OF EMPTY DATA&lt;BR /&gt;&lt;BR /&gt;If you are still seeing empty external_links after following the workflow above, check the following:&lt;BR /&gt;&lt;BR /&gt;1. TIMING: Make sure the message status is COMPLETED before fetching the query result. If you read the result while the query is still executing, the data will not be available yet. The start_conversation_and_wait method handles this polling for you, but if you are using the raw REST API, you need to poll get_message until the status shows COMPLETED.&lt;BR /&gt;&lt;BR /&gt;2. ATTACHMENT ID: Confirm you are passing the correct attachment_id. Each message can have multiple attachments, and you specifically need the one with a query object.&lt;BR /&gt;&lt;BR /&gt;3. PERMISSIONS: The app's service principal needs CAN RUN permission on the Genie Space, plus USE CATALOG, USE SCHEMA, and SELECT on the underlying tables. If permissions are insufficient, the query may complete but return no data.&lt;BR /&gt;&lt;BR /&gt;4. DEPRECATED METHODS: If you are using get_message_query_result (without the attachment_id parameter), note that this method is deprecated. Switch to get_message_attachment_query_result which requires the attachment_id.&lt;BR /&gt;&lt;BR /&gt;5. RE-EXECUTE IF EXPIRED: If the query result has expired, you can re-run it using execute_message_attachment_query with the same parameters.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ALTERNATIVE: USE THE DATABRICKS SDK HELPER&lt;BR /&gt;&lt;BR /&gt;If you are using the Databricks Python SDK, you can also use the higher-level helpers that handle the full workflow for you, including polling and result retrieval.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;DOCUMENTATION REFERENCES&lt;BR /&gt;&lt;BR /&gt;Genie API reference:&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/genie" target="_blank"&gt;https://docs.databricks.com/api/workspace/genie&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Databricks Apps with Genie Spaces:&lt;BR /&gt;&lt;A href="https://docs.databricks.com/aws/en/dev-tools/databricks-apps/genie.html" target="_blank"&gt;https://docs.databricks.com/aws/en/dev-tools/databricks-apps/genie.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;SQL Statement Execution API (for understanding EXTERNAL_LINKS disposition):&lt;BR /&gt;&lt;A href="https://docs.databricks.com/aws/en/sql/admin/sql-execution-tutorial.html" target="_blank"&gt;https://docs.databricks.com/aws/en/sql/admin/sql-execution-tutorial.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Databricks Python SDK Genie module:&lt;BR /&gt;&lt;A href="https://databricks-sdk-py.readthedocs.io/en/latest/workspace/dashboards/genie.html" target="_blank"&gt;https://databricks-sdk-py.readthedocs.io/en/latest/workspace/dashboards/genie.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;* This reply used an agent system I built to research and draft this response based on the wide set of documentation I have available and previous memory. I personally review the draft for any obvious issues and for monitoring system reliability and update it when I detect any drift, but there is still a small chance that something is inaccurate, especially if you are experimenting with brand new features.&lt;BR /&gt;&lt;BR /&gt;If this answer resolves your question, could you mark it as "Accept as Solution"? That helps other users quickly find the correct fix.&lt;/YOUR-GENIE-SPACE-ID&gt;</description>
      <pubDate>Sun, 08 Mar 2026 18:26:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/databricks-app-calling-genie-api-has-empty-data-array/m-p/150235#M1660</guid>
      <dc:creator>SteveOstrowski</dc:creator>
      <dc:date>2026-03-08T18:26:55Z</dc:date>
    </item>
  </channel>
</rss>

