Skip to content

Conversation

@antznette1
Copy link
Contributor

@antznette1 antznette1 commented Jan 24, 2026

##Summary
This PR centralizes the repeated logic used to resolve a “feature view-like” name into the correct Feast object type:

  • FeatureView
  • OnDemandFeatureView
  • StreamFeatureView

Previously, this lookup pattern was duplicated across multiple Python SDK/server components.

What changed

  • Added shared helpers in sdk/python/feast/feature_view_utils.py:
    • get_feast_object_from_feature_store(...) (FeatureStore-style APIs)
    • get_feast_object_from_registry(...) (Registry-style APIs)
  • Updated call sites to use the centralized helpers:
    • sdk/python/feast/feature_server.py (_get_feast_object)
    • sdk/python/feast/feature_logging.py (FeatureServiceLoggingSource.get_schema)

Motivation

  • Reduce copy/pasted try/except blocks across the codebase.
  • Make behavior consistent and easier to maintain (single place to adjust lookup semantics).

Notes / Testing

Local sanity check: python -m compileall on the modified files.


Open with Devin

@antznette1 antznette1 requested a review from a team as a code owner January 24, 2026 11:41
@antznette1 antznette1 force-pushed the feat/centralize-feast-object-lookup branch from b1ed05c to 20d5920 Compare January 24, 2026 11:56
@antznette1 antznette1 changed the title refactor: centralize feature view object lookup refactor: Centralize feature view object lookup Jan 24, 2026
@antznette1 antznette1 force-pushed the feat/centralize-feast-object-lookup branch from 20d5920 to 256012d Compare January 24, 2026 12:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the codebase by centralizing the repeated logic for resolving feature view-like names (FeatureView, OnDemandFeatureView, StreamFeatureView) into shared utility functions, reducing code duplication and improving maintainability.

Changes:

  • Added two new helper functions in feature_view_utils.py for centralized feature view lookup
  • Updated feature_server.py to use the new centralized lookup function
  • Updated feature_logging.py to use the new centralized lookup function

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
sdk/python/feast/feature_view_utils.py Added get_feast_object_from_feature_store and get_feast_object_from_registry helper functions
sdk/python/feast/feature_server.py Replaced duplicated try/except lookup logic with call to get_feast_object_from_feature_store
sdk/python/feast/feature_logging.py Replaced duplicated try/except lookup logic with call to get_feast_object_from_registry

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View issue and 3 additional flags in Devin Review.

Open in Devin Review

@antznette1 antznette1 force-pushed the feat/centralize-feast-object-lookup branch from 256012d to 5f3a571 Compare January 26, 2026 15:57
Signed-off-by: antznette1 <Ochiezeanthonette@gmail.com>
@antznette1 antznette1 force-pushed the feat/centralize-feast-object-lookup branch from 5f3a571 to dd5c9af Compare January 26, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant