Skip to content

Commit

Permalink
Fix app role None with ws commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-melnacouzi committed Sep 19, 2024
1 parent db961f9 commit e6ec96a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/snowflake/cli/_plugins/nativeapp/application_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ def action_deploy(
app_name = model.fqn.identifier
debug_mode = model.debug
if model.meta:
app_role = getattr(model.meta, "role", ctx.default_role)
app_warehouse = getattr(model.meta, "warehouse", ctx.default_warehouse)
post_deploy_hooks = getattr(model.meta, "post_deploy", None)
app_role = model.meta.role or ctx.default_role
app_warehouse = model.meta.warehouse or ctx.default_warehouse
post_deploy_hooks = model.meta.post_deploy
else:
app_role = ctx.default_role
app_warehouse = ctx.default_warehouse
Expand Down
9 changes: 7 additions & 2 deletions tests_integration/nativeapp/test_post_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@


def run(runner, base_command, args):
# TODO Run "ws deploy --entity-id=app" once ApplicationEntity deploy is implemented
result = runner.invoke_with_connection_json(["app", "run"] + args)
if base_command == "ws":
result = runner.invoke_with_connection_json(
["ws", "deploy", "--entity-id", "app"] + args
)
else:
result = runner.invoke_with_connection_json(["app", "run"] + args)

assert result.exit_code == 0


Expand Down

0 comments on commit e6ec96a

Please sign in to comment.