Skip to content

Commit

Permalink
fix: Add inlined data sources to the top level registry
Browse files Browse the repository at this point in the history
Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals committed Mar 25, 2022
1 parent f202f92 commit 40a5f6d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion go/internal/feast/featurestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ func groupFeatureRefs(requestedFeatureViews []*featureViewAndRefs,
joinKeys := make([]string, 0)
fv := featuresAndView.view
featureNames := featuresAndView.featureRefs
for entity, _ := range fv.entities {
for entity := range fv.entities {
joinKeys = append(joinKeys, entityNameToJoinKeyMap[entity])
}

Expand Down
29 changes: 18 additions & 11 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def _plan(
new_infra_proto = new_infra.to_proto()
infra_diff = diff_infra_protos(current_infra_proto, new_infra_proto)

return (registry_diff, infra_diff, new_infra)
return registry_diff, infra_diff, new_infra

@log_exceptions_and_usage
def _apply_diffs(
Expand Down Expand Up @@ -648,16 +648,23 @@ def apply(
]
odfvs_to_update = [ob for ob in objects if isinstance(ob, OnDemandFeatureView)]
services_to_update = [ob for ob in objects if isinstance(ob, FeatureService)]
data_sources_to_update = [ob for ob in objects if isinstance(ob, DataSource)]

if len(entities_to_update) + len(views_to_update) + len(
request_views_to_update
) + len(odfvs_to_update) + len(services_to_update) + len(
data_sources_to_update
) != len(
objects
):
raise ValueError("Unknown object type provided as part of apply() call")
data_sources_set_to_update = {
ob for ob in objects if isinstance(ob, DataSource)
}

for fv in views_to_update:
data_sources_set_to_update.add(fv.batch_source)
if fv.stream_source:
data_sources_set_to_update.add(fv.stream_source)

for rfv in request_views_to_update:
data_sources_set_to_update.add(rfv.request_data_source)

for odfv in odfvs_to_update:
for v in odfv.input_request_data_sources.values():
data_sources_set_to_update.add(v)

data_sources_to_update = list(data_sources_set_to_update)

# Validate all feature views and make inferences.
self._validate_all_feature_views(
Expand Down

0 comments on commit 40a5f6d

Please sign in to comment.