Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions opendbt/airflow/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ class DBTDocsView(BaseView):
route_base = "/dbt"
default_view = "dbt_docs_index"

def __init__(self, projects: Dict[str, Path]):
def __init__(self, project_paths=None):
self._static_project_paths = project_paths
super().__init__()
self.projects = projects

@property
def projects(self) -> Dict[str, Path]:
"""Resolve projects dynamically so Variable changes take effect without restart."""
return get_projects(self._static_project_paths)

def _check_configuration(self) -> Optional[Response]:
"""Check if configuration is valid. Returns error response if invalid, None if OK."""
Expand Down Expand Up @@ -216,8 +221,7 @@ def init_plugins_dbtdocs_page(
Returns:
AirflowPlugin class
"""
projects = get_projects(dbt_docs_dir)
view = DBTDocsView(projects)
view = DBTDocsView(project_paths=dbt_docs_dir)

static_folder = None

Expand Down
2 changes: 1 addition & 1 deletion opendbt/catalog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import sqlglot
import tqdm
from sqlglot import Expression
from sqlglot.expressions import Expression
from sqlglot.lineage import lineage, SqlglotError, exp

from opendbt.logger import OpenDbtLogger
Expand Down
Loading