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

Assignment from no return #658

Merged
merged 7 commits into from
Jan 25, 2024

Conversation

macohen
Copy link
Contributor

@macohen macohen commented Jan 22, 2024

Description

  • enables assignment-from-no-return
    * updated to pass this by marking Facet.get_value_filter(self, filter_value: Any) -> Any as an abc.abstractmethod
    * implemented these missing methods in two subclasses to return None
  • wondering if we would be better off not enforcing this, but I'm leaning towards enforcement

Issues Resolved

progress on #610

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

… lines

in run_tests.py, exception thrown by 'git remote add origin' when the remote already exists will not exit

Signed-off-by: Mark Cohen <markcoh@amazon.com>
Signed-off-by: Mark Cohen <markcoh@amazon.com>
Copy link

codecov bot commented Jan 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6e58837) 72.13% compared to head (c2c9c22) 72.14%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #658      +/-   ##
==========================================
+ Coverage   72.13%   72.14%   +0.01%     
==========================================
  Files          89       89              
  Lines        7945     7945              
==========================================
+ Hits         5731     5732       +1     
+ Misses       2214     2213       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

updated CHANGELOG.md
Signed-off-by: Mark Cohen <markcoh@amazon.com>
@macohen macohen force-pushed the assignment-from-no-return branch from 96da2f1 to 07c11c5 Compare January 22, 2024 20:35
added assert to test get_value_filter returning None

Signed-off-by: Mark Cohen <markcoh@amazon.com>
@macohen macohen force-pushed the assignment-from-no-return branch from f0292f6 to 0528052 Compare January 22, 2024 22:16
@saimedhi
Copy link
Collaborator

Few tests are failing. Please try to make them pass.

returning None from test_faceted_search.Facet.get_value_filter

Signed-off-by: Mark Cohen <markcoh@amazon.com>
…renced them

Signed-off-by: Mark Cohen <markcoh@amazon.com>
Copy link
Collaborator

@saimedhi saimedhi left a comment

Choose a reason for hiding this comment

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

@macohen, could you kindly implement the requested changes and address the lint error? Once done, we can proceed with merging the code. Thank you!

CHANGELOG.md Outdated
@@ -3,6 +3,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Added
- Added pylint `assignment-from-no-return` (([#657](https://github.com/opensearch-project/opensearch-py/pull/657))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change PR number 658

)
else:
print(e)
sys.exit(1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this sys.exit(1) be moved into else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intent here was to make it clear why the exit was happening. I didn't want to change the previous behavior especially after I found the TEST_OPENSEARCH_NOFETCH variable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@macohen, I apologize if I am causing any confusion, but I believe there's a change in the behavior for e.returncode == remote_origin_already_exists.

It seems that there shouldn't be a sys.exit(1) when e.returncode == remote_origin_already_exists. Please correct me if I'm mistaken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the poor explanation on my end. Prior to my change, when the git repository already had a remote origin added, the whole process exited. I was considering just ignoring that state, but then found the TEST_OPENSEARCH_NOFETCH variable which can be set when you want that state to be ignored. I figured it would be better to maintain the behavior of the script in that case and also tell the user that TEST_OPENSEARCH_NOFETCH could help if exiting was not desired. I hope that helps...

Signed-off-by: Mark Cohen <markcoh@amazon.com>
@macohen macohen force-pushed the assignment-from-no-return branch from e23376f to c2c9c22 Compare January 25, 2024 01:30
@saimedhi saimedhi merged commit a80bab2 into opensearch-project:main Jan 25, 2024
57 checks passed
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.

2 participants