3636 TypeVar ,
3737 cast ,
3838 List ,
39- Union ,
40- Callable ,
41- Iterable ,
42- Dict ,
4339)
4440from qastle import python_ast_to_text_ast
4541
4642from func_adl import EventDataset , find_EventDataset
47- from func_adl .object_stream import S
4843from servicex .query_core import QueryStringGenerator
4944from servicex .func_adl .util import has_tuple
5045from abc import ABC
@@ -63,10 +58,10 @@ class FuncADLQuery(QueryStringGenerator, EventDataset[T], ABC):
6358 async def execute_result_async (
6459 self , a : ast .AST , title : Optional [str ] = None
6560 ) -> Any :
66- pass
61+ "Required override of EventDataset"
6762
6863 def check_data_format_request (self , f_name : str ):
69- pass
64+ "Required override of EventDataset"
7065
7166 def __init__ (
7267 self ,
@@ -78,99 +73,12 @@ def __init__(
7873 def set_provided_qastle (self , qastle : str ):
7974 self .provided_qastle = qastle
8075
81- def SelectMany (
82- self , func : Union [str , ast .Lambda , Callable [[T ], Iterable [S ]]]
83- ) -> FuncADLQuery [S ]:
84- r"""
85- Given the current stream's object type is an array or other iterable, return
86- the items in this objects type, one-by-one. This has the effect of flattening a
87- nested array.
88-
89- Arguments:
90-
91- func: The function that should be applied to this stream's objects to return
92- an iterable. Each item of the iterable is now the stream of objects.
93-
94- Returns:
95- The Dataset with the SelectMany operator applied
96-
97- Notes:
98- - The function can be a `lambda`, the name of a one-line function, a string that
99- contains a lambda definition, or a python `ast` of type `ast.Lambda`.
100- """
101- return super ().SelectMany (func )
102-
103- def Select (self , f : Union [str , ast .Lambda , Callable [[T ], S ]]) -> FuncADLQuery [S ]:
104- r"""
105- Apply a transformation function to each object in the stream, yielding a new type of
106- object. There is a one-to-one correspondence between the input objects and output objects.
107-
108- Arguments:
109- f: selection function (lambda)
110-
111- Returns:
112- The Dataset with the Select operator applied
113-
114- Notes:
115- - The function can be a `lambda`, the name of a one-line function, a string that
116- contains a lambda definition, or a python `ast` of type `ast.Lambda`.
117- """
118-
119- return super ().Select (f )
120-
12176 def generate_selection_string (self ) -> str :
12277 if self .provided_qastle :
12378 return self .provided_qastle
12479 else :
12580 return self .generate_qastle (self .query_ast )
12681
127- def Where (
128- self , filter : Union [str , ast .Lambda , Callable [[T ], bool ]]
129- ) -> FuncADLQuery [T ]:
130- r"""
131- Filter the object stream, allowing only items for which `filter` evaluates as true through.
132-
133- Arguments:
134-
135- filter A filter lambda that returns True/False.
136-
137- Returns:
138-
139- The Dataset with the Where operator applied
140-
141- Notes:
142- - The function can be a `lambda`, the name of a one-line function, a string that
143- contains a lambda definition, or a python `ast` of type `ast.Lambda`.
144- """
145-
146- return super ().Where (filter )
147-
148- def MetaData (self , metadata : Dict [str , Any ]) -> FuncADLQuery [T ]:
149- r"""Add metadata to the current object stream. The metadata is an arbitrary set of string
150- key-value pairs. The backend must be able to properly interpret the metadata.
151-
152- Returns:
153- The Dataset with the MetaData operator applied
154- """
155-
156- return super ().MetaData (metadata )
157-
158- def QMetaData (self , metadata : Dict [str , Any ]) -> FuncADLQuery [T ]:
159- r"""Add query metadata to the current object stream.
160-
161- - Metadata is never transmitted to any back end
162- - Metadata is per-query, not per sample.
163-
164- Warnings are issued if metadata is overwriting metadata.
165-
166- Args:
167- metadata (Dict[str, Any]): Metadata to be used later
168-
169- Returns:
170- The Dataset with the QMetaData operator applied
171- """
172- return super ().QMetaData (metadata )
173-
17482 def set_tree (self , tree_name : str ) -> FuncADLQuery [T ]:
17583 r"""Set the tree name for the query.
17684 Args:
0 commit comments