justcode
justcode

Reputation: 128

GCP VertexAI Feature Store error in ingest_from_df() on feature_time column

I am trying to ingest a sample data into a feature store in GCP VertexAI but I am encountering an error in populating the feature_time parameter.

I am quite confused on what data type should I use in the timestamp column (loaded in feature_time parameter) in order to ingest the data to the Feature Store. I am doing the exact thing stated in the documentation as seen here

This is the error: InvalidArgument: 400 Source schema does not match the expected schema for this import. Type mismatches in source: Expected type and mode [TIMESTAMP, NULLABLE] for ts2, but got [DATETIME, NULLABLE].

I am using google-cloud-aiplatform==1.34.0

import pandas as pd
import numpy as np
import datetime

# Data with 2 columns: entity_id, flight_duration
df = pd.read_csv('sample_data.csv')

feature_time_str = datetime.datetime.now().isoformat(sep=" ", timespec="milliseconds")
df['ts_column'] = datetime.datetime.strptime(feature_time_str, "%Y-%m-%d %H:%M:%S.%f")

flights_entity_type.ingest_from_df(
    feature_ids=["flight_duration"],
    feature_time="ts_column",
    df_source=df,
    entity_id_field="entity_id",
)

Here are the dtypes of my dataframe

ts1                   datetime64[ns]
flight_duration       float64
entity_id             object

Any leads will be appreciated. Thank you!

Upvotes: 1

Views: 56

Answers (0)

Related Questions