1. SnowPark –PoV
• Use Case
• Implementing the Module
• Python Libraries used
• Fuzzywuzzy -> Module fuzz
• Fuzzyset
• Similarity -> Module Cosine
• Check if all libraries present in Snowflake
• Query - select * from information_schema.packages where language = 'python’
and (UPPER(package_name) like '%FUZZ%’
OR UPPER(package_name) like '%SIMILARITY%’);
• Output:
• Conclusion: Not all libraries used in the Use Case are present.
2. Procedure using Python Language
Code:
CREATE OR REPLACE PROCEDURE Data_Fuzzy()
RETURNS STRING
LANGUAGE PYTHON
RUNTIME_VERSION = '3.8'
PACKAGES = ('snowflake-snowpark-python')
HANDLER = 'run'
AS
$$
def run(session):
#session.add_packages("fuzzywuzzy")
from fuzzywuzzy import fuzz
score2 = fuzzywuzzy.fuzz.token_set_ratio('s1',
's2')/100
return session.sql('select current_warehouse(),
current_database(), current_schema()').collect()
$$;
Output:
Python Interpreter Error:
Traceback (most recent call
last): File "_udf_code.py", line 4,
in run ModuleNotFoundError:
No module named 'fuzzywuzzy'
in function DATA_FUZZY with
handler run
Even if we replace “from
fuzzywuzzy import fuzz” with
“session.add_packages("fuzzywuz
zy")”, We get the same error.
Conclusion: Even if Packages are
available in the list, not able to
import or use them.