<@U088WCP3B4P> If a singular data test references ...
# ask-elementary-ai
o
@kapa.ai If a singular data test references multiple models, how do I enforce the tested table in Elementary OSS?
k
A message from kapa.ai
Based on the knowledge sources, when a singular test references multiple models, Elementary has difficulty determining which model to associate with the test. This is because Elementary establishes a strong link between a test and a model, and when a test is associated with more than one model, it doesn't know which one to choose. For singular tests that reference multiple models, the
model_unique_id
and
table_name
fields in the
elementary_test_results
table will be NULL, as mentioned by a Trusted Support Staff member: > "As singular tests are not configured for a specific model we kind of do a best effort there - if only one model is referenced we set is as the model. If more than one - we don't know so leave the model
NULL
." [Slack forum response](https://slack.com/archives/C02CTC89LAX/p1674575198908769) In the Elementary Cloud version, there is a solution for this issue. You can set up the table name of your singular test by adding the following to the config block of your singular test file:
Copy code
{{ config(     override_primary_test_model_id="model_unique_id" ) }}
Where
model_unique_id
is the unique identifier of the model in dbt, which can be found by running:
Copy code
SELECT unique_id FROM <elementary-schema-name>.dbt_models WHERE name=<model-name>
[Troubleshooting guide](https://docs.elementary-data.com/cloud/guides/troubleshoot) However, it's not clear from the knowledge sources if this solution is available in the OSS version. The Elementary team has mentioned they have plans to address this issue in the near future, but currently, singular tests that reference multiple models are not fully supported for owner, tagging, etc. in the OSS version.