EarthCubeInGeo / resen-core

The core docker image used by resen.
GNU General Public License v3.0
2 stars 3 forks source link

[BUG]: Jupyterlab strange tab-autocomplete fails for instantiated classes within cells #53

Closed pmreyes2 closed 4 years ago

pmreyes2 commented 4 years ago

Tested both in resen-core 2019.1.0 and 2020.1.0 the issue happens only in their notebooks with py36 kernels. GIF illustrating the issue:

py36_notebook_autocompletion

Autocomplete with tab fails in the second line, after a=np.arange(10) in the second cell. In a new cell it works fine, also if used in the first line of cell 2, before a=np.arange(10). Surprisingly it also works when removing the right parenthesis of np.arange or erasing the a to the left of np.arange.

A similar issue was reported in the Jupyter notebook github repository: https://github.com/jupyter/notebook/issues/4305. Will check later if that solution helps.

pmreyes2 commented 4 years ago

Testing the solution offered at the end of the thread: https://github.com/jupyter/notebook/issues/4305 , which is to disable jedi autocompletion and use the default:

Now normal behavior of autocompletion for py36 ipython and notebooks is restored, but the nice jedi autocompletion is disabled.:

GIF illustrating the new behavior (jedi autocompletion disabled):

py36_ipython_nojedi

This other open thread report the same issue of ipython: https://github.com/ipython/ipython/issues/11530

asreimer commented 4 years ago

So this is a problem with the jupyterlab interface. We should track what they do to fix the problem and make sure we upgrade to the next release with the bugfix.

asreimer commented 4 years ago

Revisiting this again it was a feature of the jedi package for security reasons, but as of jedi 0.15.0, the issue is fixed. See: https://github.com/ipython/ipython/issues/11546#issuecomment-520253924 For the discussion on safety, see here: https://github.com/davidhalter/jedi/issues/1299#issuecomment-475369943

So, I created a new 2020.1.0 bucket and tried the autocomplete example that @pmreyes2 mentioned. We're currently running jedi 0.17.0 in the py36 environment and I can reproduce the problem. If I upgrade jedi to 0.17.2, the issue goes away.

Can you confirm this @pmreyes2?

pmreyes2 commented 4 years ago

@asreimer, that's great. Yes, by upgrading jedi to 0.17.2, the issue goes away.

asreimer commented 4 years ago

Added jedi 0.17.2 to #59. Closing issue.