From 2c77360539a446ff82978fbccfba24d614f561f9 Mon Sep 17 00:00:00 2001 From: z3z1ma Date: Fri, 17 Jan 2025 00:09:35 -0700 Subject: [PATCH] fix: only inject node description if its empty in the yaml --- .changes/unreleased/Fixed-20250117-001238.yaml | 3 +++ src/dbt_osmosis/core/osmosis.py | 4 +--- uv.lock | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 .changes/unreleased/Fixed-20250117-001238.yaml diff --git a/.changes/unreleased/Fixed-20250117-001238.yaml b/.changes/unreleased/Fixed-20250117-001238.yaml new file mode 100644 index 0000000..103013f --- /dev/null +++ b/.changes/unreleased/Fixed-20250117-001238.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: Only inject node description if yaml description is empty +time: 2025-01-17T00:12:38.400622872-07:00 diff --git a/src/dbt_osmosis/core/osmosis.py b/src/dbt_osmosis/core/osmosis.py index b985bb6..c8ea32f 100644 --- a/src/dbt_osmosis/core/osmosis.py +++ b/src/dbt_osmosis/core/osmosis.py @@ -1387,10 +1387,8 @@ def _sync_doc_section( We assume node is the single source of truth, so doc_section is replaced. """ logger.debug(":arrows_counterclockwise: Syncing doc_section with node => %s", node.unique_id) - if node.description: + if node.description and not doc_section.get("description"): doc_section["description"] = node.description - else: - doc_section.pop("description", None) current_columns: list[dict[str, t.Any]] = doc_section.setdefault("columns", []) incoming_columns: list[dict[str, t.Any]] = [] diff --git a/uv.lock b/uv.lock index 59c25b6..834dddf 100644 --- a/uv.lock +++ b/uv.lock @@ -20,7 +20,7 @@ dependencies = [ { name = "parsedatetime" }, { name = "python-slugify" }, { name = "pytimeparse" }, - { name = "tzdata", marker = "platform_system == 'Windows'" }, + { name = "tzdata", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/29/77/6f5df1c68bf056f5fdefc60ccc616303c6211e71cd6033c830c12735f605/agate-1.9.1.tar.gz", hash = "sha256:bc60880c2ee59636a2a80cd8603d63f995be64526abf3cbba12f00767bcd5b3d", size = 202303 } wheels = [ @@ -187,7 +187,7 @@ name = "click" version = "8.1.8" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/b9/2e/0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b/click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a", size = 226593 } wheels = [ @@ -393,7 +393,7 @@ wheels = [ [[package]] name = "dbt-osmosis" -version = "1.1.7" +version = "1.1.8" source = { editable = "." } dependencies = [ { name = "click" }, @@ -2254,7 +2254,7 @@ dependencies = [ { name = "toml" }, { name = "tornado" }, { name = "typing-extensions" }, - { name = "watchdog", marker = "platform_system != 'Darwin'" }, + { name = "watchdog", marker = "sys_platform != 'darwin'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/31/5bdc188349af837272356c144719274002b081a4fbdb6c38a5dfacf02a2e/streamlit-1.33.0.tar.gz", hash = "sha256:a8da8ff46f5b948c56d2dc7aca7a61cf8d995f4f21744cf82258ae75e63004ba", size = 7785220 } wheels = [ @@ -2364,7 +2364,7 @@ name = "tqdm" version = "4.67.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/a8/4b/29b4ef32e036bb34e4ab51796dd745cdba7ed47ad142a9f4a1eb8e0c744d/tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2", size = 169737 } wheels = [