Skip to content

Commit ea2dcac

Browse files
committed
docs: Update docstrings in all files except tests
All flake8-docstring errors have been cleared except for those coming from test files since test files are not part of the documentation pipeline. Eventually will work on them though just so that we can eliminate the final ignore.
1 parent 127dfc9 commit ea2dcac

25 files changed

+40
-20
lines changed

.flake8

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
[flake8]
22
max-line-length = 88
33
docstring-convention = google
4-
# Will finish these later
5-
extend-ignore = D101,D107
4+
ignore = D107, W503
65
per-file-ignores =
7-
tests/*.py: D1,D2,D4
8-
examples/*.py: D1,D2,D4
9-
__version__.py: D100
106
__init__.py: F401
117
exclude =
128
airflow
@@ -16,6 +12,7 @@ exclude =
1612
setup.py
1713
build
1814
dist
15+
tests
1916
.venv
2017
.tox
2118
.mypy_cache

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ repos:
1010
hooks:
1111
- id: flake8
1212
additional_dependencies: [flake8-docstrings]
13+
args: ["--config", ".flake8"]
14+
exclude: tests/
1315

1416
- repo: https://github.com/pre-commit/mirrors-mypy
1517
rev: v0.902

airflow_dbt_python/__version__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""The module's version information."""
12
__author__ = "Tomás Farías Santana"
23
__copyright__ = "Copyright 2021 Tomás Farías Santana"
34
__title__ = "airflow-dbt-python"

airflow_dbt_python/hooks/dbt_s3.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88

99
class DbtS3Hook(S3Hook):
10+
"""Subclass of S3Hook with methods to pull dbt-related files.
11+
12+
A dbt hook should provide a method to pull a dbt profiles file (profiles.yml) and
13+
all the files corresponding to a project.
14+
"""
15+
1016
def get_dbt_profiles(
1117
self, s3_profiles_url: str, profiles_dir: Optional[str] = None
1218
) -> Path:

examples/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Usage examples of airflow-dbt-python."""

examples/basic_dag.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Sample basic DAG which dbt runs a project
3-
"""
1+
"""Sample basic DAG which dbt runs a project."""
42
import datetime as dt
53

64
from airflow import DAG

examples/complete_dbt_workflow_dag.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
"""
2-
Sample DAG showcasing a complete dbt workflow
1+
"""Sample DAG showcasing a complete dbt workflow.
2+
3+
The complete workflow includes a sequence of source, seed, and several run commands.
34
"""
45
import datetime as dt
56

examples/dbt_project_in_s3_dag.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Sample basic DAG which showcases a dbt project being pulled from S3
3-
"""
1+
"""Sample basic DAG which showcases a dbt project being pulled from S3."""
42
import datetime as dt
53

64
from airflow import DAG

examples/use_dbt_artifacts_dag.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Sample DAG to showcase pulling dbt artifacts from XCOM
3-
"""
1+
"""Sample DAG to showcase pulling dbt artifacts from XCOM."""
42
import datetime as dt
53

64
from airflow import DAG
@@ -10,9 +8,7 @@
108

119

1210
def process_dbt_artifacts(**context):
13-
"""
14-
Report which model or models took the longest to compile and execute
15-
"""
11+
"""Report which model or models took the longest to compile and execute."""
1612
run_results = context["ti"].xcom_pull(
1713
key="run_results.json", task_ids="dbt_run_daily"
1814
)

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""Conftest file including setting common fixtures.
2+
3+
Common fixtures include a connection to a postgres database, a set of sample model and
4+
seed files, dbt configuration files, and temporary directories for everything.
5+
"""
16
import boto3
27
import pytest
38
from dbt.version import __version__ as DBT_VERSION

0 commit comments

Comments
 (0)