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