littleK0i / SnowDDL

Declarative database change management tool for Snowflake
Apache License 2.0
104 stars 27 forks source link

UserBlueprint error regarding session_params #151

Open marksabincarnivaluk opened 3 days ago

marksabincarnivaluk commented 3 days ago

Hi, UserBlueprint session_params is optional but if I don't pass it I get the error below. To workaround it I have to pass: session_params = {}.

from snowddl import SnowDDLConfig, UserBlueprint, AccountObjectIdent

def handler(config: SnowDDLConfig):

bp = UserBlueprint(
    login_name = "TEST_SNOWDDL_USER_1",
    full_name = AccountObjectIdent(env_prefix = "", name = "TEST_SNOWDDL_USER_1"),
    display_name = "TEST_SNOWDDL_USER_1",
    disabled = True,
)

config.add_blueprint(bp)

Error: 2024-11-22 17:01:54.141 - WARNING - Resolved USER [TEST_SNOWDDL_USER_1]: ERROR Traceback (most recent call last): File "...(redacted)...\lib\site-packages\snowddl\resolver\abc_resolver.py", line 129, in _process_tasks result = f.result() ...(redacted)... \lib\site-packages\snowddl\resolver\user.py", line 147, in _build_common_parameters for param_name, param_value in bp.session_params.items(): AttributeError: 'NoneType' object has no attribute 'items'

littleK0i commented 2 days ago

@marksabincarnivaluk Thank you for pointing this out. Should be fixed in 0.36.0.