Yamlpath

Latest version: v3.8.2

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

Scan your dependencies

Page 1 of 9

3.8.2

Enhancements:
* The MergerConfig class now accepts overrides for config values as "keys" and
"rules" keyword arguments to the constructor.
Credit and my thanks go to https://github.com/leviem1!

BREAKING CHANGES:
* Support for Python 3.6 has been dropped. This is forced by incompatibilities
discovered with the latest version of pytest and because dependencies like
dateutil and ruamel-yaml-clib no longer support Python 3.6. Support for
Python 3.7 is tepid. While pytest is still working with Python 3.7, other
dependencies are no longer supporting Python 3.7; however, the extensive
tests for yamlpath show no issues with them, so far. For now, Python 3.12
support is pending, waiting for the dateutil library to resolve a
DeprecationWarning regarding its use of datetime.datetime.utcfromtimestamp().

3.8.1

Bug Fixes:
* Fixed issue 220 reported by https://github.com/abramov-oleg wherein novel
mergeat paths given to the yaml-merge tool with Array and Array-of-Hash data
in the RHS document would cause an interminable loop that would max out CPU
and eventually exhaust RAM.

3.8.0

Enhancements:
* The yaml-set and yaml-merge command-line tools now support a new option:
--json-indent/-J. This applies only to JSON output. By default, JSON
documents are written/printed as single-line documents. This new option
enables users to vertically expand JSON output with a specified indentation
size for nest levels.
* Additional *YAMLPathExceptions have been added to increase the specificity of
various error conditions. You do not need to change any of your code as a
result of this change; all new exceptions are subclasses of the original
YAMLPathException. The new exceptions include:
* UnmatchedYAMLPathException: No matching nodes
* DuplicateKeyYAMLPathException: Duplicate key creation attempted
* TypeMismatchYAMLPathException: Data Type mismatch
* BadAliasYAMLPathException: Anchor/Alias/YMK error
* NoDocumentYAMLPathException: Attempt to delete the entire document
* RecursionYAMLPathException: Recursion nesting error
* The Processor class now enables consumers to verify whether a YAMLPath would
resolve to at least one node in the present document. The result is a simple
Boolean (True when the path resolves; False, otherwise). The document is not
modified by this test. See: Processor.exists(yaml_path)

Bug Fixes:
* Pursuant to the addition of the intersection operator (&) added in 3.7.0, the
text of one of the YAMLPathExceptions has been updated:
Former:
Adjoining Collectors without an operator has no meaning; try + or -
between them, {yaml_path}
New:
Adjoining Collectors without an operator has no meaning; try +, -, or &
between them, {yaml_path}

3.7.0

Enhancements:
* Support for Python 3.11 has been added.
* A new Search Keyword has been added, [unique([NAME])]. This operates against
collections to return only values which have no duplicates within the
collection; i.e.: [1, 2, 2, 3] has unique values, [1, 3]. The NAME argument
is required when operating against Hashes (maps/dicts) and Arrays-of-Hashes
(sequences/lists of maps/dicts) to identify which field/property to evaluate
for uniqueness. This can be inverted to return only results which are
duplicated within the collection.
* A new Search Keyword has been added, [distinct([NAME])]. This operates
against collections to return exactly one of every value within the
collection, discarding duplicates; i.e.: [1, 2, 2, 3] has distinct values,
[1, 2, 3]. The NAME argument is required when operating against Hashes
(maps/dicts) and Arrays-of-Hashes (sequences/lists of maps/dicts) to identify
which field/property to evaluate for uniqueness. This cannot be inverted.
* Added a new Collector Math Operator: & (intersection)
As in set mathematics, this yields only elements of two collections which are
common to both collections. Unlike set mathematics, collections allow
duplicate elements. If you need to enforce distinctness of the intersected
results, use the [distinct([NAME])] Search Keyword against the collected
result, as in `((list1)&(list2))[distinct([NAME])]`.

Bug Fixes:
* A typographical error in yamlpath.enums has been corrected with backward-
compatible adapters in place to support both the correct and incorrect
spelling of PathSeparators (formerly PathSeperators). If the PathSeperators
version appears in your own code, please update to the new spelling. The
incorrectly spelled version of this enumeration is now deprecated and will be
removed in a future release. Thanks go entirely to
https://github.com/AndydeCleyre for working so hard to submit this fix!
* Processor.get_nodes would emit a nonobvious error message when mustexist is
left at its default value (False) and yaml_path contained ** or * segments.
Now, these segment types are excluded from generating "missing" nodes; only
nodes which exist can be matched by * and **. Credit and my thanks go to
https://github.com/gdubicki for discovering and reporting this issue.

3.6.9

Enhancements:
* Partial support for updating bare Python dict and Python's native
collections.OrderedDict data structures was removed in version 3.6.8 because
compatible YAML/EYAML/JSON data never presented as these data types and if
anyone ever attempted to update a key by reference in a dict or
collections.OrderedDict, it would cause a Python stack dump due to neither
supporting the required insert method, which is provided only by ruamel.yaml.
This version not only restores this capability, but also solves the issue of
missing support for the insert logic, where applicable. It also adds support
for the ruamel.yaml.compat.ordereddict type. Thanks to
https://github.com/tsinggggg for requesting this feature be added!

3.6.8

Bug Fixes:
* Changes to format and value of child nodes under Anchored Hashes (maps/dicts)
caused unexpected expansion of the same key-value pair wherever a YAML Merge
Key Aliased the affected Anchored Hash. Thanks to
https://github.com/hemnstill for finding and reporting this issue!

Enhancements:
* Support for Python 3.10 has been added, thanks to https://github.com/mechie!

Page 1 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.