From 6e169573790cefef35bd7e0f8ded7f92ee85b8ab Mon Sep 17 00:00:00 2001 From: Jeremiah Hansen Date: Mon, 1 May 2023 17:09:47 -0600 Subject: [PATCH] vhol udf change --- steps/05_fahrenheit_to_celsius_udf/app.py | 3 ++- steps/05_fahrenheit_to_celsius_udf/requirements.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/steps/05_fahrenheit_to_celsius_udf/app.py b/steps/05_fahrenheit_to_celsius_udf/app.py index e52520c..a42cf9a 100644 --- a/steps/05_fahrenheit_to_celsius_udf/app.py +++ b/steps/05_fahrenheit_to_celsius_udf/app.py @@ -10,9 +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 diff --git a/steps/05_fahrenheit_to_celsius_udf/requirements.txt b/steps/05_fahrenheit_to_celsius_udf/requirements.txt index e69de29..9a635b9 100644 --- a/steps/05_fahrenheit_to_celsius_udf/requirements.txt +++ b/steps/05_fahrenheit_to_celsius_udf/requirements.txt @@ -0,0 +1 @@ +scipy