Account Usage QUERY_HISTORY View: Change to QUERY_TAG

Attention

This behavior change is in the 2024_03 bundle.

For the current status of the bundle, refer to Bundle History.

The output of the QUERY_HISTORY view, when returning information related to a Streamlit in Snowflake query, displays as follows:

Before the change:

The QUERY_TAG column contains a free form value resembling:

ExecuteStreamlit,streamlitName: STREAMLIT_DB.STREAMLIT_SCHEMA.OBJECT_NAME,streamlitId:123456789
Copy

With a child query tag content resembling:

File "/usr/lib/python_udf/ed2bb26281494c8405804a3281315153bd4c74b8d05d7de038bb8ce6fe8796d5/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "/home/udf/10380937708282/streamlit_app.py", line 29, in <module>
df = session.sql(sql).collect()
File "/usr/lib/python_udf/ed2bb26281494c8405804a3281315153bd4c74b8d05d7de038bb8ce6fe8796d5/lib/python3.8/site-packages/snowflake/snowpark/_internal/telemetry.py", line 139, in wrap
result = func(*args, **kwargs)
Copy
After the change:

The QUERY_TAG column contains a JSON value resembling:

{
  "StreamlitEngine": "ExecuteStreamlit",
  "StreamlitName": "STREAMLIT_DB.STREAMLIT_SCHEMA.OBJECT_NAME"
}
Copy

With a child query tag content resembling:

{
  "StreamlitEngine": "ExecuteStreamlit",
  "StreamlitName": "STREAMLIT_DB.STREAMLIT_SCHEMA.OBJECT_NAME",
  "ChildQuery": "true"
}
Copy

When parsing query history or tracking the Streamlit app, refer to the fully-qualified name of the Streamlit app, for example "StreamlitName": "STREAMLIT_DB.STREAMLIT_SCHEMA.OBJECT_NAME".

Ref: 1571