crandas.placeholders
Any(value, *, label=None, session=None, **kwargs)
Any placeholder
When used as an argument to a VDL query command that is authorized, indicates
that the authorization applies to any possible value. For example, filtering
with ==32 means that only filtering for equality to the specific value 32
is authorized; filtering with ==Any(32) means that filtering with any value
instead of the concrete value 32 is authorized.
The Any placeholder does not tie the data type, e.g., when using an integer
placeholder Any(1) in script recording, this also authorizes the use of a
fixed-point value 2.0 when playing the script. However, the Any placeholder
only allows to insert values, and not more complex expressions, e.g., when using
the placeholder Any(1) in script recording, this does not authorized the
use e.g. a column reference cdf["col1"].
When the same placeholder object (or different placeholder objects that have the same label) is used multiple times in a script, the placeholder has to have the same value. This does not apply outside of the context of a script, or when the placeholder is defined in a stepless context. For example:
cd.script.record()
p1 = cd.placeholders.Any(1)
cdf = cdf.filter(cdf["x"] == p1)
p2 = cd.placeholders.Any(2)
with cd.script.stepless():
p3 = cd.placeholders.Any(3)
# Allows to do .isin(xx, yy, zz), where xx has to be the same as in the
# previous filter; yy has to be the same for the different calls to
# .isin; and zz can be arbitrary
cdf = cdf.filter(cdf["z"].isin([p1, p2, p3]))