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

[query] fix & improve pprint for hl.Struct #12901

Merged
merged 6 commits into from
Apr 28, 2023
Merged

Commits on Apr 18, 2023

  1. [query] fix & improve pprint for hl.Struct

    CHANGELOG: `hl.Struct` now has a correct and useful implementation of pprint.
    
    For structs with keys that were not identifiers, we produced incorrect `repr` output. For `pprint`,
    we just `pprint`'ed a dictionary (so you cannot even tell that the object was an `hl.Struct`). This
    PR:
    
    1. Fixes `hl.Struct.__str__` to use the kwargs or dictionary representation based on whether the
       keys are Python identifiers.
    2. Teaches `StructPrettyPrinter` to first try to `repr` the struct (this is what the default pretty
       printer does)
    3. Teaches `StructPrettyPrinter` to properly pretty print a struct as an `hl.Struct` preferring the
       kwarg representation when appropriate.
    4. Teaches `_same` to use pretty printing when showing differing records.
    danking committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    574dd20 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2023

  1. fix _same for globals

    danking committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    7cb8631 View commit details
    Browse the repository at this point in the history
  2. lints

    danking committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    8385ef8 View commit details
    Browse the repository at this point in the history
  3. bad syntax

    danking committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    978f822 View commit details
    Browse the repository at this point in the history
  4. simplify code a bit

    danking committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    d9f28db View commit details
    Browse the repository at this point in the history
  5. confusing verbiage

    danking committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    1cca22b View commit details
    Browse the repository at this point in the history