-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update environment.yml to create the editable install Sproc now returns a table
- Loading branch information
1 parent
8639aa6
commit ae690f7
Showing
10 changed files
with
56 additions
and
55 deletions.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
snowflake-snowpark-python | ||
tomli | ||
toml | ||
pytest | ||
snowflake-vcrpy @ git+https://github.com/Snowflake-Labs/[email protected] |
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,12 @@ | ||
""" | ||
Run `conda env create --file environment.yaml` to create an editable | ||
install of this project | ||
""" | ||
|
||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name="Example Snowpark Python project", | ||
version="0.1.0", | ||
packages=find_packages() | ||
) |
Empty file.
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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import os | ||
|
||
import pytest | ||
from snowflake.snowpark.session import Session | ||
from snowflake.snowpark.types import StringType | ||
from src.util.local import get_env_var_config | ||
from src.procs.app import run | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def set_working_directory(): | ||
# Sets the working directory to sources root so relative imports resolve properly | ||
os.chdir("src") | ||
|
||
|
||
@pytest.fixture | ||
def local_session(): | ||
def session(): | ||
return Session.builder.configs(get_env_var_config()).create() | ||
|
||
|
||
@pytest.mark.snowflake_vcr | ||
def test_app_dim(local_session): | ||
expected_n_rows = 2 | ||
actual_n_rows = run(local_session) | ||
assert expected_n_rows == actual_n_rows | ||
|
||
def test_app_dim(session: Session): | ||
expected = session.create_dataframe( | ||
[["Welcome to Snowflake!"], ["Learn more: https://www.snowflake.com/snowpark/"]], | ||
["hello_world"]) | ||
actual = run(session) | ||
assert expected.collect() == actual.collect() | ||
|
||
# Alertnate impl: | ||
# expected = [Row("Welcome to Snowflake!"), Row("Learn more: https://www.snowflake.com/snowpark/")] | ||
# actual = run(session) | ||
# assert expected.select("hello_world").collect() == actual |