diff --git a/CHANGELOG.md b/CHANGELOG.md index 4deb220..fa8603e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fixes + +- Fixed `dbt init` failing to parse the adapter's `profile_template.yml`. The `workspace_name` hint's unquoted `Precedence:` text was interpreted as a YAML mapping delimiter; the hint is now quoted so project scaffolding can load the profile template. ([#266](https://github.com/microsoft/dbt-fabricspark/issues/266)) + ## v1.13.0 ### Features diff --git a/src/dbt/include/fabricspark/profile_template.yml b/src/dbt/include/fabricspark/profile_template.yml index 8cbea3e..80b6600 100644 --- a/src/dbt/include/fabricspark/profile_template.yml +++ b/src/dbt/include/fabricspark/profile_template.yml @@ -38,7 +38,7 @@ prompts: type: 'bool' default: true workspace_name: - hint: Optional. Default workspace name for cross-workspace 4-part naming. When set and the target lakehouse has schemas enabled, all relations without an explicit model-level workspace_name will be prefixed with this workspace. Ignored for non-schema lakehouses. Precedence: model config(workspace_name=...) > this value. + hint: 'Optional. Default workspace name for cross-workspace 4-part naming. When set and the target lakehouse has schemas enabled, all relations without an explicit model-level workspace_name will be prefixed with this workspace. Ignored for non-schema lakehouses. Precedence: model config(workspace_name=...) > this value.' quote_identifiers: hint: When true, backtick-quotes table identifiers so Fabric Spark preserves their casing instead of folding to lowercase. Requires spark.sql.caseSensitive=true under spark_config.conf to take effect. Session-wide (also affects column resolution). Defaults to false. type: 'bool' diff --git a/tests/unit/test_profile_template.py b/tests/unit/test_profile_template.py new file mode 100644 index 0000000..305f16f --- /dev/null +++ b/tests/unit/test_profile_template.py @@ -0,0 +1,17 @@ +from pathlib import Path + +import yaml + +REPO_ROOT = Path(__file__).resolve().parents[2] +PROFILE_TEMPLATE = REPO_ROOT / "src" / "dbt" / "include" / "fabricspark" / "profile_template.yml" + + +def test_profile_template_is_valid_yaml() -> None: + template = yaml.safe_load(PROFILE_TEMPLATE.read_text(encoding="utf-8")) + + workspace_prompt = template["prompts"]["_choose_authentication_method"]["livy"][ + "workspace_name" + ] + assert workspace_prompt["hint"].endswith( + "Precedence: model config(workspace_name=...) > this value." + )