The abstract base classes previously defined in 'collections' were moved
to 'collections.abc' in 3.3. The aliases will be removed in 3.10.
Preempt this change now with a simple find-replace:
$ ag -l 'collections.($TYPES)' | \
xargs sed -i 's/\(collections\)\.\($TYPES\)/\1.abc.\2/g'
Where $TYPES is the list of moved ABCs from .
Signed-off-by: Stephen Finucane <email@example.com>
The behaviour of the groupBy() function was fixed in 1.1.2 by
3fb9178401 to pass only the list of values
to be aggregated to the aggregator function, instead of passing both the
key and the list of values (and expecting both the key and the
aggregated value to be returned). This fix was incompatible with
existing expressions that used the aggregator argument to groupBy().
In the event of an error, fall back trying the previous syntax and see
if something plausible gets returned. If not, re-raise the original error.
This should mean that pre-existing expressions will continue to work,
while most outright bogus expressions should fail in a manner consistent
with the correct definition of the function.
The change e693e6ecef added slots to the
concrete classes in yaqltypes, however the abstract parent classes
HiddenParameterType and LazyParameterType were omitted, with the result
that their derived types would still contain an __dict__ attribute.
* now it is possible to pass one or more YAQL expressions in command line.
This also disables interactive mode
* input file name can be specified as "-" to read from stdin
* added option to treat input as a string rather than JSON
* added option to treat input as an array (strings or JSONs)
* added option to output result in Python format rather than JSON
* removed redundant code that left from yaql v0.2
* print error messages to stderr rather than stdout
'yaql.convertInputData' and 'yaql.convertOutputData' engine
options were added. By setting them to false one can suppress
input or output data conversion. For the input data this will prevent
yaql from converting mutable data structures (lists, dicts, sets) to
their immutable versions, which will break some of the constructs that
require hashable structures (for example set of lists, or list as a
dictionary key), for the output it will not expand produced iterators
and not convert tuples to lists. However this can greatly improve
performance in some cases
- documenter script functionality was merged
into sphinx extension
- heavy refactoring of the documenter code
- grouping of overload methods in documentation
- several minor fixes in doc strings
Collectively, these types are fairly common in the context (about 400 in
the default context). Defining __slots__ for them so that they don't
need a __dict__ object to store attributes results in a fairly
inconsequential saving of memory with the default context, but likely
could result in significant savings depending on the amount of data yaql
is operating on.
These are the two most common types of object in a yaql context (about
800 exist in the default context). Defining __slots__ for them so that
they don't need a __dict__ object to store attributes results in a
modest saving of memory (around 10% of the default context).
groupBy method accepts `aggregator`
parameter which is supposed to be
a function to aggregate value withing each group
but instead it was applied to the whole group list
I'd like to use the regex replace interface to do a pattern
substitution, and couldn't find any docs or tests illustrating
how to do it when using backreferences, so adding this test
which proves it works and provides an example for other folks
trying to do this.
The thrown error for single() method in case of collection to
have more than one element should be StopIteration unlike ValueError,
for consistency with other code.