feast icon indicating copy to clipboard operation
feast copied to clipboard

Materialize call with Snowflake as batch engine fails with Invalid config type specified for batch_engine: <class 'feast.infra.materialization.snowflake_engine.SnowflakeMaterializationEngineConfig'>

Open seekerofsai opened this issue 2 years ago • 7 comments

Expected Behavior

Materialization succeeds

Current Behavior


RuntimeError Traceback (most recent call last) Cell In[28], line 6 3 startdate = datetime.strptime('2021-09-10', '%Y-%m-%d') 4 enddate = datetime.strptime('2021-09-11', '%Y-%m-%d') ----> 6 fs1.materialize(start_date= startdate, end_date=enddate) 7 #UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb4 in position 1: invalid start byte

File /usr/local/lib/python3.8/site-packages/feast/usage.py:299, in log_exceptions_and_usage..decorator..wrapper(*args, **kwargs) 296 ctx.traceback = _trace_to_log(traceback) 298 if traceback: --> 299 raise exc.with_traceback(traceback) 301 raise exc 302 finally:

File /usr/local/lib/python3.8/site-packages/feast/usage.py:288, in log_exceptions_and_usage..decorator..wrapper(*args, **kwargs) 285 ctx.attributes.update(attrs) 287 try: --> 288 return func(*args, **kwargs) 289 except Exception: 290 if ctx.exception: 291 # exception was already recorded

File /usr/local/lib/python3.8/site-packages/feast/feature_store.py:1395, in FeatureStore.materialize(self, start_date, end_date, feature_views) 1392 start_date = utils.make_tzaware(start_date) 1393 end_date = utils.make_tzaware(end_date) -> 1395 provider.materialize_single_feature_view( 1396 config=self.config, 1397 feature_view=feature_view, 1398 start_date=start_date, 1399 end_date=end_date, 1400 registry=self._registry, 1401 project=self.project, 1402 tqdm_builder=tqdm_builder, 1403 ) 1405 self._registry.apply_materialization( 1406 feature_view, 1407 self.project, 1408 start_date, 1409 end_date, 1410 )

File /usr/local/lib/python3.8/site-packages/feast/infra/passthrough_provider.py:249, in PassthroughProvider.materialize_single_feature_view(self, config, feature_view, start_date, end_date, registry, project, tqdm_builder) 237 assert ( 238 isinstance(feature_view, BatchFeatureView) 239 or isinstance(feature_view, StreamFeatureView) 240 or isinstance(feature_view, FeatureView) 241 ), f"Unexpected type for {feature_view.name}: {type(feature_view)}" 242 task = MaterializationTask( 243 project=project, 244 feature_view=feature_view, (...) 247 tqdm_builder=tqdm_builder, 248 ) --> 249 jobs = self.batch_engine.materialize(registry, [task]) 250 assert len(jobs) == 1 251 if jobs[0].status() == MaterializationJobStatus.ERROR and jobs[0].error():

File /usr/local/lib/python3.8/site-packages/feast/infra/passthrough_provider.py:83, in PassthroughProvider.batch_engine(self) 81 config_is_dict = True 82 else: ---> 83 raise RuntimeError( 84 f"Invalid config type specified for batch_engine: {type(engine_config)}" 85 ) 87 if engine_config_type in BATCH_ENGINE_CLASS_FOR_TYPE: 88 engine_config_type = BATCH_ENGINE_CLASS_FOR_TYPE[engine_config_type]

RuntimeError: Invalid config type specified for batch_engine: <class 'feast.infra.materialization.snowflake_engine.SnowflakeMaterializationEngineConfig'>

Steps to reproduce

from feast import FeatureStore, RepoConfig from feast.repo_config import RegistryConfig

from feast.infra.online_stores.redis import RedisOnlineStoreConfig from feast.infra.offline_stores.snowflake import SnowflakeOfflineStoreConfig from feast.infra.materialization.snowflake_engine import SnowflakeMaterializationEngineConfig

repo_config = RepoConfig( registry= RegistryConfig( registry_type = 'sql', path = <> ), project="demo", provider="aws", offline_store=SnowflakeOfflineStoreConfig( account = snowflakeaccount, .. ), online_store=RedisOnlineStoreConfig( redis_type="redis_cluster", connection_string = redisconn ), batch_engine= SnowflakeMaterializationEngineConfig( account = snowflakeaccount, .. ), entity_key_serialization_version=2 )

fs1 = FeatureStore(config=repo_config)

Specifications

  • Version: Feast 0.30.2
  • Platform: Python 3.9
  • Subsystem:

Possible Solution

seekerofsai avatar Apr 10 '23 18:04 seekerofsai

@seekerofsai does this work if you put the inputs in a .yaml file?

sfc-gh-madkins avatar Apr 13 '23 19:04 sfc-gh-madkins

yes it works reading from .yaml file

seekerofsai avatar Apr 13 '23 21:04 seekerofsai

@seekerofsai thanks ... I will take a look on this

sfc-gh-madkins avatar Apr 22 '23 18:04 sfc-gh-madkins

Having same error while doing feast init -t snowflake

wjhhuizi avatar Apr 27 '23 00:04 wjhhuizi

@wjhhuizi when you try to put the credentials in through python?

sfc-gh-madkins avatar Apr 27 '23 00:04 sfc-gh-madkins

This should work for now:

batch_engine= { "type": "snowflake.engine", "account": "snowflakeaccount", .. )

sfc-gh-madkins avatar Apr 27 '23 00:04 sfc-gh-madkins

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 17 '23 14:09 stale[bot]