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

Main #43

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Main #43

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion steps/01_setup_snowflake.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CREATE OR REPLACE DATABASE HOL_DB;
GRANT OWNERSHIP ON DATABASE HOL_DB TO ROLE HOL_ROLE;

-- Warehouses
CREATE OR REPLACE WAREHOUSE HOL_WH WAREHOUSE_SIZE = XSMALL, AUTO_SUSPEND = 300, AUTO_RESUME= TRUE;
CREATE OR REPLACE WAREHOUSE HOL_WH WAREHOUSE_SIZE = XSMALL, AUTO_SUSPEND = 120, AUTO_RESUME= TRUE;
GRANT OWNERSHIP ON WAREHOUSE HOL_WH TO ROLE HOL_ROLE;


Expand Down
4 changes: 3 additions & 1 deletion steps/03_load_weather.sql
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ GRANT IMPORTED PRIVILEGES ON DATABASE FROSTBYTE_WEATHERSOURCE TO ROLE HOL_ROLE;


-- Let's look at the data - same 3-part naming convention as any other table
SELECT * FROM FROSTBYTE_WEATHERSOURCE.ONPOINT_ID.POSTAL_CODES LIMIT 100;
--SELECT * FROM FROSTBYTE_WEATHERSOURCE.ONPOINT_ID.POSTAL_CODES LIMIT 100;
SELECT COUNTRY, COUNT(1) FROM FROSTBYTE_WEATHERSOURCE.ONPOINT_ID.POSTAL_CODES
GROUP BY 1;
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
# SNOWFLAKE ADVANTAGE: SnowCLI (PuPr)

import sys
from scipy.constants import convert_temperature

def main(temp_f: float) -> float:
return (float(temp_f) - 32) * (5/9)

return convert_temperature(float(temp_f), 'F', 'C')

# For local debugging
# Be aware you may need to type-convert arguments if you add input parameters
Expand Down
1 change: 1 addition & 0 deletions steps/05_fahrenheit_to_celsius_udf/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
snowflake-snowpark-python
scipy