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
2 changes: 1 addition & 1 deletion elementary/monitor/dbt_project/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ vars:

models:
elementary_cli:
+file_format: "{{ 'delta' if target.type in ['spark', 'fabricspark'] else none }}"
+file_format: "{{ 'delta' if target.type in ['spark', 'fabricspark', 'databricks'] else none }}"

quoting:
database: "{{ env_var('DATABASE_QUOTING', 'None') | as_native }}"
Expand Down
28 changes: 28 additions & 0 deletions tests/unit/monitor/test_dbt_project_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Tests for elementary monitor dbt_project configuration."""

import os

FILE_DIR = os.path.dirname(os.path.realpath(__file__))
DBT_PROJECT_PATH = os.path.normpath(
os.path.join(
FILE_DIR,
"..",
"..",
"..",
"elementary",
"monitor",
"dbt_project",
"dbt_project.yml",
)
)


def test_databricks_target_uses_delta_file_format():
"""When target.type is databricks, file_format should be delta."""
with open(DBT_PROJECT_PATH) as f:
content = f.read()
assert "databricks" in content, "databricks must be in target.type condition for delta"
assert "file_format" in content
assert "delta" in content
assert "spark" in content
assert "fabricspark" in content
Loading