Skip to content
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 & minor cleanup of kernel finder #5824

Merged
merged 14 commits into from
May 11, 2021
Merged

Fixes & minor cleanup of kernel finder #5824

merged 14 commits into from
May 11, 2021

Conversation

DonJayamanne
Copy link
Contributor

@DonJayamanne DonJayamanne commented May 10, 2021

Fix to address a broken test
(tough when CI is busted)

if (r.kind !== 'connectToLiveKernel' && r.kernelSpec) {
if (
r.kernelSpec.metadata?.vscode?.extension_id &&
this.extensions.getExtension(r.kernelSpec.metadata?.vscode?.extension_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to a common location (localKernelFinder.ts)

@codecov-commenter
Copy link

codecov-commenter commented May 10, 2021

Codecov Report

Merging #5824 (20b6a14) into main (e4f580b) will decrease coverage by 8%.
The diff coverage is 62%.

❗ Current head 20b6a14 differs from pull request most recent head ef0c4fb. Consider uploading reports for the commit ef0c4fb to get more accurate results

@@           Coverage Diff           @@
##            main   #5824     +/-   ##
=======================================
- Coverage     72%     63%     -9%     
=======================================
  Files        403     403             
  Lines      26946   26953      +7     
  Branches    3932    3933      +1     
=======================================
- Hits       19425   17037   -2388     
- Misses      5889    8503   +2614     
+ Partials    1632    1413    -219     
Impacted Files Coverage Δ
.../datascience/notebook/notebookControllerManager.ts 25% <ø> (-58%) ⬇️
...t/datascience/kernel-launcher/localKernelFinder.ts 77% <50%> (-4%) ⬇️
src/client/datascience/jupyter/kernels/helpers.ts 71% <83%> (+<1%) ⬆️
.../datascience/jupyter/kernels/cellExecutionQueue.ts 10% <0%> (-79%) ⬇️
...ience/variablesView/variableViewMessageListener.ts 22% <0%> (-78%) ⬇️
...ent/common/application/webviewViews/webviewView.ts 14% <0%> (-72%) ⬇️
...t/datascience/notebook/vscodeNotebookController.ts 10% <0%> (-69%) ⬇️
src/client/datascience/notebook/remoteSwitcher.ts 24% <0%> (-68%) ⬇️
src/client/datascience/jupyter/kernels/kernel.ts 9% <0%> (-65%) ⬇️
...lient/datascience/jupyter/kernels/cellExecution.ts 6% <0%> (-65%) ⬇️
... and 145 more

@DonJayamanne DonJayamanne changed the title WIP Fixes to kernel finder May 10, 2021
score = 1;
}
// Give python 3 environments a higher priority over others.
// E.g. if we end up just looking at the suppof ot ehe languages, then Python2 & Python3 will both get 1.
// But Python 3 is definitely preferred over Python 2.
if (
speclanguage === PYTHON_LANGUAGE &&
nbMetadataLanguage === PYTHON_LANGUAGE &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was wrong

@@ -471,14 +471,19 @@ export function findPreferredKernel(
}

// Find a kernel spec that matches the language in the notebook metadata.
if (score <= 0 && speclanguage === (nbMetadataLanguage || '')) {
if (score <= 0 && nbMetadataLanguage && speclanguage === (nbMetadataLanguage || '')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect, we need to ensure we have a language, else we match anything that doesnt' have a language or for those where it cannot be determined.

@DonJayamanne DonJayamanne marked this pull request as ready for review May 10, 2021 23:52
@DonJayamanne DonJayamanne requested a review from a team as a code owner May 10, 2021 23:52
@DonJayamanne DonJayamanne changed the title Fixes to kernel finder Fixes & minor cleanup of kernel finder May 10, 2021
@DonJayamanne DonJayamanne merged commit a100c9f into main May 11, 2021
@DonJayamanne DonJayamanne deleted the fixesToCI branch May 11, 2021 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants