Skip to content

Commit

Permalink
checking in progress
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Arceo <[email protected]>
  • Loading branch information
franciscojavierarceo committed Sep 24, 2024
1 parent b4c9b10 commit 7dcebcb
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 34 deletions.
21 changes: 10 additions & 11 deletions sdk/python/feast/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,18 +283,17 @@ def _infer_on_demand_features_and_entities(

batch_source = getattr(source_feature_view, "batch_source")
batch_field_mapping = getattr(batch_source or None, "field_mapping")
if batch_field_mapping:
for (
original_col,
mapped_col,
) in batch_field_mapping.items():
if mapped_col in columns_to_exclude:
columns_to_exclude.remove(mapped_col)
columns_to_exclude.add(original_col)
for (
original_col,
mapped_col,
) in batch_field_mapping.items():
if mapped_col in columns_to_exclude:
columns_to_exclude.remove(mapped_col)
columns_to_exclude.add(original_col)

table_column_names_and_types = (
batch_source.get_table_column_names_and_types(config)
)
table_column_names_and_types = batch_source.get_table_column_names_and_types(
config
)
for col_name, col_datatype in table_column_names_and_types:
if col_name in columns_to_exclude:
continue
Expand Down
8 changes: 4 additions & 4 deletions sdk/python/feast/infra/online_stores/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,16 @@ def online_write_batch(
),
)
else:
# except Exception as e:
print(
f"error writing online batch for {table_name} - {feature_name} = {val}\n {e}"
)
# print(
# f"error writing online batch for {table_name} - {feature_name} = {val}\n {e}"
# )
print(
f'querying all records for table: {conn.execute(f"select * from {table_name}").fetchall()}'
)
r = conn.execute("""
SELECT * FROM sqlite_master WHERE type='table' and name = 'test_on_demand_python_transformation_python_stored_writes_feature_view';
""")
print(f"table exists: {r.fetchall()}")
if progress:
progress(1)

Expand Down
11 changes: 6 additions & 5 deletions sdk/python/feast/protos/feast/core/FeatureViewProjection_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion sdk/python/feast/protos/feast/core/FeatureViewProjection_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ isort:skip_file
"""
import builtins
import collections.abc
import feast.core.DataSource_pb2
import feast.core.Feature_pb2
import google.protobuf.descriptor
import google.protobuf.internal.containers
Expand Down Expand Up @@ -43,6 +44,11 @@ class FeatureViewProjection(google.protobuf.message.Message):
FEATURE_VIEW_NAME_ALIAS_FIELD_NUMBER: builtins.int
FEATURE_COLUMNS_FIELD_NUMBER: builtins.int
JOIN_KEY_MAP_FIELD_NUMBER: builtins.int
TIMESTAMP_FIELD_FIELD_NUMBER: builtins.int
DATE_PARTITION_COLUMN_FIELD_NUMBER: builtins.int
CREATED_TIMESTAMP_COLUMN_FIELD_NUMBER: builtins.int
BATCH_SOURCE_FIELD_NUMBER: builtins.int
STREAM_SOURCE_FIELD_NUMBER: builtins.int
feature_view_name: builtins.str
"""The feature view name"""
feature_view_name_alias: builtins.str
Expand All @@ -53,14 +59,29 @@ class FeatureViewProjection(google.protobuf.message.Message):
@property
def join_key_map(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]:
"""Map for entity join_key overrides of feature data entity join_key to entity data join_key"""
timestamp_field: builtins.str
date_partition_column: builtins.str
created_timestamp_column: builtins.str
@property
def batch_source(self) -> feast.core.DataSource_pb2.DataSource:
"""Batch/Offline DataSource where this view can retrieve offline feature data."""
@property
def stream_source(self) -> feast.core.DataSource_pb2.DataSource:
"""Streaming DataSource from where this view can consume "online" feature data."""
def __init__(
self,
*,
feature_view_name: builtins.str = ...,
feature_view_name_alias: builtins.str = ...,
feature_columns: collections.abc.Iterable[feast.core.Feature_pb2.FeatureSpecV2] | None = ...,
join_key_map: collections.abc.Mapping[builtins.str, builtins.str] | None = ...,
timestamp_field: builtins.str = ...,
date_partition_column: builtins.str = ...,
created_timestamp_column: builtins.str = ...,
batch_source: feast.core.DataSource_pb2.DataSource | None = ...,
stream_source: feast.core.DataSource_pb2.DataSource | None = ...,
) -> None: ...
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: ...
def HasField(self, field_name: typing_extensions.Literal["batch_source", b"batch_source", "stream_source", b"stream_source"]) -> builtins.bool: ...
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: ...

global___FeatureViewProjection = FeatureViewProjection
24 changes: 12 additions & 12 deletions sdk/python/feast/protos/feast/core/OnDemandFeatureView_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion sdk/python/feast/protos/feast/core/OnDemandFeatureView_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ class OnDemandFeatureViewSpec(google.protobuf.message.Message):
TAGS_FIELD_NUMBER: builtins.int
OWNER_FIELD_NUMBER: builtins.int
MODE_FIELD_NUMBER: builtins.int
WRITE_TO_ONLINE_STORE_FIELD_NUMBER: builtins.int
ENTITIES_FIELD_NUMBER: builtins.int
ENTITY_COLUMNS_FIELD_NUMBER: builtins.int
name: builtins.str
"""Name of the feature view. Must be unique. Not updated."""
project: builtins.str
Expand All @@ -127,6 +130,13 @@ class OnDemandFeatureViewSpec(google.protobuf.message.Message):
owner: builtins.str
"""Owner of the on demand feature view."""
mode: builtins.str
write_to_online_store: builtins.bool
@property
def entities(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
"""List of names of entities associated with this feature view."""
@property
def entity_columns(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[feast.core.Feature_pb2.FeatureSpecV2]:
"""List of specifications for each entity defined as part of this feature view."""
def __init__(
self,
*,
Expand All @@ -140,9 +150,12 @@ class OnDemandFeatureViewSpec(google.protobuf.message.Message):
tags: collections.abc.Mapping[builtins.str, builtins.str] | None = ...,
owner: builtins.str = ...,
mode: builtins.str = ...,
write_to_online_store: builtins.bool = ...,
entities: collections.abc.Iterable[builtins.str] | None = ...,
entity_columns: collections.abc.Iterable[feast.core.Feature_pb2.FeatureSpecV2] | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["feature_transformation", b"feature_transformation", "user_defined_function", b"user_defined_function"]) -> builtins.bool: ...
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: ...
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: ...

global___OnDemandFeatureViewSpec = OnDemandFeatureViewSpec

Expand Down

0 comments on commit 7dcebcb

Please sign in to comment.