From 816cfc43ee7111989a2d2db943a310bb17b79e44 Mon Sep 17 00:00:00 2001 From: Vitaly Markov Date: Mon, 5 Aug 2024 09:30:50 +0100 Subject: [PATCH] Remove blueprints on remove_blueprint() call --- CHANGELOG.md | 4 ++++ snowddl/config.py | 2 ++ snowddl/version.py | 2 +- .../db1/sc1/table/{cu002_tb3.yaml => cu002_tb2.yaml} | 0 test/custom/cu002.py | 8 +------- 5 files changed, 8 insertions(+), 8 deletions(-) rename test/_config/step2/db1/sc1/table/{cu002_tb3.yaml => cu002_tb2.yaml} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f421c1..c1a3ee8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [0.30.4] - 2024-08-05 + +- Added logic to actually remove blueprints from config on `remove_blueprint()` call. + ## [0.30.3] - 2024-07-17 - Added `NOTEBOOK` object type, so now it can be used for grants. diff --git a/snowddl/config.py b/snowddl/config.py index 2ce2a97..5e736e3 100644 --- a/snowddl/config.py +++ b/snowddl/config.py @@ -106,6 +106,8 @@ def remove_blueprint(self, bp: AbstractBlueprint): if str(bp.full_name) not in self.blueprints.get(bp.__class__, {}): raise ValueError(f"Blueprint with type [{bp.__class__.__name__}] and name [{bp.full_name}] does not exist in config") + del self.blueprints[bp.__class__][str(bp.full_name)] + def add_error(self, path: Path, e: Exception): self.errors.append( { diff --git a/snowddl/version.py b/snowddl/version.py index 7bb9c09..2cfd9a9 100644 --- a/snowddl/version.py +++ b/snowddl/version.py @@ -1 +1 @@ -__version__ = "0.30.3" +__version__ = "0.30.4" diff --git a/test/_config/step2/db1/sc1/table/cu002_tb3.yaml b/test/_config/step2/db1/sc1/table/cu002_tb2.yaml similarity index 100% rename from test/_config/step2/db1/sc1/table/cu002_tb3.yaml rename to test/_config/step2/db1/sc1/table/cu002_tb2.yaml diff --git a/test/custom/cu002.py b/test/custom/cu002.py index 27b0045..4c17546 100644 --- a/test/custom/cu002.py +++ b/test/custom/cu002.py @@ -1,28 +1,22 @@ def test_step1(helper): table1 = helper.show_table("db1", "sc1", f"cu002_tb1") table2 = helper.show_table("db1", "sc1", f"cu002_tb2") - table3 = helper.show_table("db1", "sc1", f"cu002_tb3") assert table1 is not None assert table2 is not None - assert table3 is None def test_step2(helper): table1 = helper.show_table("db1", "sc1", f"cu002_tb1") table2 = helper.show_table("db1", "sc1", f"cu002_tb2") - table3 = helper.show_table("db1", "sc1", f"cu002_tb3") - assert table1 is not None + assert table1 is None assert table2 is None - assert table3 is not None def test_step3(helper): table1 = helper.show_table("db1", "sc1", f"cu002_tb1") table2 = helper.show_table("db1", "sc1", f"cu002_tb2") - table3 = helper.show_table("db1", "sc1", f"cu002_tb3") assert table1 is None assert table2 is None - assert table3 is None