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

Add config for updating max amount of table head layers #2436

Merged
merged 12 commits into from
Sep 23, 2022

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Sep 20, 2022

  • adds a config option for adjusting the max amount of table head rows

Demo

https://user-images.githubusercontent.com/43496356/191370315-9c752b6c-72a7-4610-ae98-89d3b218ddc7.mov

Screen.Recording.2022-09-22.at.4.49.36.PM.mov

Part of #2390

@julieg18 julieg18 self-assigned this Sep 20, 2022
@julieg18 julieg18 added the product PR that affects product label Sep 21, 2022
@julieg18 julieg18 changed the title Add command for updating max amount of table head layers Add config for updating max amount of table head layers Sep 21, 2022
extension/package.nls.json Outdated Show resolved Hide resolved
extension/src/experiments/columns/model.ts Outdated Show resolved Hide resolved
@@ -15,7 +15,7 @@ export const limitAncestorDepth = (
concatenated layer itself counts as one; because of this, we must subtract 3
from what we want the final layer count to be.
*/
const convertedLimit = limit - 3
const convertedLimit = (limit >= 3 ? limit : 3) - 3
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, this function only works correctly if the limit is at least 3. There's probably a way to rewrite the logic to allow for 1 or 2 layers though. Should this be done in a followup?

@julieg18 julieg18 marked this pull request as ready for review September 21, 2022 22:48
@julieg18 julieg18 requested a review from shcheklein September 21, 2022 22:51
@maxagin
Copy link
Contributor

maxagin commented Sep 22, 2022

  1. Can we update the max amount of table head layers without closing and reopening the extension?
  2. Again. It feels very much like hiding table columns, which are controlled in the sidebar. Do you see this suggestion as an option in the future?

Copy link
Contributor Author

@julieg18 julieg18 left a comment

Choose a reason for hiding this comment

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

Can we update the max amount of table head layers without closing and reopening the extension?

Fixed now! The table head layers will now update once you change the config without needing to restart :)

With some comments now resolved, I think we're ready for another round of reviews cc @mattseddon

extension/src/experiments/index.ts Show resolved Hide resolved
Copy link
Member

@mattseddon mattseddon left a comment

Choose a reason for hiding this comment

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

👍🏻

README.md Outdated
@@ -150,6 +150,7 @@ These are the VS Code [settings] available for the Extension:
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dvc.dvcPath` | Path or shell command to the DVC binary. Required unless Microsoft's [Python extension] is installed and the `dvc` package found in its environment. |
| `dvc.pythonPath` | Path to the desired Python interpreter to use with DVC. Required when using a virtual environment. |
| `dvc.expTableHeadMaxLayers` | Maximum amount of experiment table head rows (minimum is 3). |
Copy link
Member

Choose a reason for hiding this comment

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

[I] Change amount and layers to depth

Copy link
Member

Choose a reason for hiding this comment

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

Also, remember to remove minimum when you follow up.

extension/package.nls.json Outdated Show resolved Hide resolved
const convertedLimit = limit - 3
const collectedLimit =
Number(getConfigValue(ConfigKey.EXP_TABLE_HEAD_MAX_LAYERS)) ||
INITIAL_TABLE_HEAD_MAX_LAYERS
Copy link
Member

Choose a reason for hiding this comment

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

[C] We can probably get rid of INITIAL_TABLE_HEAD_MAX_LAYERS as the config value should never be undefined (default is 5).

Copy link
Member

Choose a reason for hiding this comment

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

The tests should

  1. Reflect the default if no value is provided.
  2. Test that changing the config value changes the header.
  3. Confirm that values of 0,1,2 do not break anything.

See

mockedGetConfigValue.mockReturnValueOnce(true)
for example of mocking config value.

When you follow up to add ability to concatenate to headers to 1 (i.e just leafs as per experiment table) 0 should be the setting for unlimited.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tests should

  1. Reflect the default if no value is provided.
  2. Test that changing the config value changes the header.
  3. Confirm that values of 0,1,2 do not break anything.

Completely forgot about updating the tests! Will update in a followup!

extension/src/experiments/index.ts Show resolved Hide resolved
@codeclimate
Copy link

codeclimate bot commented Sep 23, 2022

Code Climate has analyzed commit d7c1103 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 92.3% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.9%.

View more on Code Climate.

@julieg18 julieg18 merged commit 4ae0be9 into main Sep 23, 2022
@julieg18 julieg18 deleted the add-command-for-table-head-layers branch September 23, 2022 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants