-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support project definition V2 in streamlit deploy command #1369
Support project definition V2 in streamlit deploy command #1369
Conversation
@@ -189,6 +189,9 @@ def _convert_env( | |||
return env | |||
return ProjectEnvironment(default_env=(env or {}), override_env={}) | |||
|
|||
def get_entities_by_type(self, entity_type: str): | |||
return {i: e for i, e in self.entities.items() if e.get_type() == entity_type} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfc-gh-jsikorski you may be interested in this helper.
src/snowflake/cli/api/project/schemas/entities/streamlit_entity.py
Outdated
Show resolved
Hide resolved
src/snowflake/cli/api/project/schemas/entities/streamlit_entity.py
Outdated
Show resolved
Hide resolved
8f9b89a
into
project-definition-v2-support
title="Stage in which the app’s artifacts will be stored", default="streamlit" | ||
) | ||
# Possibly can be PathMapping | ||
artifacts: Optional[List[Path]] = Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to pull up the definition of stage
and artifact
so the fields can be shared between Streamlit and Application Package (and likely function / spro).
if not self.artifacts: | ||
return self | ||
|
||
for artefact in self.artifacts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
artifact
for artefact in self.artifacts: | ||
if not artefact.exists(): | ||
raise ValueError( | ||
f"Specified artefact {artefact} does not exist locally." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
artifact
* Support project definition V2 in streamlit deploy command (#1369) * Init * Solution outline * Fixing paths * build fix * build fix * Update src/snowflake/cli/api/project/schemas/entities/snowpark_entity.py Co-authored-by: Tomasz Urbaszek <tomasz.urbaszek@snowflake.com> * Update src/snowflake/cli/api/project/schemas/entities/snowpark_entity.py Co-authored-by: Tomasz Urbaszek <tomasz.urbaszek@snowflake.com> * query problem * Fix for zipper * Test fix * Test fix * Update src/snowflake/cli/plugins/snowpark/commands.py Co-authored-by: Tomasz Urbaszek <tomasz.urbaszek@snowflake.com> * Update src/snowflake/cli/plugins/snowpark/commands.py Co-authored-by: Patryk Czajka <patryk.czajka@snowflake.com> * Fixes * Test fix * Merge fixes * Test fix * Reformat * Merge cleanup * Fixup * Changed to artifacts * Fixup --------- Co-authored-by: Tomasz Urbaszek <tomasz.urbaszek@snowflake.com> Co-authored-by: Patryk Czajka <patryk.czajka@snowflake.com>
Pre-review checklist
Changes description
Added support for project definition schema version 2 in
snow streamlit deploy
. This change requires V2 flag to be enabled.