Skip to content

Commit

Permalink
Merge branch 'main' into 7785_fail_fast
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke authored Jul 11, 2023
2 parents 1813c03 + 7740bd6 commit 56bcfd2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20230320-153225.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: add negative part_number arg for split part macro
time: 2023-03-20T15:32:25.5932-05:00
custom:
Author: dave-connors-3
Issue: "7915"
7 changes: 7 additions & 0 deletions .changes/unreleased/Fixes-20230711-083213.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Fixes
body: Remove `create_metric` as a `SemanticModel.Measure` property because it currently
doesn't do anything
time: 2023-07-11T08:32:13.158779-07:00
custom:
Author: QMalcolm
Issue: "8064"
1 change: 0 additions & 1 deletion core/dbt/contracts/graph/unparsed.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,6 @@ class UnparsedMeasure(dbtClassMixin):
name: str
agg: str # actually an enum
description: Optional[str] = None
create_metric: bool = False
expr: Optional[Union[str, bool, int]] = None
agg_params: Optional[MeasureAggregationParameters] = None
non_additive_dimension: Optional[UnparsedNonAdditiveDimension] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
length({{ string_text }})
- length(
replace({{ string_text }}, {{ delimiter_text }}, '')
) + 2 {{ part_number }}
) + 2 + {{ part_number }}
)

{% endmacro %}
1 change: 0 additions & 1 deletion core/dbt/parser/schema_yaml_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ def _get_measures(self, unparsed_measures: List[UnparsedMeasure]) -> List[Measur
name=unparsed.name,
agg=AggregationType(unparsed.agg),
description=unparsed.description,
create_metric=unparsed.create_metric,
expr=str(unparsed.expr) if unparsed.expr is not None else None,
agg_params=unparsed.agg_params,
non_additive_dimension=self._get_non_additive_dimension(
Expand Down
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

0 comments on commit 56bcfd2

Please sign in to comment.