Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
508bad2
merged changes
franciscojavierarceo Sep 24, 2024
899f7f4
saving progress
franciscojavierarceo Aug 17, 2024
5b69c71
merged changes to odfv
franciscojavierarceo Sep 24, 2024
d107354
linted
franciscojavierarceo Aug 18, 2024
a34ec4d
adding the test needed to show the expected behavior
franciscojavierarceo Aug 18, 2024
b95d2a2
updated test case
franciscojavierarceo Aug 21, 2024
47974c2
saving progress
franciscojavierarceo Aug 21, 2024
ceb75a2
merging
franciscojavierarceo Sep 24, 2024
6688933
merged
franciscojavierarceo Sep 24, 2024
4c28acc
merged
franciscojavierarceo Sep 24, 2024
fd577dc
merging
franciscojavierarceo Sep 24, 2024
167fe6c
adding the entity keys for now to do retrieval
franciscojavierarceo Aug 29, 2024
54811d7
adding entity to odfv
franciscojavierarceo Aug 29, 2024
f0d87fc
checking in progress...getting closer
franciscojavierarceo Aug 29, 2024
b7091ca
may have to revert some of this...looks like the challenge is getting…
franciscojavierarceo Aug 31, 2024
d2a12f8
moving things around to make it easier to debug
franciscojavierarceo Sep 1, 2024
9d496ba
debugging
franciscojavierarceo Sep 1, 2024
58280aa
merged
franciscojavierarceo Sep 24, 2024
c42be75
merging
franciscojavierarceo Sep 24, 2024
fb3b315
Rebasing and merging changes from other PR
franciscojavierarceo Sep 6, 2024
82f3f8b
Merging changes continued
franciscojavierarceo Sep 7, 2024
172693d
update the _make_inference to include odfvs with writes in the update…
franciscojavierarceo Sep 7, 2024
66c5b57
have the table being written now...the create table happens in the Sq…
franciscojavierarceo Sep 8, 2024
ea3b98a
checking in progress
franciscojavierarceo Sep 9, 2024
905912b
adding logs
franciscojavierarceo Sep 10, 2024
25d42dd
updating permissions
franciscojavierarceo Sep 10, 2024
03d6116
going to error out on purpose
franciscojavierarceo Sep 10, 2024
9b16615
adding unit test and merging changes
franciscojavierarceo Sep 18, 2024
adbaeb6
almost got everything working and type validation behaving
franciscojavierarceo Sep 18, 2024
11d2914
cleaned up and have tests behaving
franciscojavierarceo Sep 18, 2024
64375ee
adding print
franciscojavierarceo Sep 21, 2024
3e6912a
removing print
franciscojavierarceo Sep 21, 2024
5751a72
checking in progress
franciscojavierarceo Sep 23, 2024
b0208e1
updating test
franciscojavierarceo Sep 25, 2024
463d8bb
adding test
franciscojavierarceo Sep 25, 2024
2981817
linted and updated
franciscojavierarceo Sep 25, 2024
3a33368
removed print
franciscojavierarceo Sep 25, 2024
22bf637
updated tests to test actual behavior
franciscojavierarceo Sep 25, 2024
0d0d117
checking in progress
franciscojavierarceo Sep 28, 2024
5bff836
changing typo
franciscojavierarceo Sep 28, 2024
271f814
updating test
franciscojavierarceo Sep 28, 2024
754b0e8
testing changes
franciscojavierarceo Sep 28, 2024
25c7181
checking to see if thing still working
franciscojavierarceo Sep 29, 2024
1d4023f
removed print
franciscojavierarceo Sep 29, 2024
3662102
undo change for odfv file
franciscojavierarceo Sep 29, 2024
74e7ede
updated tests
franciscojavierarceo Sep 30, 2024
59940cf
okay well have the unit test working
franciscojavierarceo Oct 1, 2024
b223feb
type changes, hope i dont regret them
franciscojavierarceo Oct 1, 2024
01770e2
updated stream feature view piece
franciscojavierarceo Oct 2, 2024
7606481
updated sfv ifelse
franciscojavierarceo Oct 2, 2024
c4ebf18
removing print
franciscojavierarceo Oct 2, 2024
72add32
formatted and updated test
franciscojavierarceo Oct 2, 2024
24e0a84
resolving some linter errors
franciscojavierarceo Oct 3, 2024
b92bf32
fixed linter and formatting
franciscojavierarceo Oct 3, 2024
934c1e9
okay think it is working
franciscojavierarceo Oct 3, 2024
0ce93f2
linter
franciscojavierarceo Oct 3, 2024
bf31d59
updated type map for integration tests
franciscojavierarceo Oct 4, 2024
9aff889
Merge branch 'master' into podfv2
franciscojavierarceo Oct 5, 2024
acc7b7f
updated local feature store test
franciscojavierarceo Oct 5, 2024
12d9100
fixed local fs test
franciscojavierarceo Oct 5, 2024
3c94614
chore: Updated snowflake test to be more explicit about post apply en…
franciscojavierarceo Oct 5, 2024
f01b691
merging
franciscojavierarceo Oct 5, 2024
c26ae75
fixed test to entity_rows_to_read
franciscojavierarceo Oct 5, 2024
c6d55c7
resolved inf conflicts
franciscojavierarceo Oct 5, 2024
52b8c4d
lint
franciscojavierarceo Oct 5, 2024
ca0971a
Updated tests and lint, think I have everything working
franciscojavierarceo Oct 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merging changes continued
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
  • Loading branch information
franciscojavierarceo committed Sep 30, 2024
commit 82f3f8b48eaf64f07768710e2396549e73a76a9d
5 changes: 0 additions & 5 deletions sdk/python/feast/infra/passthrough_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,6 @@ def ingest_df(
self.online_write_batch(
self.repo_config, feature_view, rows_to_write, progress=None
)
# We get these two sets of feature view projections, which are similar to the batch source for regular feature_views
# We need to extract these dependencies to get the data types and field mappings to run the _convert_arrow_to_proto function
#print(feature_view.source_feature_view_projections)
#print(feature_view.source_request_sources)
#print('something should happen here')
else:
# Note: A dictionary mapping of column names in this data
# source to feature names in a feature table or view. Only used for feature
Expand Down
47 changes: 20 additions & 27 deletions sdk/python/feast/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,18 +322,24 @@ def _convert_arrow_odfv_to_proto(
}
# Adding On Demand Features
for feature in feature_view.features:
if feature.name in [c[0] for c in columns] and feature.name not in proto_values_by_column:
if (
feature.name in [c[0] for c in columns]
and feature.name not in proto_values_by_column
):
# initializing the column as null
null_column = pyarrow.array(
[None] * table.num_rows,
type=from_feast_to_pyarrow_type(feature.dtype),
)
[None] * table.num_rows,
type=from_feast_to_pyarrow_type(feature.dtype),
)
updated_table = pyarrow.RecordBatch.from_arrays(
table.columns + [null_column],
schema=table.schema.append(pyarrow.field(feature.name, null_column.type))
schema=table.schema.append(
pyarrow.field(feature.name, null_column.type)
),
)
proto_values_by_column[feature.name] = python_values_to_proto_values(
updated_table.column(feature.name).to_numpy(zero_copy_only=False), feature.dtype.to_value_type(),
updated_table.column(feature.name).to_numpy(zero_copy_only=False),
feature.dtype.to_value_type(),
)

entity_keys = [
Expand All @@ -351,28 +357,15 @@ def _convert_arrow_odfv_to_proto(
}
features = [dict(zip(feature_dict, vars)) for vars in zip(*feature_dict.values())]

# Convert event_timestamps
event_timestamps = [
_coerce_datetime(val)
for val in pd.to_datetime(
table.column(feature_view.batch_source.timestamp_field).to_numpy(
zero_copy_only=False
)
)
]
# We need to artificially add event_timestamps and created_timestamps
event_timestamps = []
timestamp_values = pd.to_datetime([_utc_now() for i in range(table.num_rows)])

# Convert created_timestamps if they exist
if feature_view.batch_source.created_timestamp_column:
created_timestamps = [
_coerce_datetime(val)
for val in pd.to_datetime(
table.column(
feature_view.batch_source.created_timestamp_column
).to_numpy(zero_copy_only=False)
)
]
else:
created_timestamps = [None] * table.num_rows
for val in timestamp_values:
event_timestamps.append(_coerce_datetime(val))

# setting them equivalent
created_timestamps = event_timestamps

return list(zip(entity_keys, features, event_timestamps, created_timestamps))

Expand Down
24 changes: 11 additions & 13 deletions sdk/python/tests/unit/test_on_demand_python_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@ def setUp(self):
timestamp_field="event_timestamp",
created_timestamp_column="created",
)
input_request_source = RequestSource(
name="counter_source",
schema=[
Field(name="counter", dtype=Int64),
Field(name="input_datetime", dtype=UnixTimestamp),
],
)

driver_stats_fv = FeatureView(
name="driver_hourly_stats",
Expand Down Expand Up @@ -273,6 +266,7 @@ def test_python_docs_demo(self):
== online_python_response["conv_rate_plus_val2_python"][0]
)


class TestOnDemandPythonTransformationAllDataTypes(unittest.TestCase):
def setUp(self):
with tempfile.TemporaryDirectory() as data_dir:
Expand Down Expand Up @@ -511,7 +505,6 @@ def python_view(inputs: dict[str, Any]) -> dict[str, Any]:
store.apply([request_source, python_view])



class TestOnDemandTransformationsWithWrites(unittest.TestCase):
def setUp(self):
with tempfile.TemporaryDirectory() as data_dir:
Expand Down Expand Up @@ -616,10 +609,16 @@ def python_stored_writes_feature_view(
assert len(self.store.list_feature_views()) == 1
assert len(self.store.list_on_demand_feature_views()) == 1
assert len(self.store.list_stream_feature_views()) == 0
assert driver_stats_fv.entity_columns == \
self.store.get_feature_view('driver_hourly_stats').entity_columns
assert self.store.get_on_demand_feature_view('python_stored_writes_feature_view').entity_columns == \
self.store.get_feature_view('driver_hourly_stats').entity_columns
assert (
driver_stats_fv.entity_columns
== self.store.get_feature_view("driver_hourly_stats").entity_columns
)
assert (
self.store.get_on_demand_feature_view(
"python_stored_writes_feature_view"
).entity_columns
== self.store.get_feature_view("driver_hourly_stats").entity_columns
)

def test_stored_writes(self):
current_datetime = _utc_now()
Expand Down Expand Up @@ -666,4 +665,3 @@ def test_stored_writes(self):
"input_datetime",
]
)