-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fixes lane saving bug #1688
Fixes lane saving bug #1688
Conversation
@dbernstein the reason its happening, as you suspected, is the I think generally explicit is better then implicit for arguments, so I'd be happy to drop the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as is, but if the parameter is getting set everywhere already, it probably makes sense to drop @inject
decorator and the default for the arg so its more explicit:
def update_size(
self, _db, search_engine: ExternalSearchIndex
):
This one should probably go out as a hotfix once its merged. So we might want to wait on the production rollout until its merged. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1688 +/- ##
==========================================
- Coverage 90.04% 90.04% -0.01%
==========================================
Files 245 245
Lines 28167 28166 -1
Branches 6423 6422 -1
==========================================
- Hits 25364 25363 -1
Misses 1855 1855
Partials 948 948
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Description
This PR resolves the bug that was manifesting as a failure to save lanes.
I'm not entirely why not passing the search_engine argument without a key causes the following error:
When I debugged it, there was only one value being passed. I'm guessing it has something to do with the @Inject tag trying to inject the available search_engine in addition to the explicit
self.search_engine
.I noticed that removing the self.seach_engine argument altogether also solved the problem which makes sense because it is injecting the available search_engine in the context. Presumably the injected search_engine instance is the same instance being passed in explicitly. The unit tests pass because the search_engine is explicitly using the keyword. I'm not seeing it being passed implicitly via injection anywhere else in the code.
For the sake of completeness, I also went ahead and updated other references to
Lane.update_size
where the search_engine wasn't being passed with the keyword.@jonathangreen : do you have any insight into what we should be doing here? Should rely on the injection or is it better to be explicit?
Motivation and Context
https://ebce-lyrasis.atlassian.net/browse/PP-986
How Has This Been Tested?
Manually tested on a local instance. Unit tests still pass.
Checklist