Skip to content
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

Merged
merged 7 commits into from
Jul 26, 2024

Conversation

sfc-gh-turbaszek
Copy link
Collaborator

@sfc-gh-turbaszek sfc-gh-turbaszek commented Jul 25, 2024

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.

Changes description

Added support for project definition schema version 2 in snow streamlit deploy. This change requires V2 flag to be enabled.

@sfc-gh-turbaszek sfc-gh-turbaszek requested review from a team as code owners July 25, 2024 14:57
@sfc-gh-turbaszek sfc-gh-turbaszek changed the base branch from main to project-definition-v2-support July 25, 2024 16:15
@@ -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}

Copy link
Collaborator Author

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.

@sfc-gh-turbaszek sfc-gh-turbaszek merged commit 8f9b89a into project-definition-v2-support Jul 26, 2024
16 checks passed
@sfc-gh-turbaszek sfc-gh-turbaszek deleted the streamlit-pdf-v2 branch July 26, 2024 12:07
title="Stage in which the app’s artifacts will be stored", default="streamlit"
)
# Possibly can be PathMapping
artifacts: Optional[List[Path]] = Field(
Copy link
Contributor

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:
Copy link
Contributor

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."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

artifact

sfc-gh-jsikorski added a commit that referenced this pull request Aug 10, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants