-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adap 821/unit test infer wrong datatype (#852)
* Add test to confirm upstream handling * Add changelog. * Add another test. * standardize names to reflect python objects. * revert dev requirements. --------- Co-authored-by: Mila Page <[email protected]>
- Loading branch information
1 parent
e757692
commit b510298
Showing
3 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Fixes | ||
body: 'Handle unit test fixtures where typing goes wrong from first value in column | ||
being Null. ' | ||
time: 2024-06-25T17:03:24.73937-07:00 | ||
custom: | ||
Author: versusfacit | ||
Issue: "821" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
model_none_value_base = """ | ||
{{ config(materialized="table") }} | ||
select 1 as id, 'a' as col1 | ||
""" | ||
|
||
model_none_value_model = """ | ||
{{config(materialized="table")}} | ||
select * from {{ ref('none_value_base') }} | ||
""" | ||
|
||
|
||
test_none_column_value_doesnt_throw_error_csv = """ | ||
unit_tests: | ||
- name: test_simple | ||
model: none_value_model | ||
given: | ||
- input: ref('none_value_base') | ||
format: csv | ||
rows: | | ||
id,col1 | ||
,d | ||
,e | ||
6,f | ||
expect: | ||
format: csv | ||
rows: | | ||
id,col1 | ||
,d | ||
,e | ||
6,f | ||
""" | ||
|
||
test_none_column_value_doesnt_throw_error_dct = """ | ||
unit_tests: | ||
- name: test_simple | ||
model: none_value_model | ||
given: | ||
- input: ref('none_value_base') | ||
rows: | ||
- { "id": , "col1": "d"} | ||
- { "id": , "col1": "e"} | ||
- { "id": 6, "col1": "f"} | ||
expect: | ||
rows: | ||
- {id: , "col1": "d"} | ||
- {id: , "col1": "e"} | ||
- {id: 6, "col1": "f"} | ||
""" | ||
|
||
test_none_column_value_will_throw_error = """ | ||
unit_tests: | ||
- name: test_simple | ||
model: none_value_model | ||
given: | ||
- input: ref('none_value_base') | ||
rows: | ||
- { "id": , "col1": "d"} | ||
- { "id": , "col1": "e"} | ||
- { "id": 6, "col1": } | ||
expect: | ||
rows: | ||
- {id: , "col1": "d"} | ||
- {id: , "col1": "e"} | ||
- {id: 6, "col1": } | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters