-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fix for glob patterns in artifacts #1567
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cd6bb56
Initial
sfc-gh-jsikorski b10a594
Added streamlit
sfc-gh-jsikorski 988760d
Test fix
sfc-gh-jsikorski 17526c7
Update RELEASE-NOTES.md
sfc-gh-jsikorski e99ad64
Test fix
sfc-gh-jsikorski e6504d2
Fix
sfc-gh-jsikorski 5f5aef2
Added test
sfc-gh-jsikorski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: sf_env | ||
channels: | ||
- snowflake | ||
dependencies: | ||
- pandas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import streamlit as st | ||
|
||
st.title("Example page") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import streamlit as st | ||
|
||
st.title("Another page") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
definition_version: 2 | ||
entities: | ||
hello_procedure: | ||
artifacts: | ||
- src/*.* | ||
handler: hello | ||
identifier: | ||
name: hello_function | ||
returns: string | ||
signature: | ||
- name: "name" | ||
type: "string" | ||
stage: dev_deployment | ||
type: procedure | ||
my_streamlit: | ||
type: "streamlit" | ||
identifier: test_streamlit_deploy_snowcli | ||
title: "My Fancy Streamlit" | ||
stage: streamlit | ||
query_warehouse: xsmall | ||
main_file: streamlit_app.py | ||
artifacts: | ||
- streamlit_app.py | ||
- pages/*.* | ||
- environment.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
|
||
from procedures import hello_procedure | ||
from snowflake.snowpark import Session | ||
|
||
# For local debugging. Be aware you may need to type-convert arguments if | ||
# you add input parameters | ||
if __name__ == "__main__": | ||
from snowflake.cli.api.config import cli_config | ||
|
||
session = Session.builder.configs(cli_config.get_connection_dict("dev")).create() | ||
if len(sys.argv) > 1: | ||
print(hello_procedure(session, *sys.argv[1:])) # type: ignore | ||
else: | ||
print(hello_procedure(session)) # type: ignore | ||
session.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from snowflake.snowpark import Session | ||
|
||
|
||
def hello_procedure(session: Session, name: str) -> str: | ||
return f"Hello {name}" | ||
|
||
|
||
def test_procedure(session: Session) -> str: | ||
return "Test procedure" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import streamlit as st | ||
|
||
st.title("Example streamlit app") |
12 changes: 12 additions & 0 deletions
12
tests_integration/test_data/projects/snowpark_glob_patterns/app_1/a.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from __future__ import annotations | ||
from snowflake.snowpark import Session | ||
from b import test_procedure | ||
|
||
|
||
# test import | ||
import syrupy | ||
|
||
|
||
def hello_procedure(session: Session, name: str) -> str: | ||
|
||
return f"Hello {name}" + test_procedure(session) |
10 changes: 10 additions & 0 deletions
10
tests_integration/test_data/projects/snowpark_glob_patterns/app_1/b.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from __future__ import annotations | ||
from snowflake.snowpark import Session | ||
|
||
|
||
# test import | ||
import syrupy | ||
|
||
|
||
def test_procedure(session: Session) -> str: | ||
return "Test procedure" |
1 change: 1 addition & 0 deletions
1
tests_integration/test_data/projects/snowpark_glob_patterns/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
snowflake-snowpark-pythonsyrupy | ||
|
43 changes: 43 additions & 0 deletions
43
tests_integration/test_data/projects/snowpark_glob_patterns/snowflake.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
definition_version: 2 | ||
|
||
mixins: | ||
snowpark_shared: | ||
stage: "dev_deployment" | ||
|
||
entities: | ||
hello_procedure: | ||
type: "procedure" | ||
stage: "stage_a" | ||
identifier: | ||
name: "hello_procedure" | ||
handler: "a.hello_procedure" | ||
signature: | ||
- name: "name" | ||
type: "string" | ||
returns: string | ||
artifacts: | ||
- "app_1/" | ||
|
||
test: | ||
type: "procedure" | ||
handler: "b.test_procedure" | ||
signature: "" | ||
returns: string | ||
artifacts: | ||
- "app_2/" | ||
meta: | ||
use_mixins: | ||
- "snowpark_shared" | ||
|
||
hello_function: | ||
type: "function" | ||
handler: "c.hello_function" | ||
signature: | ||
- name: "name" | ||
type: "string" | ||
returns: string | ||
artifacts: | ||
- "c.py" | ||
meta: | ||
use_mixins: | ||
- "snowpark_shared" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Out of curiosity, and particular reason to use
*.*
, instead of just*
? I've never seen that pattern used before.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.
No particular reason. In this context they should have the same result.