Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Replace Identity Comparison with Equality Comparison in parse_repo #3626

Conversation

srausser
Copy link

What this PR does / why we need it:
This Pull Request updates the parse_repo function in repo_operations.py, transitioning from the identity operator is to the equality operator == for object comparisons.

Previously, the parse_repo function utilized the is operator to compare Feast objects such as data sources, feature views, and entities. The is operator compares if two variables point to the exact same object in memory. However, this approach can be overly restrictive.

When Feast objects are imported across different parts of the repository definition files, they may not share the same memory address, even though they represent the same logical object. This discrepancy led to erroneous distinctions between objects that should have been recognized as identical.

To address this, I've replaced the is operator with ==. The == operator evaluates whether two variables are equal in value, independent of their memory addresses. This adjustment enhances the flexibility and accuracy of object comparison within parse_repo, permitting objects imported across the repository to be correctly recognized as equal when their values match.

Which issue(s) this PR fixes:

Fixes #3312

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: srausser
To complete the pull request process, please assign dvirdukhan after the PR has been reviewed.
You can assign the PR to them by writing /assign @dvirdukhan in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: srausser <srausser@gmail.com>
@srausser srausser force-pushed the srausser/fix_parse_repo_equality_check branch from f1a8445 to c424f84 Compare May 11, 2023 22:11
@srausser
Copy link
Author

/assign @DvirDukhan

@srausser
Copy link
Author

closing since i can't seem to replicate the errors im seeing in my production repository

@srausser srausser closed this May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feast duplicates sourses
3 participants