Skip to content

Conversation

joyceerhl
Copy link
Contributor

Fix #7156

We were previously only incrementing the executionCounts for interactive cells submitted from a Python file. Need to do this for cells submitted from the interactive window input box too. No news entry because this was caused by 2b3fdb7, which was checked in between stable releases

@joyceerhl joyceerhl requested a review from a team as a code owner August 23, 2021 23:54
@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2021

Codecov Report

Merging #7245 (23212ee) into main (b1475c7) will increase coverage by 2%.
The diff coverage is 62%.

❗ Current head 23212ee differs from pull request most recent head 0cd3170. Consider uploading reports for the commit 0cd3170 to get more accurate results

@@          Coverage Diff           @@
##            main   #7245    +/-   ##
======================================
+ Coverage     62%     64%    +2%     
======================================
  Files        360     360            
  Lines      22541   22520    -21     
  Branches    3400    3399     -1     
======================================
+ Hits       14064   14611   +547     
+ Misses      7303    6613   -690     
- Partials    1174    1296   +122     
Impacted Files Coverage Δ
...ence/interactive-window/nativeInteractiveWindow.ts 5% <0%> (+<1%) ⬆️
src/client/datascience/jupyter/kernels/kernel.ts 64% <50%> (-1%) ⬇️
...eractive-window/nativeInteractiveWindowProvider.ts 41% <100%> (+6%) ⬆️
...ient/datascience/jupyter/kernels/kernelProvider.ts 95% <100%> (+<1%) ⬆️
src/client/common/cancellation.ts 72% <0%> (-4%) ⬇️
...ience/kernel-launcher/localKernelSpecFinderBase.ts 79% <0%> (-3%) ⬇️
.../datascience/notebook/notebookControllerManager.ts 84% <0%> (-2%) ⬇️
...t/datascience/notebook/vscodeNotebookController.ts 78% <0%> (-2%) ⬇️
src/client/datascience/dataScienceSurveyBanner.ts 54% <0%> (-2%) ⬇️
src/client/datascience/baseJupyterSession.ts 62% <0%> (+<1%) ⬆️
... and 33 more

@@ -136,6 +138,9 @@ export class Kernel implements IKernel {
public async executeCell(cell: NotebookCell): Promise<void> {
const stopWatch = new StopWatch();
const notebookPromise = this.startNotebook({ disableUI: false, document: cell.notebook });
if (cell.notebook.notebookType === InteractiveWindowView) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a very weird pr, no part of the code makes me think that any of these changes will update the execution count
My only guess is that when we add a cell using the cell hash provided it's a real Block of code, else it's treated as silent and we end up with no execution count.

Is that right?
If that's the case then cell hash provided does a whole lot more than it seems to.
No need to change this, but I would have never guessed, and to me is a pretty weird way to wire things up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah the executionCount is state that's maintained inside the cellHashProvider. I agree that it's pretty opaque. FWIW, this used to be done in an INotebookExecutionLogger, I think my change to explicitly call addCellHash made it more explicit that the cellHashProvider is getting called, so the code now scans funny.

Copy link
Contributor

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

.

@joyceerhl joyceerhl merged commit ee9cd7b into main Aug 24, 2021
@joyceerhl joyceerhl deleted the dev/joyceerhl/execution-count branch August 24, 2021 02:03
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.

Running code from the interactive window input box causes ipython-input temp file to open for debugging
3 participants