Skip to content

Commit

Permalink
Remove blueprints on remove_blueprint() call
Browse files Browse the repository at this point in the history
  • Loading branch information
littleK0i committed Aug 5, 2024
1 parent 76513ca commit 816cfc4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 2 additions & 0 deletions snowddl/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down
2 changes: 1 addition & 1 deletion snowddl/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.30.3"
__version__ = "0.30.4"
8 changes: 1 addition & 7 deletions test/custom/cu002.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 816cfc4

Please sign in to comment.