Skip to content

Fetching historical feature values by passing sql as entity_df #3234

Open

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

Activity

  1. Nevermind-s commented on Dec 8, 2022

    @Nevermind-s

    Any news on this one?

  2. amommendes commented on Jan 6, 2023

    @amommendes
    Contributor

    Seems to me this is an implementation decision and not a bug (whether introduced or not), then this could be a feature request... The old version ran a SELECT INTO from sql string in the entity table

  3. tsenhungwu commented on Feb 8, 2023

    @tsenhungwu

    I encountered a similar issue where the insertion operation defaults the string column in an entity table with varchar(1) which violates the length check.

  4. adchia commented on Feb 8, 2023

    @adchia
    Collaborator

    I believe this might have been just an incorrect gate. The other offline stores allow for this and it seemed to work in the old version. We should be able to re-enable this and fix any tests that are failing as a result

  5. stale commented on Jun 10, 2023

    @stale

    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.

  6. added
    wontfix
    on Jun 10, 2023
  7. added and removed
    wontfix
    on Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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