Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

v8.0.0

Choose a tag to compare

@hannahdiels hannahdiels released this 25 Mar 18:56
· 11 commits to master since this release

Backwards incompatible changes:

  • Remove .data_frame.split_array_like: use upstream df.explode
    instead.

  • Rename .data_frame.equals to .data_frame.df_equals.

  • Rename .data_frame.assert_equals to .data_frame.assert_df_equals.

  • Rename .series.equals to .series.series_equals.

  • Rename .series.assert_equals to .series.assert_series_equals.

  • Remove .series.split: use upstream series.explode instead.

  • Remove .data_frame.replace_na_with_none: float columns would become the
    less efficient dtype=object if you used None instead of nan. While
    bool(np.nan) != bool(None), you can use pd.isna(value) and
    pd.notna. In cases where None/np.nan do cause trouble downstream you
    could make things consistent by replacing None with nan
    df.fillna(np.nan) though likely you'll prefer some value more specific
    to what you're doing e.g. df.replace(np.nan, ''); which replaces any NA
    value, including None.

  • Remove .logging.configure: too project specific. Use logging directly
    instead.

  • Remove .logging.set_level: only 1 or so project still uses this, just
    inline it into the project.

  • Remove .test.reset_loggers: either mock anything that configures logging
    or when testing a CLI, call it in a subprocess. It might not be a problem
    anymore with today's pytest caplog.

  • Remove some .test.assert*. Usually the default pytest reporting for
    these is good enough when straight up using assert. If you do want
    different reporting it would be better to define
    pytest_assertrepr_compare instead.

    • Remove assert_text_equals: use assert actual == expected

    • Remove assert_text_contains(whole, part):
      use assert part in whole

    • Remove assert_matches(actual, pattern, flags=0):
      use assert re.match(pattern, actual, flags)

    • Remove assert_search_matches(actual, pattern, flags=0):
      use assert re.search(pattern, actual, flags)

    • Remove assert_lines_equal:
      use assert tuple(actual) == tuple(expected)

  • Remove .test.assert_dir_equals: too project specific / inflexible, e.g.
    do you care about line order in files or just want hashes to match...
    better to compare the contents yourself as then you can pick the right
    assert for ways to compare files. Copy it to your project instead.

  • Remove .test.assert_file_mode: too project specific. Copy it instead.

  • Remove .test.assert_file_equals: too project specific. Copy it instead.

  • Remove .algorithms.multiway_partitions: copy it instead.

  • Remove .algorithms.toset_from_tosets: copy it instead.

  • Remove .click.option and .click.password_option: too project
    specific. Copy it instead.

  • Remove .configuration.ConfigurationLoader: most projects can make do
    with pyxdg's load_first_config, so no inheritance and the config does
    not provide defaults for the CLI. If you do need this, you can probably
    find a different library that does something similar or copy the old code.

  • Remove .debug.pretty_memory_info: can probably be found in some other
    library or use a proper memory profiler.

  • Remove .dict.pretty_print_head: too trivial, copy it instead.

  • Remove .dict.DefaultDict: probably can be found elsewhere.

  • Remove .dict.invert: might find it in some other library, probably
    better redesign your algorithm to avoid needing this in the first place.

  • Remove .multi_dict.MultiDict: can be found in other libraries.

  • Remove .difflib.line_diff: too project specific, copy it if you need
    that specific behaviour or use difflib directly or find a 3rd party
    library.

  • Remove .exceptions.exc_info: too trivial, copy it into your project if
    needed

  • Remove .exceptions.UserException: too project specific.

  • Remove .exceptions.InvalidOperationError: too project specific.

  • Remove .hashlib.base85_digest: too trivial, just copy it.

  • Remove .iterable.is_sorted: surely this already exists in
    more_itertools, toolz.itertoolz or something.

  • Rename .numpy to .typing

  • Remove .parse.tsv, .parse.csv: too project specific, copy it.

  • Remove .path.sorted_lines: too project specific, copy it.

  • Remove .sqlalchemy.log_sql: too trivial, copy it.

  • Remove .sqlalchemy.pretty_sql: too trivial, copy it.

  • Remove .write.tsv, .write.csv: too project specific, copy it.

  • Rename .various.join_multiline to .various.join_lines

  • Remove .pkg_resources.resource_path: Replace with importlib.resources.path instead. For python<3.7, first install importlib_resources.

  • Remove .pkg_resources.resource_copy: this broke on python 3.8 (or
    earlier), it could be reimplemented with importlib.resources or better yet
    you could store a zip/tgz to avoid needing to copy a dir.

  • Rename .test.assert_xlsx_equals to .xlsx_compare.assert_xlsx_equals

  • Rename .test.assert_xml_equals to .xml_compare.assert_xml_equals