Datatest

Latest version: v0.11.1

Safety actively analyzes 621924 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

0.11.1

-------------------

* Fixed validation and predicate handling of non-comparable objects.
* Fixed bug in normalization of Queries from `squint` package.
* Changed failure output to imporove error reporting with Pandas accessors.
* Changed predicate failure message to quote code objects using backticks.
* Fixed predicate and difference handling of uncomparable objects.

0.11.0

-------------------

* Removed deprecated decorators: skip(), skipIf(), skipUnless() (use
unittest.skip(), etc. instead).
* Removed deprecated aliases Selector and ProxyGroup.
* Removed the long-deprecated "allowed" interface.
* Removed deprecated acceptances: "specific", "limit", etc.
* Removed deprecated `Select`, `Query`, and `Result` API. Use **squint**
instead:
- https://pypi.org/project/squint/
* Removed deprecated `get_reader()` function. Use **get-reader** instead:
- https://pypi.org/project/get-reader/

0.10.0

-------------------

* Fixed bug where ValidationErrors were crashing pytest-xdist workers.

* Added tighter Pandas integration using Pandas' extension API.

After calling the new "register_accessors()" function, your existing
`DataFrame`, `Series`, `Index`, and `MultiIndex` objects will have
a validate() method that can be used instead of the validate()
function:

import padas as pd
import datatest as dt

dt.register_accessors() <- Activate Pandas integration.

df = pd.DataFrame(...)
df[['A', 'B']].validate((str, int)) <- New accessor method.

* Changed Pandas validation behavior:

* `DataFrame` and `Series`: These objects are treated as *sequences*
when they use a `RangeIndex` index (this is the default type
assigned when no index is specified). And they are treated as
*dictionaries* when they use an index of any other type--the
index values become the dictionary keys.

* `Index` and `MultiIndex`: These objects are treated as sequences.

* Changed `repr` behavior of Deviation to make timedeltas more readable.

* Added Predicate matching support for NumPy types `np.character`,
`np.integer`, `np.floating`, and `np.complexfloating`.

* Added improved NaN handling:

* Added NaN support to `accepted.keys()`, `accepted.args()`, and
`validate.interval()`.
* Improved existing NaN support for difference comparisons.
* Added how-to documentation for NaN handling.

* Added data handling support for `squint.Select` objects.

* Added deprecation warnings for soon-to-be-removed functions and classes:

* Added DeprecationWarning to `get_reader` function. This function
is now available from the **get-reader** package on PyPI:

https://pypi.org/project/get-reader/

* Added DeprecationWarning to `Select`, `Query`, and `Result` classes.
These classes will be deprecated in the next release but are now
available from the **squint** package on PyPI:

https://pypi.org/project/squint/

* Changed validate.subset() and validate.superset() behavior:

The semantics are now inverted. This behavior was flipped to more
closely match user expectations. The previous semantics were used
because they reflect the internal structure of datatest more precisely.
But these are implementation details that and they are not as important
as having a more intuitive API.

* Added temporary a warning when using the new subset superset methods
to alert users to the new behavior. This warning will be removed from
future versions of datatest.

* Added Python 3.9 and 3.10 testing and support.

* Removed Python 3.1 testing and support. If you were still using this
version of Python, please email me---this is a story I need to hear.

0.9.6

------------------

* Changed acceptance API to make it both less verbose and
more expressive:

* Consolidated specific-instance and class-based acceptances
into a single interface.
* Added a new accepted.tolerance() method that subsumes the
behavior of accepted.deviation() by supporting Missing and
Extra quantities in addition to Deviation objects.
* Deprecated old methods:

======================= ==================================
Old Syntax New Syntax
======================= ==================================
accepted.specific(...) accepted(...)
accepted.missing() accepted(Missing)
accepted.extra() accepted(Extra)
*NO EQUIVALENT* accepted(CustomDifferenceClass)
accepted.deviation(...) accepted.tolerance(...)
accepted.limit(...) accepted.count(...)
*NO EQUIVALENT* accepted.count(..., scope='group')
======================= ==================================

Other methods--accepted.args(), accepted.keys(), etc.--remain
unchanged.

* Changed validation to generate Deviation objects for a broader
definition of quantitative values (like datetime objects)--not
just for subclasses of numbers.Number.
* Changed handling for pandas.Series objects to treat them as
sequences instead of mappings.
* Added handling for DBAPI2 cursor objects to automatically
unwrap single-value rows.
* Removed acceptance classes from datatest namespace--these were
inadvertently added in a previous version but were never part
of the documented API. They can still be referenced via the
`acceptances` module::

from datatest.acceptances import ...

0.9.5

------------------

* Changed difference objects to make them hashable (can now be defined
as members of a set or used as dictionary keys).
* Added __slots__ to difference objects to reduce memory consumption.
* Changed name of Selector class to Select ("Selector" is now deprecated).
* Changed language and class names from "allowed & allowance" to
"accepted & acceptance" to bring datatest more inline with
manufacturing and engineering terminology. The existing "allowed"
API is now deprecated.

0.9.4

------------------

* Added Python 3.8 testing and support.
* Added new validate methods (moved from how-to recipes into core module):

* Added approx() method to require for approximate numeric equality.
* Added fuzzy() method to require strings by approximate match.
* Added interval() method to require elements within a given interval.
* Added set(), subset(), and superset() methods for explicit membership
checking.
* Added unique() method to require unique elements.
* Added order() method to require elements by relative order.

* Changed default sequence validation to check elements by index position
rather than checking by relative order.
* Added fuzzy-matching allowance to allow strings by approximate match.
* Added Predicate class to formalize behavior--also provides inverse-matching
with the inversion operator (~).
* Added new methods to Query class:

* Added unwrap() to remove single-element containers and return their
unwrapped contents.
* Added starmap() to unpack grouped arguments when applying a function
to elements.

* Fixed improper use of assert statements with appropriate conditional
checks and error behavior.
* Added requirement class hierarchy (using BaseRequirement). This gives
users a cleaner way to implement custom validation behavior and makes
the underlying codebase easier to maintain.
* Changed name of ProxyGroup to RepeatingContainer.
* Changed "How To" examples to use the new validation methods.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.