Skip to content

Unable to query created or event_timestamp fields from feature views #3412

@franciscojavierarceo

Description

@franciscojavierarceo

Expected Behavior

get_historical_features should be able to return the created date or event_timestamp if explicitly requested, currently this just breaks.

features = store.get_historical_features(
        entity_df=entity_df,
        features=[
            "driver_hourly_stats:acc_rate",
            "driver_hourly_stats:conv_rate",
            "driver_hourly_stats:avg_daily_trips",
            "driver_hourly_stats:created",
            "driver_hourly_stats:event_timestamp",
        ]
    )

Current Behavior

get_historical_features should be able to return the created date if explicitly requested, currently this just breaks.

Steps to reproduce

import pandas as pd
from datetime import datetime, timedelta
from feast import FeatureStore

store = FeatureStore(".")


def main():
    entity_df = pd.DataFrame.from_dict({
        "driver_id": [1001, 1002],
        "event_timestamp": [datetime.utcnow() - timedelta(days=2), datetime.utcnow() - timedelta(days=2)],
        "input_value": [100, 200],
    })

    features = store.get_historical_features(
        entity_df=entity_df,
        features=[
            "driver_hourly_stats:acc_rate",
            "driver_hourly_stats:conv_rate",
            "driver_hourly_stats:avg_daily_trips",
            "driver_hourly_stats:created",
            "driver_hourly_stats:event_timestamp",
        ]
    )
    print('here are the features!\n', features.to_df())

if __name__ == '__main__':
    main()

Specifications

  • Version:
  • Platform:
  • Subsystem:

Possible Solution

#3411

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