pandagg.node.query.abstract module¶
-
class
pandagg.node.query.abstract.
AbstractSingleFieldQueryClause
(field, _name=None, **body)[source]¶
-
class
pandagg.node.query.abstract.
FlatFieldQueryClause
(field, _name=None, **body)[source]¶ Bases:
pandagg.node.query.abstract.AbstractSingleFieldQueryClause
Query clause applied on one single field. Example:
Exists: {“exists”: {“field”: “user”}} -> field = “user” -> body = {“field”: “user”} >>> from pandagg.query import Exists >>> q = Exists(field=”user”)
DistanceFeature: {“distance_feature”: {“field”: “production_date”, “pivot”: “7d”, “origin”: “now”}} -> field = “production_date” -> body = {“field”: “production_date”, “pivot”: “7d”, “origin”: “now”} >>> from pandagg.query import DistanceFeature >>> q = DistanceFeature(field=”production_date”, pivot=”7d”, origin=”now”)
-
class
pandagg.node.query.abstract.
KeyFieldQueryClause
(field=None, _name=None, _expand__to_dot=True, **params)[source]¶ Bases:
pandagg.node.query.abstract.AbstractSingleFieldQueryClause
Clause with field used as key in clause body:
Term: {“term”: {“user”: {“value”: “Kimchy”, “boost”: 1}}} -> field = “user” -> body = {“user”: {“value”: “Kimchy”, “boost”: 1}} >>> from pandagg.query import Term >>> q1 = Term(user={“value”: “Kimchy”, “boost”: 1}}) >>> q2 = Term(field=”user”, value=”Kimchy”, boost=1}})
Can accept a “_implicit_param” attribute specifying which is the equivalent key when inner body isn’t a dict but a raw value. For Term: _implicit_param = “value” >>> q = Term(user=”Kimchy”) {“term”: {“user”: {“value”: “Kimchy”}}} -> field = “user” -> body = {“term”: {“user”: {“value”: “Kimchy”}}}
-
pandagg.node.query.abstract.
Q
(type_or_query=None, **body)[source]¶ Accept multiple syntaxes, return a QueryClause node.
Parameters: - type_or_query –
- body –
Returns: QueryClause
-
class
pandagg.node.query.abstract.
QueryClause
(_name=None, accept_children=True, keyed=True, _children=None, **body)[source]¶ Bases:
pandagg.node._node.Node
-
KEY
= None¶
-
line_repr
(depth, **kwargs)[source]¶ Control how node is displayed in tree representation. _ ├── one end │ └── two myEnd └── three
-
name
¶
-