Skip to content

Commit 8c2a696

Browse files
authored
Merge branch 'master' into ele-4409-collect-dbt-group
2 parents c9ede1e + 788ea52 commit 8c2a696

41 files changed

Lines changed: 468 additions & 444 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-all-warehouses.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,9 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
dbt-version: ${{ inputs.dbt-version && fromJSON(format('["{0}"]', inputs.dbt-version)) || fromJSON('["1.7.0", null]') }}
28+
dbt-version: ${{ inputs.dbt-version && fromJSON(format('["{0}"]', inputs.dbt-version)) || fromJSON('["1.8.0", null]') }}
2929
warehouse-type:
30-
[
31-
postgres,
32-
snowflake,
33-
bigquery,
34-
redshift,
35-
databricks,
36-
databricks_catalog,
37-
athena,
38-
clickhouse,
39-
]
30+
[postgres, snowflake, bigquery, redshift, databricks_catalog, athena]
4031
uses: ./.github/workflows/test-warehouse.yml
4132
with:
4233
warehouse-type: ${{ matrix.warehouse-type }}

.github/workflows/test-release.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,7 @@ jobs:
4747
fail-fast: false
4848
matrix:
4949
warehouse-type:
50-
[
51-
postgres,
52-
snowflake,
53-
bigquery,
54-
redshift,
55-
databricks,
56-
databricks_catalog,
57-
athena,
58-
clickhouse,
59-
]
50+
[postgres, snowflake, bigquery, redshift, databricks_catalog, athena]
6051
needs: get-latest-release-tags
6152
uses: ./.github/workflows/test-warehouse.yml
6253
with:

.github/workflows/test-warehouse.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ on:
1111
- snowflake
1212
- bigquery
1313
- redshift
14-
- databricks
1514
- databricks_catalog
1615
- spark
1716
- athena
18-
- clickhouse
1917
elementary-ref:
2018
type: string
2119
required: false
@@ -106,10 +104,10 @@ jobs:
106104
working-directory: ${{ env.DBT_PKG_INTEG_TESTS_DIR }}
107105
run: docker compose up -d postgres
108106

109-
- name: Start Clickhouse
110-
if: inputs.warehouse-type == 'clickhouse'
111-
working-directory: ${{ env.DBT_PKG_INTEG_TESTS_DIR }}
112-
run: docker compose up -d clickhouse
107+
# - name: Start Clickhouse
108+
# if: inputs.warehouse-type == 'clickhouse'
109+
# working-directory: ${{ env.DBT_PKG_INTEG_TESTS_DIR }}
110+
# run: docker compose up -d clickhouse
113111

114112
- name: Setup Python
115113
uses: actions/setup-python@v4
@@ -124,7 +122,8 @@ jobs:
124122
run: >
125123
pip install
126124
"dbt-core${{ inputs.dbt-version && format('=={0}', inputs.dbt-version) }}"
127-
"dbt-${{ (inputs.warehouse-type == 'databricks_catalog' && 'databricks') || inputs.warehouse-type }}${{ inputs.dbt-version && format('<={0}', inputs.dbt-version) }}"
125+
# TODO: remove the <1.10.2 once we have a fix for https://github.com/elementary-data/elementary/issues/1931
126+
"dbt-${{ (inputs.warehouse-type == 'databricks_catalog' && 'databricks<1.10.2,') || inputs.warehouse-type }}${{ inputs.dbt-version && format('~={0}', inputs.dbt-version) }}"
128127
129128
- name: Install Elementary
130129
run: |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ For additional information and help, you can use one of these channels:
7575

7676
- [Slack community](https://www.elementary-data.com/community) \(Release announcements, community support, discussions, etc.\)
7777
- [GitHub issues](https://github.com/elementary-data/elementary/issues) \(Bug reports, feature requests)
78-
- Check out the [contributions guide](https://docs.elementary-data.com/general/contributions) and [open issues](https://github.com/elementary-data/elementary/issues).
78+
- Check out the [contributions guide](./CONTRIBUTING.md) and [open issues](https://github.com/elementary-data/elementary/issues).
7979

8080
##
8181

docs/_snippets/quickstart-package-install.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Some packages we recommend you check out: [dbt_utils](https://github.com/dbt-lab
3939
```yml packages.yml
4040
packages:
4141
- package: elementary-data/elementary
42-
version: 0.18.3
42+
version: 0.19.0
4343
## Docs: https://docs.elementary-data.com
4444
```
4545
</Step>

elementary/messages/block_builders.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,28 @@ def ItalicTextLineBlock(*, text: SimpleLineBlock) -> LineBlock:
8282
return TextLineBlock(text=text, style=TextStyle.ITALIC)
8383

8484

85+
def LinkInlineBlocks(
86+
*, text: str, url: str, icon: Optional[Icon] = None
87+
) -> list[InlineBlock]:
88+
inlines: list[InlineBlock] = []
89+
if icon:
90+
inlines.append(IconBlock(icon=icon))
91+
inlines.append(LinkBlock(text=text, url=url))
92+
return inlines
93+
94+
8595
def LinkLineBlock(*, text: str, url: str) -> LineBlock:
86-
return LineBlock(inlines=[LinkBlock(text=text, url=url)])
96+
return LineBlock(inlines=LinkInlineBlocks(text=text, url=url))
97+
98+
99+
def LinksLineBlock(*, links: list[tuple[str, str, Optional[Icon]]]) -> LineBlock:
100+
return LineBlock(
101+
inlines=[
102+
inline
103+
for text, url, icon in links
104+
for inline in LinkInlineBlocks(text=text, url=url, icon=icon)
105+
]
106+
)
87107

88108

89109
def SummaryLineBlock(

elementary/messages/blocks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Icon(Enum):
1919
GEAR = "gear"
2020
BELL = "bell"
2121
GEM = "gem"
22+
SPARKLES = "sparkles"
2223

2324

2425
class TextStyle(Enum):

elementary/messages/formats/html.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Icon.GEAR: "⚙️",
1515
Icon.BELL: "🔔",
1616
Icon.GEM: "💎",
17+
Icon.SPARKLES: "✨",
1718
}
1819

1920
for icon in Icon:

elementary/monitor/alerts/alert_messages/builder.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
FactsBlock,
1010
ItalicTextLineBlock,
1111
JsonCodeBlock,
12-
LinkLineBlock,
12+
LinksLineBlock,
1313
MentionLineBlock,
1414
NonPrimaryFactBlock,
1515
PrimaryFactBlock,
@@ -104,7 +104,7 @@ def _get_run_alert_subtitle_block(
104104
detected_at_str: Optional[str] = None,
105105
suppression_interval: Optional[int] = None,
106106
env: Optional[str] = None,
107-
report_link: Optional[ReportLinkData] = None,
107+
links: list[ReportLinkData] = [],
108108
) -> LinesBlock:
109109
summary = []
110110
summary.append((type.capitalize() + ":", name))
@@ -117,12 +117,23 @@ def _get_run_alert_subtitle_block(
117117
summary.append(("Suppression interval:", str(suppression_interval)))
118118
subtitle_lines = [SummaryLineBlock(summary=summary)]
119119

120-
if report_link:
120+
if links:
121121
subtitle_lines.append(
122-
LinkLineBlock(text="View in Elementary", url=report_link.url)
122+
LinksLineBlock(
123+
links=[(link.text, link.url, link.icon) for link in links]
124+
)
123125
)
124126
return LinesBlock(lines=subtitle_lines)
125127

128+
def _get_run_alert_subtitle_links(
129+
self,
130+
alert: Union[TestAlertModel, SourceFreshnessAlertModel, ModelAlertModel],
131+
) -> List[ReportLinkData]:
132+
report_link = alert.get_report_link()
133+
if report_link:
134+
return [report_link]
135+
return []
136+
126137
def _get_run_alert_subtitle_blocks(
127138
self,
128139
alert: Union[TestAlertModel, SourceFreshnessAlertModel, ModelAlertModel],
@@ -138,6 +149,7 @@ def _get_run_alert_subtitle_blocks(
138149
elif isinstance(alert, ModelAlertModel):
139150
asset_type = "snapshot" if alert.materialization == "snapshot" else "model"
140151
asset_name = alert.alias
152+
links = self._get_run_alert_subtitle_links(alert)
141153
return [
142154
self._get_run_alert_subtitle_block(
143155
type=asset_type,
@@ -146,7 +158,7 @@ def _get_run_alert_subtitle_blocks(
146158
detected_at_str=alert.detected_at_str,
147159
suppression_interval=alert.suppression_interval,
148160
env=alert.env,
149-
report_link=alert.get_report_link(),
161+
links=links,
150162
)
151163
]
152164

elementary/monitor/data_monitoring/alerts/integrations/utils/report_link.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from enum import Enum
22
from typing import Optional
33

4+
from elementary.messages.blocks import Icon
45
from elementary.utils.pydantic_shim import BaseModel
56

67
TEST_RUNS_LINK_TEXT = "View test runs"
@@ -10,6 +11,7 @@
1011
class ReportLinkData(BaseModel):
1112
url: str
1213
text: str
14+
icon: Optional[Icon] = None
1315

1416

1517
class ReportPath(Enum):
@@ -31,9 +33,11 @@ def _get_run_history_report_link(
3133
url = f"{formatted_report_url}/report/{path.value}/{unique_id}/"
3234
report_link = ReportLinkData(
3335
url=url,
34-
text=TEST_RUNS_LINK_TEXT
35-
if path == ReportPath.TEST_RUNS
36-
else MODEL_RUNS_LINK_TEXT,
36+
text=(
37+
TEST_RUNS_LINK_TEXT
38+
if path == ReportPath.TEST_RUNS
39+
else MODEL_RUNS_LINK_TEXT
40+
),
3741
)
3842

3943
return report_link
@@ -62,7 +66,7 @@ def get_model_test_runs_link(
6266

6367
if model_unique_id and report_url:
6468
formatted_report_url = _get_formatted_report_url(report_url)
65-
url = f'{formatted_report_url}/report/{ReportPath.TEST_RUNS.value}/?treeNode={{"id":"{model_unique_id}"}}'
69+
url = f'{formatted_report_url}/report/{ReportPath.TEST_RUNS.value}/?treeNode={{"id":"{model_unique_id}"}}' # noqa: E231
6670
report_link = ReportLinkData(url=url, text=TEST_RUNS_LINK_TEXT)
6771

6872
return report_link

0 commit comments

Comments
 (0)