Skip to content

Commit

Permalink
Fix deploy experimental (#502)
Browse files Browse the repository at this point in the history
* Add --experimental flag for deploying to embedded stage

* Cleanup

* Delete file

* Update src/snowcli/cli/streamlit/manager.py

Co-authored-by: Tomasz Urbaszek <tomasz.urbaszek@snowflake.com>

* Use experimental flag, refactor deploy to highlight shared functionality

* Use proper way to tell if experimental flag is used

* Add back in missing project file

* Use stagemanager for standardized handling of missing db/schema

* Update to new test behavior

* Add required step to create checkout

---------

Co-authored-by: Tomasz Urbaszek <tomasz.urbaszek@snowflake.com>
  • Loading branch information
sfc-gh-zblackwood and sfc-gh-turbaszek committed Oct 26, 2023
1 parent efbf08c commit 6178d97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/snowcli/cli/streamlit/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def deploy(
# TODO: Support from_stage
# from_stage_stmt = f"FROM_STAGE = '{stage_name}'" if stage_name else ""
self._create_streamlit(streamlit_name, main_file, replace, query_warehouse)
self._execute_query(f"ALTER streamlit {streamlit_name} CHECKOUT")
stage_path = stage_manager.to_fully_qualified_name(streamlit_name)
embedded_stage_name = f"snow://streamlit/{stage_path}"
root_location = f"{embedded_stage_name}/default_checkout"
Expand Down
1 change: 1 addition & 0 deletions tests/streamlit/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ def test_deploy_streamlit_main_and_pages_files_experimental(
QUERY_WAREHOUSE = test_warehouse
"""
),
"ALTER streamlit test_streamlit CHECKOUT",
_put_query("app.py", root_path),
_put_query("environment.yml", f"{root_path}"),
_put_query("pages/*.py", f"{root_path}/pages"),
Expand Down

0 comments on commit 6178d97

Please sign in to comment.