Skip to content

Commit a506a3c

Browse files
authored
Merge pull request #39 from getindata/release-0.18.1
Release 0.18.1
2 parents fae0049 + 89c4f06 commit a506a3c

15 files changed

+86
-14
lines changed

.github/workflows/python-package.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ jobs:
3232
pip freeze
3333
pipdeptree
3434
pre-commit run --all-files
35+
3536
- name: Test with tox
3637
run: |
37-
tox -e py37
38+
tox -e py37
39+
40+
- name: Report coverage
41+
uses: paambaati/codeclimate-action@v2.7.5
42+
env:
43+
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE }}
44+
with:
45+
coverageCommand: coverage xml
46+
debug: true
47+
coverageLocations: coverage.xml:coverage.py

CHANGELOG.md

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

33
## [Unreleased]
44

5+
## [0.18.1] - 2022-01-18
6+
7+
### Fixed
8+
9+
- Jinja's `FileSystemLoader` gets `str` instead of `pathlib.Path` to fix types incompatibility for `Jinja < 2.11.0`.
10+
- Use `get_start_task()` and `get_end_task()` in `AirflowDagFactory.create_tasks(config)` to prevent ephemeral ending tasks from throwing.
11+
512
## [0.18.0] - 2022-01-14
613

714
### Added
@@ -77,7 +84,9 @@
7784

7885
- Initial implementation of `dbt_airflow_manifest_parser` library.
7986

80-
[Unreleased]: https://github.com/getindata/dbt-airflow-factory/compare/0.18.0...HEAD
87+
[Unreleased]: https://github.com/getindata/dbt-airflow-factory/compare/0.18.1...HEAD
88+
89+
[0.18.1]: https://github.com/getindata/dbt-airflow-factory/compare/0.18.0...0.18.1
8190

8291
[0.18.0]: https://github.com/getindata/dbt-airflow-factory/compare/0.17.0...0.18.0
8392

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
# DBT Airflow Factory
22

3+
[![Python Version](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9-blue.svg)](https://github.com/getindata/dbt-airflow-factory)
4+
[![PyPI Version](https://badge.fury.io/py/dbt-airflow-factory.svg)](https://pypi.org/project/dbt-airflow-factory/)
5+
[![Downloads](https://pepy.tech/badge/dbt-airflow-factory)](https://pepy.tech/project/dbt-airflow-factory)
6+
[![Maintainability](https://api.codeclimate.com/v1/badges/47fd3570c858b6c166ad/maintainability)](https://codeclimate.com/github/getindata/dbt-airflow-factory/maintainability)
7+
[![Test Coverage](https://api.codeclimate.com/v1/badges/47fd3570c858b6c166ad/test_coverage)](https://codeclimate.com/github/getindata/dbt-airflow-factory/test_coverage)
8+
[![Documentation Status](https://readthedocs.org/projects/dbt-airflow-factory/badge/?version=latest)](https://dbt-airflow-factory.readthedocs.io/en/latest/?badge=latest)
9+
310
Library to convert DBT manifest metadata to Airflow tasks
411

12+
## Documentation
13+
14+
Read the full documentation at [https://dbt-airflow-factory.readthedocs.io/](https://dbt-airflow-factory.readthedocs.io/en/latest/index.html)
15+
516
## Installation
617

718
Use the package manager [pip][pip] to install the library:

dbt_airflow_factory/__init__.py

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

dbt_airflow_factory/airflow_dag_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ def create_tasks(self, config: dict) -> None:
8585
self._manifest_file_path(config), config.get("use_task_group") or False
8686
)
8787
for starting_task in tasks.get_starting_tasks():
88-
start >> starting_task.run_airflow_task
88+
start >> starting_task.get_start_task()
8989
for ending_task in tasks.get_ending_tasks():
90-
ending_task.test_airflow_task >> end
90+
ending_task.get_end_task() >> end
9191

9292
def _create_starting_task(self, config: dict) -> BaseOperator:
9393
if config.get("seed_task", True):

dbt_airflow_factory/config_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def get(item: str) -> Any:
106106
return Variable.get(item)
107107

108108
file_path = pathlib.Path(file_path)
109-
jinja_loader = FileSystemLoader(file_path.parent)
109+
jinja_loader = FileSystemLoader(str(file_path.parent))
110110
jinja_env = NativeEnvironment(loader=jinja_loader)
111111

112112
return jinja_env.get_template(file_path.name).render(

dbt_airflow_manifest_parser/config_utils.py

Whitespace-only changes.

docs/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```{include} ../CHANGELOG.md
2+
```

docs/changelog.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
``dbt-airflow-factory``
22
=======================
33

4+
.. image:: https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9-blue.svg
5+
:target: https://github.com/getindata/dbt-airflow-factory
6+
:alt: Python Version
7+
8+
.. image:: https://badge.fury.io/py/dbt-airflow-factory.svg
9+
:target: https://pypi.org/project/dbt-airflow-factory/
10+
:alt: PyPI Version
11+
12+
.. image:: https://pepy.tech/badge/dbt-airflow-factory
13+
:target: https://pepy.tech/project/dbt-airflow-factory
14+
:alt: Downloads
15+
16+
.. image:: https://api.codeclimate.com/v1/badges/47fd3570c858b6c166ad/maintainability
17+
:target: https://codeclimate.com/github/getindata/dbt-airflow-factory/maintainability
18+
:alt: Maintainability
19+
20+
.. image:: https://api.codeclimate.com/v1/badges/47fd3570c858b6c166ad/test_coverage
21+
:target: https://codeclimate.com/github/getindata/dbt-airflow-factory/test_coverage
22+
:alt: Test Coverage
23+
424

525
Installation
626
------------

docs/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sphinx-rtd-theme==1.0.0
22
sphinx-click>=3.0,<3.1
33
myst-parser>=0.16, <0.17
4-
docutils>=0.17,<0.18
4+
docutils<0.17
5+
apache-airflow[kubernetes]>=2.2.0,<3.0.0

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.18.0
2+
current_version = 0.18.1
33

44
[bumpversion:file:setup.py]
55

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"sphinx-rtd-theme==1.0.0",
2424
"sphinx-click>=3.0,<3.1",
2525
"myst-parser>=0.16, <0.17",
26-
"docutils>=0.17,<0.18",
26+
"docutils<0.17",
2727
],
2828
}
2929

3030
setup(
3131
name="dbt-airflow-factory",
32-
version="0.18.0",
32+
version="0.18.1",
3333
description="Library to convert DBT manifest metadata to Airflow tasks",
3434
long_description=README,
3535
long_description_content_type="text/markdown",

tests/manifest_ephemeral.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"nodes": {
33
"model.dbt_test.model1": {
44
"depends_on": {
5-
"nodes": ["source.dbt_test.source1"]
5+
"nodes": [
6+
"source.dbt_test.source1"
7+
]
68
},
79
"config": {
810
"materialized": "table"
@@ -100,6 +102,16 @@
100102
"config": {
101103
"materialized": "ephemeral"
102104
}
105+
},
106+
"model.dbt_test.model11": {
107+
"depends_on": {
108+
"nodes": [
109+
"model.dbt_test.model10"
110+
]
111+
},
112+
"config": {
113+
"materialized": "ephemeral"
114+
}
103115
}
104116
},
105117
"sources": {

tests/test_ephemeral_operator.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_ephemeral_dag_factory():
1919
dag = factory.create()
2020

2121
# then
22-
assert len(dag.tasks) == 15
22+
assert len(dag.tasks) == 16
2323

2424
task_group_names = [
2525
el
@@ -39,6 +39,7 @@ def test_ephemeral_dag_factory():
3939
"model8",
4040
"model9",
4141
"model10",
42+
"model11",
4243
]
4344
]
4445
assert set(dag.task_ids) == set(
@@ -102,3 +103,11 @@ def test_ephemeral_tasks():
102103
"model10__ephemeral"
103104
in tasks.get_task("model.dbt_test.model9").run_airflow_task.downstream_task_ids
104105
)
106+
assert (
107+
"model11__ephemeral"
108+
in tasks.get_task("model.dbt_test.model10").run_airflow_task.downstream_task_ids
109+
)
110+
assert (
111+
"model10__ephemeral"
112+
in tasks.get_task("model.dbt_test.model11").run_airflow_task.upstream_task_ids
113+
)

0 commit comments

Comments
 (0)