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

Allow users to be able to run assert (data tests) on specific models #165

Closed
DylanBaker opened this issue Mar 20, 2020 · 1 comment · Fixed by #235
Closed

Allow users to be able to run assert (data tests) on specific models #165

DylanBaker opened this issue Mar 20, 2020 · 1 comment · Fixed by #235
Assignees
Labels
Enhancement New feature or request Validator: Assert

Comments

@DylanBaker
Copy link
Collaborator

Currently, the assert command runs all data tests. It appears from the docs that we could specific which models it should run. We should allow that workflow.

It appears that you can't specify this at an explore level via the run API endpoint, but it's possible the explore is attached to the returned data in the 'Get All LookML' tests endpoint and that we could filter from there and specify exactly which tests we want to run.

@DylanBaker
Copy link
Collaborator Author

The get all lookml tests endpoint does return the explores, so we should actually be able to provide the same model selection syntax as we do for the SQL validator.

Example response:

[
  {
    "model_name": "jaffle_shop",
    "name": "historic_revenue_is_accurate",
    "explore_name": "fct_orders",
    "query_url_params": "fields=fct_orders.count_orders&f[fct_orders.order_year]=2018&limit=500&dynamic_fields=%5B%7B%22table_calculation%22%3A%22looker_assert_revenue_is_expected_value%22%2C%22label%22%3A%22Revenue+Is+Expected+Value%22%2C%22expression%22%3A%22%24%7Bfct_orders.count_orders%7D+%3D+99+%22%7D%5D",
    "file": "jaffle_shop/jaffle_shop.model.lkml",
    "line": 14,
    "can": {}
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Validator: Assert
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants