Skip to content

Commit

Permalink
fix: Override BaseHook init to support Airflow v1
Browse files Browse the repository at this point in the history
Aiflow v1's BaseHook has the following __init__ signature:

def __init__(self, source)

This source argument is not used by us (or anywhere else in BaseHook), so we override it to not require it.
  • Loading branch information
tomasfarias authored Dec 6, 2021
1 parent 3b65cca commit 415eb81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions airflow_dbt_python/hooks/dbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ class DbtHook(BaseHook):
Allows for running dbt tasks and provides required configurations for each task.
"""

def __init__(self):
pass

def get_config_factory(self, command: str) -> ConfigFactory:
"""Get a ConfigFactory given a dbt command string."""
return ConfigFactory.from_str(command)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "airflow-dbt-python"
version = "0.9.2"
version = "0.9.3"
description = "A dbt operator for Airflow that uses the dbt Python package"
authors = ["Tomás Farías Santana <tomas@tomasfarias.dev>"]
license = "MIT"
Expand Down

0 comments on commit 415eb81

Please sign in to comment.