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

DM-40156: Some code cleanups #869

Merged
merged 31 commits into from
Jul 24, 2023
Merged

DM-40156: Some code cleanups #869

merged 31 commits into from
Jul 24, 2023

Commits on Jul 24, 2023

  1. Configuration menu
    Copy the full SHA
    401ac97 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bc3fc08 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1a89cb6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9682c12 View commit details
    Browse the repository at this point in the history
  5. Appease bugbear B023 by binding the loop parameters

    This does not affect the tests because these functions are
    used immediately inside the loop.
    timj committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    53790c7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9e85579 View commit details
    Browse the repository at this point in the history
  7. Use contextlib.suppress

    timj committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    0dead7f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    de90c3c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7279cf8 View commit details
    Browse the repository at this point in the history
  10. Invert ternary logic

    a = x if x else y
    
    instead of
    
    a = y if not x else x
    timj committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    aaf37a2 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    fe4fda0 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    3aea3ec View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    3531ab6 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    266519d View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    ad214ac View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    f1117af View commit details
    Browse the repository at this point in the history
  17. Replace some nested with statements

    Keep ones involving assertRaises and assertWarns since then
    it is easier to see the separation between the test code and
    the code being tested.
    timj committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    df781a5 View commit details
    Browse the repository at this point in the history
  18. Change warnings.warn to a print for the command-line user

    warnings.warn has too much other information that is irrelevant
    to the user of the command-line tool.
    timj committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    fa22b48 View commit details
    Browse the repository at this point in the history
  19. Add explicit stacklevel to warnings

    The test code doesn't really need it but it doesn't hurt and
    it makes it easier to find warnings in the future that lack
    the stacklevel.
    timj committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    59fe2e9 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    2fd8cbc View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    c935f7a View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    474b9fb View commit details
    Browse the repository at this point in the history
  23. Raise AssertionError rather than assert False

    assert can be removed as a no-op depending on how python is run.
    timj committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    579ac77 View commit details
    Browse the repository at this point in the history
  24. Use loop variable in test

    timj committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    2f89f27 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    e12e27e View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    448ffde View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    2ea7bba View commit details
    Browse the repository at this point in the history
  28. Remove lru_cache on method

    lru_cache on methods doesn't work properly. Furthermore if we
    need to cache the collection type we should be caching it
    elsewhere inside registry.
    timj committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    a5d79c4 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    aa637db View commit details
    Browse the repository at this point in the history
  30. Use "a or b" not "a if a else b"

    timj committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    3c84fee View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    05bb4df View commit details
    Browse the repository at this point in the history