v8.0.0
Backwards incompatible changes:
-
Remove
.data_frame.split_array_like: use upstreamdf.explode
instead. -
Rename
.data_frame.equalsto.data_frame.df_equals. -
Rename
.data_frame.assert_equalsto.data_frame.assert_df_equals. -
Rename
.series.equalsto.series.series_equals. -
Rename
.series.assert_equalsto.series.assert_series_equals. -
Remove
.series.split: use upstreamseries.explodeinstead. -
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 usepd.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 usingassert. If you do want
different reporting it would be better to define
pytest_assertrepr_compareinstead.-
Remove
assert_text_equals: useassert actual == expected -
Remove
assert_text_contains(whole, part):
useassert part in whole -
Remove
assert_matches(actual, pattern, flags=0):
useassert re.match(pattern, actual, flags) -
Remove
assert_search_matches(actual, pattern, flags=0):
useassert re.search(pattern, actual, flags) -
Remove
assert_lines_equal:
useassert 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.optionand.click.password_option: too project
specific. Copy it instead. -
Remove
.configuration.ConfigurationLoader: most projects can make do
with pyxdg'sload_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
.numpyto.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_multilineto.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_equalsto.xlsx_compare.assert_xlsx_equals -
Rename
.test.assert_xml_equalsto.xml_compare.assert_xml_equals