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: allow the progress bars for reading ndjson to finish #315

Merged
merged 1 commit into from
May 28, 2024

Conversation

mikix
Copy link
Contributor

@mikix mikix commented May 21, 2024

There was an off by one error if the last character of the ndjson file was a newline. This prevented some "reading" progress bars from every appearing finished.

This was just cosmetic though - all data was read.

Checklist

  • Consider if documentation (like in docs/) needs to be updated
  • Consider if tests should be added

Comment on lines +80 to +81
# See https://docs.delta.io/latest/delta-storage.html for advice
# on which version of hadoop-aws to use.
Copy link
Contributor Author

@mikix mikix May 21, 2024

Choose a reason for hiding this comment

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

Unrelated, but I realized that 3.3.4 was kind of a magic number unless you knew where to look.

Comment on lines -240 to +238
if buf and buf[-1] != "\n": # catch a final line without a trailing newline
if buf and buf[-1] != ord("\n"): # catch a final line without a trailing newline
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I forgot that buf was binary - this check never worked as intended, ahem

There was an off by one error if the last character of the ndjson file
was a newline. This prevented some "reading" progress bars from every
appearing finished.

This was just cosmetic though - all data was read.
@@ -153,14 +153,12 @@ def write_json(path: str, data: Any, indent: int = None) -> None:


@contextlib.contextmanager
# pylint: disable-next = contextmanager-generator-missing-cleanup
Copy link
Contributor Author

@mikix mikix May 21, 2024

Choose a reason for hiding this comment

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

Unrelated, but also removed these disables - pylint fixed some false positives we were dealing with in their latest release: https://github.com/pylint-dev/pylint/releases/tag/v3.2.2

@mikix mikix merged commit 39e2ace into main May 28, 2024
3 checks passed
@mikix mikix deleted the mikix/fix-progress-bar branch May 28, 2024 13:40
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.

2 participants