You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of requiring folks to run dbt run --select +my_model --exclude my_model before executing unit tests on my_model or requiring the use of --deferral (which would cause issues in a CI context when you're deferring to a production environment and may have changes to your inputs as part of the PR)...
we should be able to run dbt unit-test --select my_model in a new environment without having previously run dbt run --select +my_model --exclude my_model or dbt docs generate
we will use the data_types defined in the direct parent's yml config
if no data_type is provided...
we will have the warehouse "presume" the data type based on the mock data provided (users could put cast statements in their fixture)
if no mock data is provided for a column, we will guess that the data type is a string
raise a warning during unit test execution if an input fixture specifies columns that don’t have user-provided data_type values.
We will need to confirm when we should add '' around the mocked data.
We can get all column names from adapter.get_column_schema_from_query so users don't have to provide a yml name for all columns of direct parents.
Acceptance criteria
I can run dbt unit-test --select my_model in a new environment without having previously run dbt run --select +my_model --exclude my_model or dbt docs generate
github-actionsbot
changed the title
[implementation] infer fixture data types for unit testing
[CT-3176] [implementation] infer fixture data types for unit testing
Oct 2, 2023
graciegoheen
changed the title
[CT-3176] [implementation] infer fixture data types for unit testing
[CT-3176] [spike] infer fixture data types for unit testing
Oct 25, 2023
Housekeeping
Short description
From #8649
Instead of requiring folks to run dbt run --select +my_model --exclude my_model before executing unit tests on my_model or requiring the use of --deferral (which would cause issues in a CI context when you're deferring to a production environment and may have changes to your inputs as part of the PR)...
we should be able to run dbt unit-test --select my_model in a new environment without having previously run dbt run --select +my_model --exclude my_model or dbt docs generate
raise a warning during unit test execution if an input fixture specifies columns that don’t have user-provided data_type values.
We will need to confirm when we should add '' around the mocked data.
We can get all column names from
adapter.get_column_schema_from_query
so users don't have to provide a yml name for all columns of direct parents.Acceptance criteria
dbt unit-test --select my_model
in a new environment without having previously rundbt run --select +my_model --exclude my_model
ordbt docs generate
Impact to Other Teams
No
Will backports be required?
No
Context
No response
The text was updated successfully, but these errors were encountered: