Skip to content

Conversation

@daavoo
Copy link
Contributor

@daavoo daavoo commented Aug 19, 2022

Closes #8020

This was a regression introduced in #7712.
Calling repo.metrics.show from a subdir stopped returning metrics because fs.isfile(metric) check returned false.

@daavoo daavoo requested a review from efiop August 19, 2022 15:34
@daavoo daavoo self-assigned this Aug 19, 2022
@daavoo daavoo marked this pull request as ready for review August 19, 2022 15:35
@daavoo daavoo requested a review from a team as a code owner August 19, 2022 15:35
@daavoo daavoo force-pushed the metrics-show-subdir branch from 4a9d636 to 69060f5 Compare August 19, 2022 15:41
@dberenbaum
Copy link
Contributor

Does it fix #8020?

@daavoo
Copy link
Contributor Author

daavoo commented Aug 19, 2022

Does it fix #8020?

It does 😄 . I didn't notice that issue. I found the bug researching a discord question

@daavoo daavoo requested a review from pared August 22, 2022 18:31

res = {}
for metric in metrics:
rel_metric_path = os.path.join(relpath, *fs.path.parts(metric))
Copy link
Contributor

Choose a reason for hiding this comment

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

fs.path.join? As I recall one of the problems is windows behavior. dvcfs utlizizes posixpath.

Copy link
Contributor Author

@daavoo daavoo Aug 24, 2022

Choose a reason for hiding this comment

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

Um. Some unit tests are failing with fs.path.join.
os.path.join did solve the original issue.
@pared I wonder if this would be a breaking change for windows 🤔 (and potentially vscode?) as we would be changing the returned path format. So anything relying on json output would get different keys after this merge

Copy link
Contributor

Choose a reason for hiding this comment

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

My bad, metrics results are relying on os specific paths. I wonder if that won't be problematic in the future. In plots we are heavily relying on fs.path. This is inconsistent, we might need to consider unifying it at some point.

@daavoo daavoo force-pushed the metrics-show-subdir branch from 69060f5 to 86df4da Compare August 24, 2022 08:37
@daavoo daavoo requested a review from pared August 24, 2022 08:38
@daavoo daavoo force-pushed the metrics-show-subdir branch from 86df4da to 6f0e562 Compare August 24, 2022 08:38
@daavoo daavoo force-pushed the metrics-show-subdir branch 2 times, most recently from 86df4da to fb5ac28 Compare August 24, 2022 09:21
@daavoo daavoo enabled auto-merge (rebase) August 24, 2022 09:22
@daavoo daavoo force-pushed the metrics-show-subdir branch from fb5ac28 to ccc3209 Compare August 25, 2022 09:52
@daavoo daavoo removed the request for review from efiop August 25, 2022 10:29
This was a regression introduced in #7712.
Calling `repo.metrics.show` from a subdir stopped returning metrics because `fs.isfile(metric)` check returned false.
@daavoo daavoo force-pushed the metrics-show-subdir branch from ccc3209 to 5241c63 Compare August 25, 2022 10:29
@daavoo daavoo merged commit e815bbe into main Aug 25, 2022
@daavoo daavoo deleted the metrics-show-subdir branch August 25, 2022 11:02
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 metrics show doesn't output anything when called from a subdirectory of the repository

3 participants