Skip to content

Conversation

@daavoo
Copy link
Contributor

@daavoo daavoo commented Jan 13, 2022

_extend_row did not consider partially empty items, which can occur when metris or params are renamed between commits.

Fixes #7070

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

@daavoo daavoo requested a review from a team as a code owner January 13, 2022 19:12
@daavoo daavoo requested a review from skshetry January 13, 2022 19:12
@daavoo daavoo changed the title exp show: handle renaming of metrics/params. exp show: handle extending/renaming of metrics/params. Jan 13, 2022
@daavoo daavoo force-pushed the issue-7070 branch 3 times, most recently from ea09084 to 27a4ce2 Compare January 19, 2022 15:09
@daavoo daavoo added the bugfix fixes bug label Jan 26, 2022
@daavoo daavoo requested a review from karajan1001 January 28, 2022 11:56
Comment on lines +68 to +70
all_headers,
metric_headers,
param_headers,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be possible to just use TabularData.row_from_dict() here? The parameters are getting complicated here.

Copy link
Contributor Author

@daavoo daavoo Feb 9, 2022

Choose a reason for hiding this comment

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

Tried adding a change using row_from_dict but it only saves us from passing all_headers.

Unfortunately, we still need metric_headers and param_headers later in this function because of the bug being fixed.

The overall handling of metrics and params could be simplified but feels out of the scope of this fix.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense. Thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should simplify these parameters soon though, as it is getting complicated as exp show is becoming complex.
May get more confusing in the future. Anyway, thanks for looking into it. πŸ™‚

Comment on lines +138 to +146
row_dict["Experiment"] = exp.get("name", "")
row_dict["rev"] = name_rev
row_dict["typ"] = typ
row_dict["Created"] = _format_time(
exp.get("timestamp"), fill_value, iso
)
row_dict["parent"] = parent
row_dict["State"] = state
row_dict["Executor"] = exp.get("executor", fill_value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Now this requires us to keep headers in sync in two places. (we did that before by forcing an order anyway though).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true but, as you mentioned, the sync was required before. By using dict keys, at least the sync is explicit (and prevents bug being fixed)

@karajan1001
Copy link
Contributor

Need to rebase it.

_extend_row did not considered partially empty `items`, which can occur when metris or params are renamed between commits.

Fixes #7070
Comment on lines +138 to +146
row_dict["Experiment"] = exp.get("name", "")
row_dict["rev"] = name_rev
row_dict["typ"] = typ
row_dict["Created"] = _format_time(
exp.get("timestamp"), fill_value, iso
)
row_dict["parent"] = parent
row_dict["State"] = state
row_dict["Executor"] = exp.get("executor", fill_value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a nitpicky suggestion, what do you think of using row_dict.update() here? I'm okay with how it is as well though.

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 you mean like the following?

Suggested change
row_dict["Experiment"] = exp.get("name", "")
row_dict["rev"] = name_rev
row_dict["typ"] = typ
row_dict["Created"] = _format_time(
exp.get("timestamp"), fill_value, iso
)
row_dict["parent"] = parent
row_dict["State"] = state
row_dict["Executor"] = exp.get("executor", fill_value)
row_dict.update(
Experiment=exp.get("name", ""),
rev=name_rev,
typ=typ,
Created=_format_time(
exp.get("timestamp"), fill_value, iso
),
parent=parent,
State=state,
Executor=exp.get("executor", fill_value)
)

No strong preference, is update more efficient or is there another reason?

Copy link
Collaborator

@skshetry skshetry Feb 9, 2022

Choose a reason for hiding this comment

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

@daavoo, I meant it more like following, to use dict arg than as kwargs:

row_dict.update({
    "Experiment": exp.get("name", ""),
    "rev": name_rev,
    "typ": typ,
    "Created": _format_time(exp.get("timestamp"), fill_value, iso),
    "parent": parent,
    "State": state,
    "Executor": exp.get("executor", fill_value),
    ...
})

It's a matter of personal preference, I guess. As I said, I am fine as-is too.

@daavoo daavoo merged commit d89555c into main Feb 9, 2022
@daavoo daavoo deleted the issue-7070 branch February 9, 2022 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix fixes bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dvc exp show's table: shifts params values to metrics columns after renaming metrics file

3 participants