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

add negative test case for split_part cross db macro #7193

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20230319-151533.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: add negative part_number argument for split part macro
time: 2023-03-19T15:15:33.7376-05:00
custom:
Author: dave-connors-3
Issue: "615"
16 changes: 12 additions & 4 deletions tests/adapter/dbt/tests/adapter/utils/fixture_split_part.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# split_part

seeds__data_split_part_csv = """parts,split_on,result_1,result_2,result_3
a|b|c,|,a,b,c
1|2|3,|,1,2,3
,|,,,
seeds__data_split_part_csv = """parts,split_on,result_1,result_2,result_3,result_4
a|b|c,|,a,b,c,c
1|2|3,|,1,2,3,3
,|,,,,
"""


Expand Down Expand Up @@ -34,6 +34,14 @@
{{ split_part('parts', 'split_on', 3) }} as actual,
result_3 as expected

from data

union all

select
{{ split_part('parts', 'split_on', -1) }} as actual,
result_4 as expected

from data
"""

Expand Down