Skip to content

SharedComputeValue: Allow inheriting __eq__ and __hash__ #7146

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Aug 15, 2025

Issue

SharedComputeValue doesn't allow inheriting (or, rather, disabling the warning about inheriting) __eq__ and __hash__ in classes that compute values.

Description of changes

I added a check for the flag.

Includes
  • Code changes
  • Tests

@janezd janezd force-pushed the sharedcompute-inheriteq branch from 77e9ff5 to 593f37d Compare August 15, 2025 13:09
@janezd janezd requested review from markotoplak and Copilot August 15, 2025 13:21
Copy link

@Copilot 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 adds support for classes to inherit __eq__ and __hash__ methods in SharedComputeValue without triggering warnings. It introduces an InheritEq flag that can be set to True on classes to suppress the warning about not defining these methods.

  • Added a check for the InheritEq flag in the warning condition
  • Created test coverage for the new inheritance functionality
  • Updated internationalization messages to include the new flag

Reviewed Changes

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

File Description
Orange/data/util.py Added condition to check for InheritEq flag to suppress warning
Orange/tests/test_data_util.py Added test cases for both warning and non-warning scenarios
i18n/si/msgs.jaml Added internationalization entry for the new InheritEq flag

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Copy link

codecov bot commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.78%. Comparing base (5eb97b8) to head (593f37d).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7146   +/-   ##
=======================================
  Coverage   88.77%   88.78%           
=======================================
  Files         334      334           
  Lines       73671    73700   +29     
=======================================
+ Hits        65402    65435   +33     
+ Misses       8269     8265    -4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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