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: Remove duplicated content in error messages #8107

Merged
merged 14 commits into from
Feb 7, 2024

Commits on Feb 6, 2024

  1. Removed duplicated content in error messages

    Prevented exponential growth of error messages by avoiding nesting of error messages
    Instead, used a counter to track how many operations had been applied to a LazyFrame after an error
    Renamed `ErrorState` to `ErrorStateEncounters` and made it crate-private
    Renamed `ErrorStateSync` to `ErrorState` and removed its Deref impl so that the only way to access its data is through (crate-private) accessors, thus reducing the size of its public API
    rben01 committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    85bae1a View commit details
    Browse the repository at this point in the history
  2. Improved formatting of ErrorState to avoid exponential growth of back…

    …slashes in output
    
    Minor cleanup + commenting
    rben01 committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    38310d7 View commit details
    Browse the repository at this point in the history
  3. Removed duplicated content in error messages

    Prevented exponential growth of error messages by avoiding nesting of error messages
    Instead, used a counter to track how many operations had been applied to a LazyFrame after an error
    Renamed `ErrorState` to `ErrorStateEncounters` and made it crate-private
    Renamed `ErrorStateSync` to `ErrorState` and removed its Deref impl so that the only way to access its data is through (crate-private) accessors, thus reducing the size of its public API
    rben01 committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    4204ab0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    af4f778 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c76729a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f51b7af View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f850f3f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1887688 View commit details
    Browse the repository at this point in the history
  9. Fixed formatting issues

    rben01 committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    1ef40a9 View commit details
    Browse the repository at this point in the history
  10. Improved ErrorState::take() logic

    Instead of leaving a `String` in place of `PolarsError`, leave in place
    the original `PolarsError`. Then, when it's time to produce a new error,
    we clone the original error if possible; and it's almost always
    possible, as all `PolarsError` variants contain ErrString as their data
    except one: `Io`. So just convert `Io` to `ComputeError` with an error
    message saying so, otherwise reuse the `PolarsError` variant with a
    cloned message. (This is based off, and utilizes, the method
    `PolarsError::wrap_msg`.)
    
    This way we can retain the "shape" of the original error and just
    augment its message to indicate that it's already failed n times.
    
    Also cleaned up the `err_msg.rs` test in anticipation of adding a bit
    more to that file.
    rben01 committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    6a103e8 View commit details
    Browse the repository at this point in the history
  11. Simplified implementation of error reporting

    Now that errors aren't taken and replaced by a String - the original is
    stored and cloned as needed - we can simplify the implementation.
    Instead of NotYetEncountered and AlreadyEncountered, we can just have a
    single struct with a counteer (no enum needed). This massively
    simplifies the implementation
    Also, simplified the implemtnation of tests
    Also cleaned up ErrorState's Debug implementation so that users don't
    see the nuts and bolts inside the struct - they only see the important
    debugging info
    rben01 committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    7058c89 View commit details
    Browse the repository at this point in the history
  12. Removed unused import

    rben01 committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    4a4283e View commit details
    Browse the repository at this point in the history
  13. Add test

    stinodego committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    dcb4fe0 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2024

  1. Swapped order of elements in "already failed" error message to improv…

    …e display of Python error messages
    rben01 committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    1f9b933 View commit details
    Browse the repository at this point in the history