Hi, I have deployed elementary volume alerts and i...
# ask-elementary-ai
m
Hi, I have deployed elementary volume alerts and in UI, it looks like sql provided for the test in missing the right table to query. It shows up as None. Can you please help me fix it?
Copy code
select * from (None) results
      where
        anomaly_score is not null and
        upper(full_table_name) = upper(cast('GAMBLING-DATASOURCES.INT_BASKETBALL_STAGING.OVER_UNDER_ODDS' as string)) and
        metric_name = cast('freshness' as string)
dbt_project
Copy code
elementary:
    ## elementary models will be created in the schema '<your_schema>_elementary'
    +schema: "nrl_elementary"
    ## To disable elementary for dev, uncomment this:
    # enabled: "{{ target.name in ['prod','analytics'] }}"
profiles
Copy code
elementary:
  outputs:
    default:
      type: bigquery
      project: gambling-datasources
      dataset: nrl_elementary
      method: oauth
      priority: interactive
      threads: 10
k
A message from kapa.ai
I can help you with this Elementary Data issue. The problem you're experiencing is related to the SQL query for your volume alerts test, where the table name is showing as "None" instead of the actual table name. This is a common issue that can occur when Elementary's tables aren't properly created or when there's a configuration mismatch. Based on the knowledge sources, here are a few potential solutions: ### 1. Make sure Elementary tables are created First, ensure you've run the following command to create the Elementary tables:
Copy code
dbt run --select elementary
Several users have encountered similar issues where Elementary couldn't find the necessary tables. As mentioned in the [Slack forum discussions](https://slack.com/archives/C02CTC89LAX/p1685640574504399), this is often because the Elementary tables haven't been created yet. ### 2. Check schema configuration Your configuration looks good with: -
+schema: "nrl_elementary"
in dbt_project.yml - Correct elementary profile in profiles.yml pointing to the right dataset However, make sure that both your dbt commands and edr commands are using the same target. Try explicitly specifying the target when running commands:
Copy code
dbt run --select elementary --target default dbt test --target default edr monitor --target default
### 3. Verify table existence Check if the Elementary tables exist in your BigQuery dataset
gambling-datasources.nrl_elementary
. Specifically, look for: -
elementary_test_results
-
data_monitoring_metrics
If these tables don't exist or are empty, that could explain why your query is showing "None". ### 4. Run with debug logs Try running your tests with debug logs enabled to get more information:
Copy code
dbt test --vars '{"debug_logs": true}'
This will provide more detailed information about what's happening during the test execution. If you continue to experience issues after trying these steps, it might be helpful to check if there are any errors in the dbt.log file or to run
edr monitor debug
to validate your Elementary configuration. Let me know if any of these steps help resolve your issue!
n
Hey @Muhammad Tariq! Please don't pay attention to the query presented in the UI 🙂 The anomaly logic is not shown, but I'll be happy to understand what you're looking for. You can also use our anomaly troubleshooting guide.