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

Restyle data viewer and add slice data panel #4805

Merged
merged 35 commits into from
Feb 23, 2021

Conversation

joyceerhl
Copy link
Contributor

@joyceerhl joyceerhl commented Feb 13, 2021

For #305
image

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • Has a news entry file (remember to thank yourself!).
  • Appropriate comments and documentation strings in the code.
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated.
  • Test plan is updated as appropriate.
  • package-lock.json has been regenerated by running npm install (if dependencies have changed).

@joyceerhl joyceerhl changed the title Restyle data viewer Restyle data viewer filtering and cells Feb 13, 2021
@codecov-io
Copy link

codecov-io commented Feb 13, 2021

Codecov Report

Merging #4805 (1c582ed) into main (b0ac45b) will increase coverage by 2%.
The diff coverage is 60%.

@@          Coverage Diff           @@
##            main   #4805    +/-   ##
======================================
+ Coverage     73%     76%    +2%     
======================================
  Files        407     401     -6     
  Lines      26816   26583   -233     
  Branches    3874    3854    -20     
======================================
+ Hits       19800   20306   +506     
+ Misses      5411    4671   -740     
- Partials    1605    1606     +1     
Impacted Files Coverage Δ
src/client/common/application/types.ts 100% <ø> (ø)
...cience/data-viewing/jupyterVariableDataProvider.ts 68% <ø> (ø)
src/client/datascience/data-viewing/types.ts 100% <ø> (ø)
src/client/datascience/types.ts 100% <ø> (ø)
...t/common/application/webviewPanels/webviewPanel.ts 69% <33%> (-4%) ⬇️
...rc/client/datascience/jupyter/debuggerVariables.ts 79% <40%> (-2%) ⬇️
src/client/datascience/data-viewing/dataViewer.ts 69% <70%> (-2%) ⬇️
src/client/datascience/jupyter/kernelVariables.ts 73% <100%> (+<1%) ⬆️
src/client/datascience/raw-kernel/rawSession.ts 53% <0%> (-4%) ⬇️
...lient/common/application/applicationEnvironment.ts 52% <0%> (-2%) ⬇️
... and 90 more

@joyceerhl joyceerhl changed the title Restyle data viewer filtering and cells Restyle data viewer filtering and cells and remove filter button Feb 16, 2021
@joyceerhl
Copy link
Contributor Author

Should probably give a courtesy heads up to the AML extension team that we're changing the dataset preview UI.

@joyceerhl joyceerhl changed the title Restyle data viewer filtering and cells and remove filter button Restyle data viewer and add slice data panel Feb 22, 2021
@joyceerhl joyceerhl marked this pull request as ready for review February 22, 2021 19:30
@joyceerhl joyceerhl requested a review from a team as a code owner February 22, 2021 19:30
@@ -0,0 +1,656 @@
@font-face {
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you copy this from somewhere? If so we need to add a license for it to the ThirdPartyRespository.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the seti icons that VS Code ships. Needed this for the language icon in the breadcrumbs at the top of the data viewer. This is the one that VS Code has: https://github.com/microsoft/vscode/blob/main/extensions/theme-seti/ThirdPartyNotices.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we add the license manually, or is there a component governance autogeneration step somewhere? And do we need to add it to both ThirdPartyNotices-Distribution as well as ThirdPartyNotices-Repository?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated Repository notice and manually added this dependency to AzDO CG

@@ -1914,6 +1914,7 @@
},
"dependencies": {
"@enonic/fnv-plus": "^1.3.0",
"@fluentui/react": "^7.160.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you actually using this? I thought you dropped it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to use this wherever I could, so yes I am using this in places where it was easier to reuse + override styles than it was to write my own.

Copy link
Contributor

Choose a reason for hiding this comment

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

yay for using fluentui/react.... its awesome..

@@ -68,6 +68,8 @@ export interface IDataFrameInfo {
maximumRowChunkSize?: number;
type?: string;
originalVariableType?: string;
name?: string;
fileName?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to have come comments. What's FileName here?
The rest seem to make sense, as they are associated with a variable.

// Results should be the updated variable.
return results
? {
...targetVariable,
...JSON.parse(results.result),
maximumRowChunkSize: MaximumRowChunkSizeForDebugger
maximumRowChunkSize: MaximumRowChunkSizeForDebugger,
fileName
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this the name of the file where the frame is. Not sure fileName is meaningful enough.
Initially i thought it could be the file path for a data frame (source where it was loaded from).
After looking at this code I now konw this is the file path from the frame.

Copy link
Contributor

Choose a reason for hiding this comment

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

I.e. i'd consider re-naming the property (still not clear why we need this & why its associated with the variable - hopefully i'll see this being used later in the code).

@@ -233,6 +264,8 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
const indexColumn = variable.indexColumn ? variable.indexColumn : 'index';
const originalVariableType = this.state.originalVariableType ?? variable.type;
const originalVariableShape = this.state.originalVariableShape ?? variable.shape;
const variableName = this.state.variableName ?? variable.name;
const fileName = this.state.fileName ?? variable.fileName;
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, its weird for a variable to have a file name. I'd prefer this to be sent as a separate entity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it really that weird though? The variable must've been declared somewhere. I think it should definitely be renamed but it doesn't seem that weird to me to have backingFileName or similar as an attribute associated with the variable info.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is weird, if you look at the debugger prototcol or others, variables are not attached to a file name. We have a file name that can contains a context & that context then contains a list of variables & that list contains the individual variable.
I.e. the mapping is at a much higher level & this seem wrong to me.
But don't want to block this PR for that.

I.e. the request object (sending request to kernel for variables) should already know the file name that is active.
Also if we're displaying variables for Notebooks, would we display the file name as some internal python file or the name of the notebook? Today run by line works in webview, if we use run by line & display the variables, what do you see in the file name (breadcrumb)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not worth blocking PR

Copy link
Contributor

Choose a reason for hiding this comment

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

But i'd test this with run by line & the others, not sure the name of the file would be as expected/required. I.e. in notebooks I'd always expect to see the name of the notebook if anything.

Copy link
Contributor Author

@joyceerhl joyceerhl Feb 23, 2021

Choose a reason for hiding this comment

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

The request we send to the kernel doesn't ask for the filename. The filename property is only included on the variable at the point when we send the variable info to the UI for display.

For webview notebooks the file name is the name of the notebook, e.g.
image. This is taken from notebook.identity.path.

For RBL I initially went with debugLocation because notebook.identity is not available when debugging a Python file, but this doesn't work for RBL, the filename would've been '<ipython input>'. Changed debuggerVariables.ts to use the notebook.identity.path when it's available (which it is for Run By Line), and use the debugLocation when it's not (i.e. debugging a Python file). Good catch :)

image

@@ -3,11 +3,26 @@
'use strict';

import * as React from 'react';
import { IIconProps, initializeIcons, SearchBox } from '@fluentui/react';

initializeIcons();
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought this needs to be done one place, if thats the case then I'd move it to the entry point of our UI (so that we dont' have multiples of these)

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 index.tsx, thanks!

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.

Everything looks ok, except for the fileName, not sure it should be part of the variable entity.
If anything I'd try to create a separate object that contains those two such as or similarl/better...

type StackVariable = {
	variabel: IDataVariable;
	stackFileName: string;
}

@joyceerhl
Copy link
Contributor Author

Made a couple more changes and fixes. Main difference is we are now generating a numeric (as opposed to guid) index column in the UI (as opposed to in our Python scripts) for all data, even if the data already contains an index column. This is to avoid breaking AML with the new filter button changes. AML preview datasets now look like this:

image

@joyceerhl joyceerhl merged commit b634a4d into main Feb 23, 2021
@joyceerhl joyceerhl deleted the joyceerhl/fix-dataviewer-styles branch February 23, 2021 22:31
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