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

Fix Slack bot not displaying error messages #1068

Merged
merged 5 commits into from
Nov 1, 2023

Conversation

younesbelkada
Copy link
Contributor

What does this PR do?

As per title, the line nb_lines = sum(1 for _ in f) will loop over all the lines in the file and leading the next for loop to be empty

cc @BenjaminBossan

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 1, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

I think there is a logical error in how empty files are counted.

Also, I wonder what happens if there are several log files (can that happen?). In that case, empty_file will be determined by the last log file that is opened. What is the logical thing to do: Post a failure if any log file is empty, or only if all log files are empty?

@@ -26,8 +26,7 @@
total_num_failed += 1
else:
passed.append([test, duration, log.name.split('_')[0]])
if nb_lines == 0:
empty_file = True
empty_file = i == 0
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, when there is exactly one line,i would also be 0. How about inside of the loop, doing i += 1 instead of using enumerate?

@younesbelkada
Copy link
Contributor Author

I changed a bit the logic now, please let me know WDYT!

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Should be more robust now, thanks for fixing.

@younesbelkada younesbelkada merged commit 9da72d2 into main Nov 1, 2023
@younesbelkada younesbelkada deleted the younesbelkada-patch-3 branch December 18, 2023 10:01
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.

3 participants