Skip to content

Commit 4a2a8c7

Browse files
committed
prevent redundant patch calls
1 parent 27624a6 commit 4a2a8c7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

elementary/clients/dbt/command_line_dbt_runner.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class DbtCommandResult:
2828

2929

3030
class CommandLineDbtRunner(BaseDbtRunner):
31+
_dbx_patch_applied = False
32+
3133
def __init__(
3234
self,
3335
project_dir: str,
@@ -52,8 +54,10 @@ def __init__(
5254
self.raise_on_failure = raise_on_failure
5355
self.env_vars = env_vars
5456

55-
# Apply databricks compatibility patch for version 1.10.2
56-
self._apply_databricks_compatibility_patch()
57+
# Apply databricks compatibility patch for version 1.10.2 only once
58+
if not CommandLineDbtRunner._dbx_patch_applied:
59+
self._apply_databricks_compatibility_patch()
60+
CommandLineDbtRunner._dbx_patch_applied = True
5761

5862
if force_dbt_deps:
5963
self.deps()

0 commit comments

Comments
 (0)