Skip to content

Commit 09176d8

Browse files
github-actions[bot]swtwskp-pekalagithub-actions
authored
Release 0.22.0 (#50)
* Remove ephemeral tasks from DAG (#48) * Remove ephemeral tasks * Simplify test contraction * Add ephemeral tests * Slack failure notifications (#49) * Slack failure notifications * FIX #50 - Bump version and CHANGELOG for release 0.22.0 Co-authored-by: Andrzej Swatowski <33041023+swtwsk@users.noreply.github.com> Co-authored-by: Piotr Pękala <piotr_pekala@wp.pl> Co-authored-by: github-actions <github-actions@github.com>
1 parent 77880e2 commit 09176d8

File tree

16 files changed

+396
-128
lines changed

16 files changed

+396
-128
lines changed

.isort.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ known_first_party = dbt_airflow_factory
44
default_section = THIRDPARTY
55

66
[settings]
7-
known_third_party = airflow,jinja2,pytimeparse,setuptools,yaml
7+
known_third_party = airflow,jinja2,networkx,pytimeparse,setuptools,yaml

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## [Unreleased]
44

5+
## [0.22.0] - 2022-03-21
6+
7+
- Failure notifications via slack
8+
9+
### Added
10+
11+
- Ephemeral nodes can be hidden from DAG by setting `show_ephemeral_models: False` in project's `airflow.yml`.
12+
513
## [0.21.0] - 2022-02-11
614

715
This version brings compatibility with `dbt 1.0`.
@@ -98,7 +106,9 @@ This version brings compatibility with `dbt 1.0`.
98106

99107
- Initial implementation of `dbt_airflow_manifest_parser` library.
100108

101-
[Unreleased]: https://github.com/getindata/dbt-airflow-factory/compare/0.21.0...HEAD
109+
[Unreleased]: https://github.com/getindata/dbt-airflow-factory/compare/0.22.0...HEAD
110+
111+
[0.22.0]: https://github.com/getindata/dbt-airflow-factory/compare/0.21.0...0.22.0
102112

103113
[0.21.0]: https://github.com/getindata/dbt-airflow-factory/compare/0.20.1...0.21.0
104114

dbt_airflow_factory/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.21.0"
1+
version = "0.22.0"

dbt_airflow_factory/airflow_dag_factory.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from dbt_airflow_factory.builder import DbtAirflowTasksBuilder
1717
from dbt_airflow_factory.builder_factory import DbtAirflowTasksBuilderFactory
1818
from dbt_airflow_factory.config_utils import read_config
19+
from dbt_airflow_factory.notifications.handler import NotificationHandlersFactory
1920

2021

2122
class AirflowDagFactory:
@@ -59,6 +60,7 @@ def __init__(
5960
dbt_config_file_name,
6061
execution_env_config_file_name,
6162
).create()
63+
self._notifications_handlers_builder = NotificationHandlersFactory()
6264
self.dag_path = dag_path
6365
self.env = env
6466
self.airflow_config_file_name = airflow_config_file_name
@@ -85,7 +87,9 @@ def create_tasks(self, config: dict) -> None:
8587
start = self._create_starting_task(config)
8688
end = DummyOperator(task_id="end")
8789
tasks = self._builder.parse_manifest_into_tasks(
88-
self._manifest_file_path(config), config.get("use_task_group") or False
90+
self._manifest_file_path(config),
91+
config.get("use_task_group", False),
92+
config.get("show_ephemeral_models", True),
8993
)
9094
for starting_task in tasks.get_starting_tasks():
9195
start >> starting_task.get_start_task()
@@ -115,4 +119,10 @@ def read_config(self) -> dict:
115119
)
116120
if "retry_delay" in config["default_args"]:
117121
config["default_args"]["retry_delay"] = parse(config["default_args"]["retry_delay"])
122+
if "failure_handlers" in config:
123+
config["default_args"][
124+
"on_failure_callback"
125+
] = self._notifications_handlers_builder.create_failure_handler(
126+
config["failure_handlers"]
127+
)
118128
return config

0 commit comments

Comments
 (0)