Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-jsonpath-ng for openSUSE:Factory checked in at 2021-11-03 17:26:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-jsonpath-ng (Old) and /work/SRC/openSUSE:Factory/.python-jsonpath-ng.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jsonpath-ng" Wed Nov 3 17:26:22 2021 rev:2 rq:928964 version:1.5.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-jsonpath-ng/python-jsonpath-ng.changes 2021-05-01 00:46:56.079388938 +0200 +++ /work/SRC/openSUSE:Factory/.python-jsonpath-ng.new.1890/python-jsonpath-ng.changes 2021-11-03 17:27:18.205371269 +0100 @@ -1,0 +2,12 @@ +Wed Nov 3 08:28:31 UTC 2021 - [email protected] + +- version update to 1.5.2 + * Merge pull request #41 from josephwhite13/allow-dictionary-filtering + * Merge pull request #48 from back2root/master + * Check for null value. + * Merge pull request #40 from memborsky/add-regular-expression-contains-support + * feat: support regular expression for performing contains (=~) filtering + * if datum.value is a dictionary, filter on the list of values +- %check: use python -m pytest instead of setup.py test + +------------------------------------------------------------------- Old: ---- jsonpath-ng-1.5.1.tar.gz New: ---- jsonpath-ng-1.5.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-jsonpath-ng.spec ++++++ --- /var/tmp/diff_new_pack.wNIkJF/_old 2021-11-03 17:27:18.601371486 +0100 +++ /var/tmp/diff_new_pack.wNIkJF/_new 2021-11-03 17:27:18.601371486 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-jsonpath-ng -Version: 1.5.1 +Version: 1.5.2 Release: 0 Summary: JSONPath for Python License: Apache-2.0 @@ -72,7 +72,7 @@ if [[ ! -d %{buildroot}%{$python_sitelib}/oslotest ]]; then rm tests/test_jsonpath_rw_ext.py fi -$python setup.py test +$python -m pytest } %files %{python_files} ++++++ jsonpath-ng-1.5.1.tar.gz -> jsonpath-ng-1.5.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonpath-ng-1.5.1/History.md new/jsonpath-ng-1.5.2/History.md --- old/jsonpath-ng-1.5.1/History.md 2020-03-09 13:44:58.000000000 +0100 +++ new/jsonpath-ng-1.5.2/History.md 2020-09-07 15:37:49.000000000 +0200 @@ -1,4 +1,14 @@ +v1.5.2 / 2020-09-07 +=================== + + * Merge pull request #41 from josephwhite13/allow-dictionary-filtering + * Merge pull request #48 from back2root/master + * Check for null value. + * Merge pull request #40 from memborsky/add-regular-expression-contains-support + * feat: support regular expression for performing contains (=~) filtering + * if datum.value is a dictionary, filter on the list of values + 1.5.1 / 2020-03-09 ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonpath-ng-1.5.1/jsonpath_ng/__init__.py new/jsonpath-ng-1.5.2/jsonpath_ng/__init__.py --- old/jsonpath-ng-1.5.1/jsonpath_ng/__init__.py 2020-03-09 13:44:58.000000000 +0100 +++ new/jsonpath-ng-1.5.2/jsonpath_ng/__init__.py 2020-09-07 15:37:49.000000000 +0200 @@ -3,4 +3,4 @@ # Current package version -__version__ = '1.5.1' +__version__ = '1.5.2' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonpath-ng-1.5.1/jsonpath_ng/ext/filter.py new/jsonpath-ng-1.5.2/jsonpath_ng/ext/filter.py --- old/jsonpath-ng-1.5.1/jsonpath_ng/ext/filter.py 2020-03-09 13:44:58.000000000 +0100 +++ new/jsonpath-ng-1.5.2/jsonpath_ng/ext/filter.py 2020-09-07 15:37:49.000000000 +0200 @@ -12,6 +12,7 @@ # under the License. import operator +import re from six import moves from .. import JSONPath, DatumInContext, Index @@ -25,7 +26,7 @@ '<': operator.lt, '>=': operator.ge, '>': operator.gt, - '=~': operator.contains, + '=~': lambda a, b: True if re.search(b, a) else False, } @@ -40,6 +41,10 @@ return datum datum = DatumInContext.wrap(datum) + + if isinstance(datum.value, dict): + datum.value = list(datum.value.values()) + if not isinstance(datum.value, list): return [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonpath-ng-1.5.1/jsonpath_ng/jsonpath.py new/jsonpath-ng-1.5.2/jsonpath_ng/jsonpath.py --- old/jsonpath-ng-1.5.1/jsonpath_ng/jsonpath.py 2020-03-09 13:44:58.000000000 +0100 +++ new/jsonpath-ng-1.5.2/jsonpath_ng/jsonpath.py 2020-09-07 15:37:49.000000000 +0200 @@ -521,19 +521,21 @@ if field_datum is not None] def update(self, data, val): - for field in self.reified_fields(DatumInContext.wrap(data)): - if field in data: - if hasattr(val, '__call__'): - val(data[field], data, field) - else: - data[field] = val + if data is not None: + for field in self.reified_fields(DatumInContext.wrap(data)): + if field in data: + if hasattr(val, '__call__'): + val(data[field], data, field) + else: + data[field] = val return data def filter(self, fn, data): - for field in self.reified_fields(DatumInContext.wrap(data)): - if field in data: - if fn(data[field]): - data.pop(field) + if data is not None: + for field in self.reified_fields(DatumInContext.wrap(data)): + if field in data: + if fn(data[field]): + data.pop(field) return data def __str__(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonpath-ng-1.5.1/setup.py new/jsonpath-ng-1.5.2/setup.py --- old/jsonpath-ng-1.5.1/setup.py 2020-03-09 13:44:58.000000000 +0100 +++ new/jsonpath-ng-1.5.2/setup.py 2020-09-07 15:37:49.000000000 +0200 @@ -4,7 +4,7 @@ setuptools.setup( name='jsonpath-ng', - version='1.5.1', + version='1.5.2', description=( 'A final implementation of JSONPath for Python that aims to be ' 'standard compliant, including arithmetic and binary comparison '
