Skip to content

Commit

Permalink
Merge branch 'master' into docs-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ellakz authored Feb 17, 2025
2 parents 1f1c0ec + 986d735 commit a8177b1
Show file tree
Hide file tree
Showing 207 changed files with 17,034 additions and 2,106 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Create release branch
run: git checkout -b release/v${{ inputs.cli-version }}
- name: Initial config
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
needs: bump-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: create pull request
uses: repo-sync/pull-request@v2
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Elementary
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -27,7 +27,7 @@ jobs:
run: python -m build --sdist --wheel --outdir dist .

- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
path: dist
Expand All @@ -46,7 +46,7 @@ jobs:

steps:
- name: Checkout Elementary
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU for multi-platform support
uses: docker/setup-qemu-action@v3
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
merge-to-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: PR master to docs
uses: repo-sync/pull-request@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Elementary
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4.3.0
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-github-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
working-directory: elementary
steps:
- name: Checkout Elementary
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: elementary
ref: ${{ inputs.elementary-ref }}

- name: Checkout dbt package
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: elementary-data/dbt-data-reliability
path: dbt-data-reliability
Expand Down Expand Up @@ -90,14 +90,14 @@ jobs:
--file-path "report.html"

- name: Upload report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: report.html
path: edr_target/report.html

- name: Upload log
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: edr.log
path: edr_target/edr.log
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-main-warehouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches: ["master"]
paths:
- elementary/**
- .github/**
- pyproject.toml
workflow_dispatch:

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test-warehouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ jobs:
cancel-in-progress: true
steps:
- name: Checkout Elementary
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: elementary
ref: ${{ inputs.elementary-ref }}

- name: Checkout dbt package
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: elementary-data/dbt-data-reliability
path: dbt-data-reliability
Expand All @@ -106,7 +106,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"

- name: Install Spark requirements
if: inputs.warehouse-type == 'spark'
Expand Down Expand Up @@ -182,9 +182,9 @@ jobs:
--project-profile-target "${{ inputs.warehouse-type }}"
- name: Upload report artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: report_${{ inputs.warehouse-type }}_${{ env.BRANCH_NAME }}.html
name: report_${{ inputs.warehouse-type }}_${{ env.BRANCH_NAME }}_dbt_${{ inputs.dbt-version }}.html
path: elementary/edr_target/elementary_report.html

- name: Write GCS keyfile
Expand Down Expand Up @@ -218,9 +218,9 @@ jobs:
- name: Upload edr log
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: edr.log
name: edr_${{ inputs.warehouse-type }}_${{ env.BRANCH_NAME }}_dbt_${{ inputs.dbt-version }}.log
path: elementary/edr_target/edr.log

- name: Run Python package e2e tests
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ var/
logs/
.venv
poetry.lock
package-lock.yml

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -97,4 +96,4 @@ venv/

# elementary outputs
edr_target/
tests/tests_with_db/dbt_project/dbt_packages/
tests/tests_with_db/dbt_project/dbt_packages/
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,20 @@ repos:
entry: mypy --no-error-summary
language: system
files: ^elementary/.*\.py$

- repo: local
hooks:
- id: verify-dbt-project-packages-lock
name: Verify internal dbt project package lock
entry: |
bash -c '
dbt_version=$(python -c "from dbt.version import __version__; print(__version__)");
required_version="1.8";
if [[ $(echo -e "$dbt_version\n$required_version" | sort -V | tail -1) == "$dbt_version" ]]; then
dbt deps --lock --project-dir elementary/monitor/dbt_project && git diff --quiet elementary/monitor/dbt_project/package-lock.yml || (echo "Changes detected in package lock file!" && exit 1);
else
echo "Skipping hook, dbt version is $dbt_version (< 1.8).";
fi
'
language: system
pass_filenames: false
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,29 @@
"module": "elementary.cli.cli",
"console": "integratedTerminal",
"args": "${command:pickArgs}"
},
{
"name": "pytest: Current File",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": ["-vvv", "-s", "${file}"],
"console": "integratedTerminal"
},
{
"name": "pytest: Selector",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": ["-vvv", "-s", "${file}::${input:selector}"],
"console": "integratedTerminal"
}
],
"inputs": [
{
"id": "selector",
"type": "promptString",
"description": "Selector"
}
]
}
1 change: 0 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ types-pytz
types-jsonschema
types-PyYAML
types-setuptools
pandas-stubs
types-retry
types-decorator
30 changes: 15 additions & 15 deletions docs/_snippets/guides/alerts-code-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ models:
```yml test
tests:
- not_null:
meta:
owner: ["@jessica.jones", "@joe.joseph"]
meta:
owner: ["@jessica.jones", "@joe.joseph"]
```
```yml test/model config block
Expand Down Expand Up @@ -111,8 +111,8 @@ models:
```yml test
tests:
- not_null:
meta:
subscribers: ["@jessica.jones", "@joe.joseph"]
meta:
subscribers: ["@jessica.jones", "@joe.joseph"]
```

```yml test/model config block
Expand Down Expand Up @@ -149,8 +149,8 @@ It's recommended to add an explanation of what does it mean if this test fails,
```yml test
tests:
- not_null:
meta:
description: "This is the test description"
meta:
description: "This is the test description"
```

```yml test config block
Expand Down Expand Up @@ -190,7 +190,7 @@ models:
```yml test
tests:
- not_null:
tags: ["#marketing", "#data_ops"]
tags: ["#marketing", "#data_ops"]
```

```yml test/model config block
Expand Down Expand Up @@ -238,8 +238,8 @@ models:
```yml test
tests:
- not_null:
meta:
channel: data_ops
meta:
channel: data_ops
```

```yml test/model config block
Expand Down Expand Up @@ -288,8 +288,8 @@ models:
```yml test
tests:
- not_null:
meta:
alert_suppression_interval: 12
meta:
alert_suppression_interval: 12
```

```yml test/model config block
Expand Down Expand Up @@ -338,8 +338,8 @@ models:
```yml test
tests:
- not_null:
meta:
slack_group_alerts_by: table
meta:
slack_group_alerts_by: table
```

```yml test/model config block
Expand Down Expand Up @@ -398,8 +398,8 @@ models:
```yml test
tests:
- not_null:
meta:
alert_fields: ["description", "owners", "tags", "subscribers"]
meta:
alert_fields: ["description", "owners", "tags", "subscribers"]
```

```yml test/model config block
Expand Down
2 changes: 1 addition & 1 deletion docs/_snippets/quickstart-package-install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Some packages we recommend you check out: [dbt_utils](https://github.com/dbt-lab
```yml packages.yml
packages:
- package: elementary-data/elementary
version: 0.16.0
version: 0.16.4
## Docs: https://docs.elementary-data.com
```
</Step>
Expand Down
41 changes: 37 additions & 4 deletions docs/_snippets/setup-teams-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ Call it `Elementary` (or whatever you prefer) and connect it to the workspace of

</Accordion>

Now it is time to setup the webhook for this channel.
Now it's time to set up a webhook. You have two options for creating a webhook:

<Accordion title="Create Teams Webhook">
<Accordion title="Option 1: Create Teams Webhook using Connectors (Legacy)">

## Create a webhook
## Create a webhook using Connectors

**Note:** Microsoft 365 Connectors are being deprecated. Consider using Power Automate Workflows (Option 2) for new integrations.

Go to a channel in your Team and choose `Manage channel`

Expand Down Expand Up @@ -77,7 +79,38 @@ Copy the URL of the webhook.

</Accordion>

Lastly, pass the webhook to the CLI as a param or in the `config.yml` file:
<Accordion title="Option 2: Create Teams Webhook using Power Automate (Recommended)">

## Create a webhook using Power Automate

You can create a webhook using Power Automate in two ways:

### Method 1: Directly from Teams (Recommended)

1. Go to your Teams channel
2. Click the three dots (...) next to the channel name
3. Select `Workflows`
4. Choose the template "Post to channel when a webhook request is received"
5. Copy the webhook URL

### Method 2: From Power Automate Website

1. Go to [Power Automate](https://flow.microsoft.com)
2. Create a new instant cloud flow
3. Search for "When a HTTP request is received" as your trigger
4. In the flow, add a "Post adaptive card in a chat or channel" action
5. Configure the team and channel where you want to post
6. Save the flow and copy the HTTP POST URL

**Important Notes:**

- When using Power Automate Workflows, Elementary CLI cannot directly verify if messages were successfully delivered. You'll need to monitor your workflow runs in Power Automate to check for any delivery issues.
- Workflows can't post in private channels as a flow bot, but can post on behalf of a user
- Workflows can only be created in your default environment

</Accordion>

Lastly, pass the webhook URL (from either method) to the CLI as a param or in the `config.yml` file:

<Accordion title="Teams config as CLI params">

Expand Down
Loading

0 comments on commit a8177b1

Please # to comment.