Skip to content

Commit a10b3de

Browse files
checking in progress
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent 982ff38 commit a10b3de

File tree

6 files changed

+68
-34
lines changed

6 files changed

+68
-34
lines changed

sdk/python/feast/inference.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,17 @@ def _infer_on_demand_features_and_entities(
282282

283283
batch_source = getattr(source_feature_view, "batch_source")
284284
batch_field_mapping = getattr(batch_source or None, "field_mapping")
285-
if batch_field_mapping:
286-
for (
287-
original_col,
288-
mapped_col,
289-
) in batch_field_mapping.items():
290-
if mapped_col in columns_to_exclude:
291-
columns_to_exclude.remove(mapped_col)
292-
columns_to_exclude.add(original_col)
285+
for (
286+
original_col,
287+
mapped_col,
288+
) in batch_field_mapping.items():
289+
if mapped_col in columns_to_exclude:
290+
columns_to_exclude.remove(mapped_col)
291+
columns_to_exclude.add(original_col)
293292

294-
table_column_names_and_types = (
295-
batch_source.get_table_column_names_and_types(config)
296-
)
293+
table_column_names_and_types = batch_source.get_table_column_names_and_types(
294+
config
295+
)
297296
for col_name, col_datatype in table_column_names_and_types:
298297
if col_name in columns_to_exclude:
299298
continue

sdk/python/feast/infra/online_stores/sqlite.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,16 @@ def online_write_batch(
197197
),
198198
)
199199
else:
200-
# except Exception as e:
201-
print(
202-
f"error writing online batch for {table_name} - {feature_name} = {val}\n {e}"
203-
)
200+
# print(
201+
# f"error writing online batch for {table_name} - {feature_name} = {val}\n {e}"
202+
# )
204203
print(
205204
f'querying all records for table: {conn.execute(f"select * from {table_name}").fetchall()}'
206205
)
207206
r = conn.execute("""
208207
SELECT * FROM sqlite_master WHERE type='table' and name = 'test_on_demand_python_transformation_python_stored_writes_feature_view';
209208
""")
209+
print(f"table exists: {r.fetchall()}")
210210
if progress:
211211
progress(1)
212212

sdk/python/feast/protos/feast/core/FeatureViewProjection_pb2.py

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/python/feast/protos/feast/core/FeatureViewProjection_pb2.pyi

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ isort:skip_file
44
"""
55
import builtins
66
import collections.abc
7+
import feast.core.DataSource_pb2
78
import feast.core.Feature_pb2
89
import google.protobuf.descriptor
910
import google.protobuf.internal.containers
@@ -43,6 +44,11 @@ class FeatureViewProjection(google.protobuf.message.Message):
4344
FEATURE_VIEW_NAME_ALIAS_FIELD_NUMBER: builtins.int
4445
FEATURE_COLUMNS_FIELD_NUMBER: builtins.int
4546
JOIN_KEY_MAP_FIELD_NUMBER: builtins.int
47+
TIMESTAMP_FIELD_FIELD_NUMBER: builtins.int
48+
DATE_PARTITION_COLUMN_FIELD_NUMBER: builtins.int
49+
CREATED_TIMESTAMP_COLUMN_FIELD_NUMBER: builtins.int
50+
BATCH_SOURCE_FIELD_NUMBER: builtins.int
51+
STREAM_SOURCE_FIELD_NUMBER: builtins.int
4652
feature_view_name: builtins.str
4753
"""The feature view name"""
4854
feature_view_name_alias: builtins.str
@@ -53,14 +59,29 @@ class FeatureViewProjection(google.protobuf.message.Message):
5359
@property
5460
def join_key_map(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]:
5561
"""Map for entity join_key overrides of feature data entity join_key to entity data join_key"""
62+
timestamp_field: builtins.str
63+
date_partition_column: builtins.str
64+
created_timestamp_column: builtins.str
65+
@property
66+
def batch_source(self) -> feast.core.DataSource_pb2.DataSource:
67+
"""Batch/Offline DataSource where this view can retrieve offline feature data."""
68+
@property
69+
def stream_source(self) -> feast.core.DataSource_pb2.DataSource:
70+
"""Streaming DataSource from where this view can consume "online" feature data."""
5671
def __init__(
5772
self,
5873
*,
5974
feature_view_name: builtins.str = ...,
6075
feature_view_name_alias: builtins.str = ...,
6176
feature_columns: collections.abc.Iterable[feast.core.Feature_pb2.FeatureSpecV2] | None = ...,
6277
join_key_map: collections.abc.Mapping[builtins.str, builtins.str] | None = ...,
78+
timestamp_field: builtins.str = ...,
79+
date_partition_column: builtins.str = ...,
80+
created_timestamp_column: builtins.str = ...,
81+
batch_source: feast.core.DataSource_pb2.DataSource | None = ...,
82+
stream_source: feast.core.DataSource_pb2.DataSource | None = ...,
6383
) -> None: ...
64-
def ClearField(self, field_name: typing_extensions.Literal["feature_columns", b"feature_columns", "feature_view_name", b"feature_view_name", "feature_view_name_alias", b"feature_view_name_alias", "join_key_map", b"join_key_map"]) -> None: ...
84+
def HasField(self, field_name: typing_extensions.Literal["batch_source", b"batch_source", "stream_source", b"stream_source"]) -> builtins.bool: ...
85+
def ClearField(self, field_name: typing_extensions.Literal["batch_source", b"batch_source", "created_timestamp_column", b"created_timestamp_column", "date_partition_column", b"date_partition_column", "feature_columns", b"feature_columns", "feature_view_name", b"feature_view_name", "feature_view_name_alias", b"feature_view_name_alias", "join_key_map", b"join_key_map", "stream_source", b"stream_source", "timestamp_field", b"timestamp_field"]) -> None: ...
6586

6687
global___FeatureViewProjection = FeatureViewProjection

sdk/python/feast/protos/feast/core/OnDemandFeatureView_pb2.py

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/python/feast/protos/feast/core/OnDemandFeatureView_pb2.pyi

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ class OnDemandFeatureViewSpec(google.protobuf.message.Message):
104104
TAGS_FIELD_NUMBER: builtins.int
105105
OWNER_FIELD_NUMBER: builtins.int
106106
MODE_FIELD_NUMBER: builtins.int
107+
WRITE_TO_ONLINE_STORE_FIELD_NUMBER: builtins.int
108+
ENTITIES_FIELD_NUMBER: builtins.int
109+
ENTITY_COLUMNS_FIELD_NUMBER: builtins.int
107110
name: builtins.str
108111
"""Name of the feature view. Must be unique. Not updated."""
109112
project: builtins.str
@@ -127,6 +130,13 @@ class OnDemandFeatureViewSpec(google.protobuf.message.Message):
127130
owner: builtins.str
128131
"""Owner of the on demand feature view."""
129132
mode: builtins.str
133+
write_to_online_store: builtins.bool
134+
@property
135+
def entities(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
136+
"""List of names of entities associated with this feature view."""
137+
@property
138+
def entity_columns(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[feast.core.Feature_pb2.FeatureSpecV2]:
139+
"""List of specifications for each entity defined as part of this feature view."""
130140
def __init__(
131141
self,
132142
*,
@@ -140,9 +150,12 @@ class OnDemandFeatureViewSpec(google.protobuf.message.Message):
140150
tags: collections.abc.Mapping[builtins.str, builtins.str] | None = ...,
141151
owner: builtins.str = ...,
142152
mode: builtins.str = ...,
153+
write_to_online_store: builtins.bool = ...,
154+
entities: collections.abc.Iterable[builtins.str] | None = ...,
155+
entity_columns: collections.abc.Iterable[feast.core.Feature_pb2.FeatureSpecV2] | None = ...,
143156
) -> None: ...
144157
def HasField(self, field_name: typing_extensions.Literal["feature_transformation", b"feature_transformation", "user_defined_function", b"user_defined_function"]) -> builtins.bool: ...
145-
def ClearField(self, field_name: typing_extensions.Literal["description", b"description", "feature_transformation", b"feature_transformation", "features", b"features", "mode", b"mode", "name", b"name", "owner", b"owner", "project", b"project", "sources", b"sources", "tags", b"tags", "user_defined_function", b"user_defined_function"]) -> None: ...
158+
def ClearField(self, field_name: typing_extensions.Literal["description", b"description", "entities", b"entities", "entity_columns", b"entity_columns", "feature_transformation", b"feature_transformation", "features", b"features", "mode", b"mode", "name", b"name", "owner", b"owner", "project", b"project", "sources", b"sources", "tags", b"tags", "user_defined_function", b"user_defined_function", "write_to_online_store", b"write_to_online_store"]) -> None: ...
146159

147160
global___OnDemandFeatureViewSpec = OnDemandFeatureViewSpec
148161

0 commit comments

Comments
 (0)