DickJC123 commented on a change in pull request #16462: Fix flakey pylint CI failures URL: https://github.com/apache/incubator-mxnet/pull/16462#discussion_r334609627
########## File path: python/mxnet/numpy_op_signature.py ########## @@ -19,6 +19,7 @@ import sys import warnings +import inspect Review comment: So, first I should mention that as I developed the PR on my local machine, I was seeing slightly different pylint output than the upstream CI. This could be due to a different pylint version. In the comment that follows, I'll refer to the pylint command I posted above in the PR description as `<pylint_cmd>`: With the `import inspect` statement in its original location, I saw: ``` $ <pylint_cmd> | grep numpy_op_signature ************* Module mxnet.numpy_op_signature python/mxnet/numpy_op_signature.py:C0415:63,4: _register_op_signatures: Import outside toplevel (inspect) ``` With the `import inspect` statement moved, no such output line was generated. Since I was touching the file numpy_op_signature.py anyway to eliminate the E0402 error, I thought I'd make the file totally clean w.r.t pylint by moving the `import inspect`. Introducing the line `op_module = root_module` was the fix that really mattered (eliminated the E0402 error). Since it didn't change the logic of the code materially, I view this as working around the quirks of numpy. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
