When importing the libraries for doing the transformations running the first cell gives the following error:
ImportError Traceback (most recent call last)
Cell In[8], line 14
11 from snowflake.snowpark.types import DecimalType
13 # Snowpark ML
---> 14 import snowflake.ml.modeling.preprocessing as snowml
15 from snowflake.ml.modeling.pipeline import Pipeline
16 from snowflake.ml.modeling.metrics.correlation import correlation
File ~/anaconda3/envs/snowpark/lib/python3.10/site-packages/snowflake/ml/modeling/preprocessing/init.py:7
5 pkg_dir = os.path.dirname(os.path.abspath(file))
6 pkg_name = name
----> 7 exportable_classes = init_utils.fetch_classes_from_modules_in_pkg_dir(pkg_dir=pkg_dir, pkg_name=pkg_name)
8 for k, v in exportable_classes.items():
9 globals()[k] = v
File ~/anaconda3/envs/snowpark/lib/python3.10/site-packages/snowflake/ml/_internal/init_utils.py:26, in fetch_classes_from_modules_in_pkg_dir(pkg_dir, pkg_name)
24 # import the module and iterate through its attributes
25 try:
---> 26 module = importlib.import_module(f"{pkg_name}.{module_info.name}")
27 for attribute_name in dir(module):
28 attribute = getattr(module, attribute_name)
When importing the libraries for doing the transformations running the first cell gives the following error:
ImportError Traceback (most recent call last) Cell In[8], line 14 11 from snowflake.snowpark.types import DecimalType 13 # Snowpark ML ---> 14 import snowflake.ml.modeling.preprocessing as snowml 15 from snowflake.ml.modeling.pipeline import Pipeline 16 from snowflake.ml.modeling.metrics.correlation import correlation
File ~/anaconda3/envs/snowpark/lib/python3.10/site-packages/snowflake/ml/modeling/preprocessing/init.py:7 5 pkg_dir = os.path.dirname(os.path.abspath(file)) 6 pkg_name = name ----> 7 exportable_classes = init_utils.fetch_classes_from_modules_in_pkg_dir(pkg_dir=pkg_dir, pkg_name=pkg_name) 8 for k, v in exportable_classes.items(): 9 globals()[k] = v
File ~/anaconda3/envs/snowpark/lib/python3.10/site-packages/snowflake/ml/_internal/init_utils.py:26, in fetch_classes_from_modules_in_pkg_dir(pkg_dir, pkg_name) 24 # import the module and iterate through its attributes 25 try: ---> 26 module = importlib.import_module(f"{pkg_name}.{module_info.name}") 27 for attribute_name in dir(module): 28 attribute = getattr(module, attribute_name)
File ~/anaconda3/envs/snowpark/lib/python3.10/importlib/init.py:126, in import_module(name, package) 124 break 125 level += 1 --> 126 return _bootstrap._gcd_import(name[level:], package, level)
File ~/anaconda3/envs/snowpark/lib/python3.10/site-packages/snowflake/ml/modeling/preprocessing/polynomial_features.py:32 30 from snowflake.snowpark import DataFrame, Session 31 from snowflake.snowpark.functions import pandas_udf, sproc ---> 32 from snowflake.snowpark.types import PandasSeries 33 from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type 34 from snowflake.snowpark._internal.utils import ( 35 TempObjectType, 36 random_name_for_temp_object, 37 )
ImportError: cannot import name 'PandasSeries' from 'snowflake.snowpark.types'