Skip to content

Commit dcae160

Browse files
Cleanup tests (#1901)
* Remove infer_event_timestamp_col Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Remove unnecessary historical retrieval test Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Remove more unnecessary tests Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Move test from integration to unit Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Rename test file to avoid pytest conflicts Signed-off-by: Felix Wang <wangfelix98@gmail.com>
1 parent 3078bfb commit dcae160

File tree

4 files changed

+68
-602
lines changed

4 files changed

+68
-602
lines changed

sdk/python/feast/driver_test_data.py

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ def _convert_event_timestamp(event_timestamp: pd.Timestamp, t: EventTimestampTyp
2929

3030

3131
def create_orders_df(
32-
customers,
33-
drivers,
34-
start_date,
35-
end_date,
36-
order_count,
37-
infer_event_timestamp_col=False,
32+
customers, drivers, start_date, end_date, order_count,
3833
) -> pd.DataFrame:
3934
"""
4035
Example df generated by this function:
@@ -51,39 +46,24 @@ def create_orders_df(
5146
df["driver_id"] = np.random.choice(drivers, order_count)
5247
df["customer_id"] = np.random.choice(customers, order_count)
5348
df["order_is_success"] = np.random.randint(0, 2, size=order_count).astype(np.int32)
54-
55-
if infer_event_timestamp_col:
56-
df["e_ts"] = [
57-
_convert_event_timestamp(
58-
pd.Timestamp(dt, unit="ms", tz="UTC").round("ms"),
59-
EventTimestampType(3),
60-
)
61-
for idx, dt in enumerate(
62-
pd.date_range(start=start_date, end=end_date, periods=order_count)
63-
)
64-
]
65-
df.sort_values(
66-
by=["e_ts", "order_id", "driver_id", "customer_id"], inplace=True,
49+
df[DEFAULT_ENTITY_DF_EVENT_TIMESTAMP_COL] = [
50+
_convert_event_timestamp(
51+
pd.Timestamp(dt, unit="ms", tz="UTC").round("ms"),
52+
EventTimestampType(idx % 4),
6753
)
68-
else:
69-
df[DEFAULT_ENTITY_DF_EVENT_TIMESTAMP_COL] = [
70-
_convert_event_timestamp(
71-
pd.Timestamp(dt, unit="ms", tz="UTC").round("ms"),
72-
EventTimestampType(idx % 4),
73-
)
74-
for idx, dt in enumerate(
75-
pd.date_range(start=start_date, end=end_date, periods=order_count)
76-
)
77-
]
78-
df.sort_values(
79-
by=[
80-
DEFAULT_ENTITY_DF_EVENT_TIMESTAMP_COL,
81-
"order_id",
82-
"driver_id",
83-
"customer_id",
84-
],
85-
inplace=True,
54+
for idx, dt in enumerate(
55+
pd.date_range(start=start_date, end=end_date, periods=order_count)
8656
)
57+
]
58+
df.sort_values(
59+
by=[
60+
DEFAULT_ENTITY_DF_EVENT_TIMESTAMP_COL,
61+
"order_id",
62+
"driver_id",
63+
"customer_id",
64+
],
65+
inplace=True,
66+
)
8767
return df
8868

8969

sdk/python/tests/integration/feature_repos/repo_configuration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class IntegrationTestRepoConfig:
4444
offline_store_creator: Type[DataSourceCreator] = FileDataSourceCreator
4545

4646
full_feature_names: bool = True
47-
infer_event_timestamp_col: bool = True
4847
infer_features: bool = False
4948

5049
def __repr__(self) -> str:

0 commit comments

Comments
 (0)