Blitz static get query string#4993
Conversation
|
Probably this PR is causing this error: |
|
While I appreciate the work being done here what exactly are we intending to achieve structurally by changing this to a class method? Are we really so sure that we're never going to need anything from the instance to generate the query? Edit: Moving things out of the bootstrap method also has some pretty serious downstream implications. |
|
I think that This PR would allow us to get the query without creating a wrapper instance (in most cases) see ab9eba9 |
|
A ha, makes sense. Also then makes complete sense to refactor away the bootstrap method. Do we have any cases where we are using it at all after the changes you've made in 1ae9fff? We also need to know a priori what the wrapper class type mapping is anyway correct? That is, |
|
The error above in #4993 (comment) is caused by removal of Or by providing E.g. a static method: I don't know if there's any reason why The only other remaining use of |
|
There's already a |
|
Yes, I'm already writing more tests for |
This was only found because it was causing an error See ome#4993 (comment)
|
@chris-allan The |
|
Robot tests that were failing yesterday |
|
|
||
| def _getQueryString(self, opts=None): | ||
| @classmethod | ||
| def _getQueryString(klass, opts=None): |
There was a problem hiding this comment.
I don't understand arg klass, http://legacy.python.org/dev/peps/pep-0008/#function-and-method-arguments
There was a problem hiding this comment.
This is probably a historical (i.e. pre-PEP8) Josh/Carlos-style thing which should be dropped in favor of cls.
There was a problem hiding this comment.
The first argument to a class method is a reference to the class. As class is a "reserved" word in Python so we have to use something. klass is a classical style that we inherited from Java. cls is also fine and in line with the PEP8 suggestions as @joshmoore has already mentioned.
|
Reviewed with @chris-allan, merging. |
What this PR does
See discussion at #4950 (comment)
Since BlitzGateway
wrapper_getQueryString()doesn't need to be an instance method, this is now aclassmethod.Testing this PR
Check that tests are green etc.
cc @aleksandra-tarkowska