Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests do not respect macro variables #3979

Open
m1hawkgsm opened this issue Mar 12, 2025 · 0 comments
Open

Unit tests do not respect macro variables #3979

m1hawkgsm opened this issue Mar 12, 2025 · 0 comments
Labels
Improvement Improves existing functionality

Comments

@m1hawkgsm
Copy link

We're on SQLMesh version 0.164.0, and we have a test of the form:

test_claim_model:
    model: "{{ var('silver') }}.client_x.claim"
    inputs:
      "BRONZE.client_x.CLAIM":
        file: tests/silver/client_x/data/bronze_claim.csv
      "@{SILVER}.client_x.INSURANCE_PLAN":
        file: tests/silver/client_x/data/silver_insurance_plan.csv
    outputs:
      query:
        file: tests/silver/client_x/data/silver_claim.csv

Now, silver is a variable that is well defined in our config.py, and I can verify this because every single model has a database parameterization on a variable such as silver, and sqlmesh plan/sqlmesh run have worked fine.

However, running sqlmesh test, consistently we get:

[WARNING] Model '"NONE"."client_x"."CLAIM"' was not found at /Users/gesus/Repos/core/adonis-core/adonis_sqlmesh/integrations/tests/silver/client_x/test_claim.yaml

As you can see, as well, we follow this document and even mix different modalities of using variables.

Am I missing something obvious or do we have a bug here?

@izeigerman izeigerman added the Improvement Improves existing functionality label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Improves existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants