<@U088WCP3B4P> Can you help me with this JSON sche...
# ask-elementary-ai
j
@kapa.ai Can you help me with this JSON schema test error? I generated the JSON schema test using the run operation and ran the test on my column. I received the following error message:
Copy code
Compilation Error in test elementary_json_schema_<long_list_of_json>(<yaml_name>.yml) pop from empty list
k
A message from kapa.ai
The error message
pop from empty list
when running an
elementary.json_schema
test is a known issue that can occur when using Elementary's JSON schema tests, especially on Snowflake. This error typically originates from the underlying Python test infrastructure that Elementary uses for JSON schema validation. Based on the knowledge sources, here are the most common causes and troubleshooting steps: 1. Python UDF Setup in Snowflake: The JSON schema test relies on Python UDFs. If your Snowflake account has not accepted the Anaconda third-party package terms, the test will fail with errors like
pop from empty list
. You (or your Snowflake admin) need to accept these terms for Python UDFs to work. You can find more details in the [Snowflake documentation](https://docs.snowflake.com/en/developer-guide/udf/python/udf-python-packages#using-third-party-packages-from-anaconda) and this has been confirmed as the root cause in several user reports. Once the terms are accepted, the error should be resolved and the test should run smoothly [Slack thread](https://slack.com/archives/C02CTC89LAX/p1676889103267109). 2. Column Data Type: The
elementary.json_schema
test should only be used on columns that actually contain JSON values (e.g.,
VARIANT
columns in Snowflake). If you try to run the test on a column that contains non-JSON data (like integers or strings), you may encounter errors, including
pop from empty list
or Python type errors. Double-check that your column is of the correct type and contains JSON data [Slack thread](https://slack.com/archives/C02CTC89LAX/p1693812733725629). 3. Debugging Further: If the above steps do not resolve the issue, you can get more detailed error information from Snowflake's query history: - Search for SQL statements containing
json_schema
. - Look for failed statements starting with
WITH elementary...
. - The error message there may provide more context about the failure [Slack thread](https://slack.com/archives/C02CTC89LAX/p1676889103267109). Summary of steps to resolve: - Ensure your Snowflake account has accepted the Anaconda third-party package terms. - Confirm the column you are testing contains JSON data. - Check Snowflake query history for more detailed error messages. If you have confirmed both the setup and the column type are correct and still encounter the error, please provide the detailed error message from Snowflake's query history for further troubleshooting. Let me know if you need more specific guidance on any of these steps!