-
Notifications
You must be signed in to change notification settings - Fork 293
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
Sort variables by name in variable explorer WITH test added. #5886
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5886 +/- ##
=====================================
- Coverage 72% 72% -1%
=====================================
Files 405 405
Lines 27198 27204 +6
Branches 3972 3975 +3
=====================================
- Hits 19620 19608 -12
+ Misses 5947 5940 -7
- Partials 1631 1656 +25
|
return (a[sortColumn] > b[sortColumn]) ? 1 : -1; | ||
} | ||
}; | ||
result.pageResponse.sort(comparer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't going to work. It's only sorting a single page at a time. The page retrieved might even be the wrong one.
Imagine you had 10,000 variables, let's say with names like:
A1
A2
A3
.
.
B1
B2
B3
.
And you fetched the first page. It will return the A1 page. You then sort descending. It still fetch the first page, you'll just have that page sorted descending, but what the user wanted to see was the Z900 to Z800 set of variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to push the sorting all the way into the python code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And that's rather complicated because it requires reworking how variables are fetched (we only fetch names and then with a separate request we fetch types).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, I see where I went wrong. Thanks for all your input :)
I shall try again
959b7ac
to
50c3a9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏲️
I think here
I think the request there is going to change. You won't be getting the list of names, but instead getting all of the data for a page at a time from the server. Some piece of python code that will:
You might be able to do this instead (I'm not 100% sure this will work)
|
50c3a9d
to
4ef94f9
Compare
Co-authored-by: Ian Huff <ianhuff@lcs2d-Dell-04.northamerica.corp.microsoft.com>
7d3d0cb
to
0f9aea2
Compare
Looks great to me. Will you do type in a subsequent PR? Seems like a good idea. |
Yeah, I'm gonna try to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Maybe next step on this we should add a test for this in our CI.
@IanMatthewHuff I added a test for it on this PR. |
I believe you have linting errors. If you look at the linting task it should tell you what the problem is. Alternatively if you install ESLint in VS Code and give it permission to run, it should catch the errors when you save a file locally. |
It looks like the linting error is this:
That means in our .eslintrc file you have to remove We didn't start using eslint until somewhat recently and some of the files were skipped as we didn't want to fix all eslint errors at once. As we edit them the build task makes sure the linter will run on newly edited files. After you fix the ignore problem, you might have to fix linter errors in that file too. |
@DavidKutu @IanMatthewHuff @joyceerhl Are those errors expected now? I believe they were some sort of kernel finding problem which shouldn't have been caused by @vandyliu's changes. |
The local notebook failures seem new. I'm not seeing those fail on the latest main run or on the latest PR run from 1hr ago. Try rerunning? |
@rchiodo The one failure in nonConda remote notebook was expected. The failure in nonConda 'local' was not expected from what I had last seen. |
The nonConda local errors seem unrelated. They were already fixed but I guess something might've broken them again. Please try merging main here to see if they still fail. |
For #4585
10,000 variables test
Attempt 3
Will try to add 'type' column to be sortable afterwards
package-lock.json
has been regenerated by runningnpm install
(if dependencies have changed).