-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
BUG: fix SIA2 session inheritance #490
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't know if this concern is a big deal, but if someone right now sends passes their own session when calling the
search
method, that would be silently ignored. The alternative is to look for the session intokwargs
and use that one if available. At least temporarily.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.
Shouldn't they have used that session in their instance init? (as far as I see we basically pass on
self._session
at this point in the other classes, too (though sometimes it happens in thecreate_query
method, rather than this high up.)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.
I think this is an interesting question. I understand the concern but feel like breaking someone's existing behavior is unlikely. If we find this is a problem moving forward, we can come back and address it again. The use of
kwargs
throughout this code makes tracking some of the parameters challenging.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.
I agree about
kwargs
. If I'm not mistaken, these arguments are intended primarily for therequests
underlying library so it's easy for someone to specify things liketimeout
,headers
, etc with call. Maybe that's too confusing and we need to add a request attribute map in the service class for that more expert-use purpose.The bottom line is that we are essentially removing
sessions
from the list of arguments, silently without giving any warning. There might not be any users of this feature, but if there are, they will have a very hard time understanding what is going on.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.
I've tried to trace some of these kwagrs, and they ended up being an rendered out to be attributes, most of not being used at all. So, if the aim is to pass them along all the way to
request
, then I would suggest to add arequest_kwargs
parameter that accepts an dict.But changing it all at this point would potentially painful for users (though I would say any errors would be easy to fix, or in fact directly highlighting bugs in their usage.
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.
I'm OK with
request_kwargs
. And a deprecation warning whenkwargs
is not empty? A pain, I know, but the right etiquette.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.
I'll check, even the deprecation decorators may work, I just never tried them for
**
cases.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.
I feel I'm just a broken record with the same ideas (#466) 😅