Skip to content

Fetching historical feature values by passing sql as entity_df #3234

Open
@TaherehFarrokhi

Description

@TaherehFarrokhi

Expected Behavior

In Feast version 0.18.1, it was poosible to get historical features by passing a sql query as entity_df and it returns the values

Current Behavior

When I updated or .24+ it returns error : string entities are currently not supported in the MsSQL offline store.

https://github.com/feast-dev/feast/blob/master/sdk/python/feast/infra/offline_stores/contrib/mssql_offline_store/mssql.py#L189

Steps to reproduce

this is my feast_store.yaml

registry:
  registry_store_type: AzureRegistryStore
  path: ${REGISTRY_PATH}
project: FinalUniverseY1
provider: azure
online_store:
    type: redis
    connection_string: ${REDIS_CONN}
offline_store:
    type: mssql
    connection_string: ${SQL_CONN}
  1. Defined entity
  2. define feature view
  3. Write this code:
 feature_view = self.feature_store.get_feature_view(fq.feature_view_name)
  entity = self.feature_store.get_entity(feature_view.entities[0])
  features = [f"{feature_view.name}:{f.name}" for f in feature_view.features]
      batch_source: MsSqlServerSource = feature_view.batch_source
 entity_df = f"select {entity.join_key}, {feature_view.batch_source.timestamp_field} as event_timestamp from [dbo].{batch_source.table_ref} where {batch_source.timestamp_field} between '{fq.from_date}' and '{fq.to_date}'"
      feature_service = self.feature_store.get_feature_service("test_service_1")
  job = self.feature_store.get_historical_features(
          entity_df=entity_df, features=feature_service
      )
 df = job.to_df()

Specifications

  • Version:0.24.1
  • Platform :Azure
  • Subsystem:

Possible Solution

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions