@@ -74,6 +74,7 @@ def indexed(
7474 columns : ColumnsDef ,
7575 filter_by : Optional [Union [Filter , list [Filter ]]] = None ,
7676 on_execution_submitted : Optional [Callable [[Execution ], None ]] = None ,
77+ is_cancellable : bool = False ,
7778 ) -> pandas .DataFrame :
7879 """
7980 Creates a data frame indexed by values of the label. The data frame columns will be created from either
@@ -88,6 +89,7 @@ def indexed(
8889 Optional filters to apply during computation on the server.
8990 on_execution_submitted (Optional[Callable[[Execution], None]]): Callback to call when the execution was
9091 submitted to the backend.
92+ is_cancellable (bool, optional): Whether the execution should be cancelled when the connection is interrupted.
9193
9294 Returns:
9395 pandas.DataFrame: A DataFrame instance.
@@ -99,6 +101,7 @@ def indexed(
99101 index_by = index_by ,
100102 filter_by = filter_by ,
101103 on_execution_submitted = on_execution_submitted ,
104+ is_cancellable = is_cancellable ,
102105 )
103106
104107 _idx = make_pandas_index (index )
@@ -110,6 +113,7 @@ def not_indexed(
110113 columns : ColumnsDef ,
111114 filter_by : Optional [Union [Filter , list [Filter ]]] = None ,
112115 on_execution_submitted : Optional [Callable [[Execution ], None ]] = None ,
116+ is_cancellable : bool = False ,
113117 ) -> pandas .DataFrame :
114118 """
115119 Creates a data frame with columns created from metrics and or labels.
@@ -120,6 +124,7 @@ def not_indexed(
120124 computation on the server.
121125 on_execution_submitted (Optional[Callable[[Execution], None]]): Callback to call when the execution was
122126 submitted to the backend.
127+ is_cancellable (bool, optional): Whether the execution should be cancelled when the connection is interrupted.
123128
124129 Returns:
125130 pandas.DataFrame: A DataFrame instance.
@@ -131,6 +136,7 @@ def not_indexed(
131136 columns = columns ,
132137 filter_by = filter_by ,
133138 on_execution_submitted = on_execution_submitted ,
139+ is_cancellable = is_cancellable ,
134140 )
135141
136142 return pandas .DataFrame (data = data )
@@ -141,6 +147,7 @@ def for_items(
141147 filter_by : Optional [Union [Filter , list [Filter ]]] = None ,
142148 auto_index : bool = True ,
143149 on_execution_submitted : Optional [Callable [[Execution ], None ]] = None ,
150+ is_cancellable : bool = False ,
144151 ) -> pandas .DataFrame :
145152 """
146153 Creates a data frame for named items. This is a convenience method that will create DataFrame with or
@@ -154,6 +161,7 @@ def for_items(
154161 of the items.
155162 on_execution_submitted (Optional[Callable[[Execution], None]]): Callback to call when the execution was
156163 submitted to the backend.
164+ is_cancellable (bool, optional): Whether the execution should be cancelled when the connection is interrupted.
157165
158166 Returns:
159167 pandas.DataFrame: A DataFrame instance.
@@ -183,13 +191,15 @@ def for_items(
183191 columns = resolved_measure_cols ,
184192 filter_by = filter_by ,
185193 on_execution_submitted = on_execution_submitted ,
194+ is_cancellable = is_cancellable ,
186195 )
187196
188197 def for_visualization (
189198 self ,
190199 visualization_id : str ,
191200 auto_index : bool = True ,
192201 on_execution_submitted : Optional [Callable [[Execution ], None ]] = None ,
202+ is_cancellable : bool = False ,
193203 ) -> pandas .DataFrame :
194204 """
195205 Creates a data frame with columns based on the content of the visualization with the provided identifier.
@@ -200,6 +210,7 @@ def for_visualization(
200210 of the visualization.
201211 on_execution_submitted (Optional[Callable[[Execution], None]]): Callback to call when the execution was
202212 submitted to the backend.
213+ is_cancellable (bool, optional): Whether the execution should be cancelled when the connection is interrupted.
203214
204215 Returns:
205216 pandas.DataFrame: A DataFrame instance.
@@ -215,13 +226,18 @@ def for_visualization(
215226 }
216227
217228 return self .for_items (
218- columns , filter_by = filter_by , auto_index = auto_index , on_execution_submitted = on_execution_submitted
229+ columns ,
230+ filter_by = filter_by ,
231+ auto_index = auto_index ,
232+ on_execution_submitted = on_execution_submitted ,
233+ is_cancellable = is_cancellable ,
219234 )
220235
221236 def for_created_visualization (
222237 self ,
223238 created_visualizations_response : dict ,
224239 on_execution_submitted : Optional [Callable [[Execution ], None ]] = None ,
240+ is_cancellable : bool = False ,
225241 ) -> tuple [pandas .DataFrame , DataFrameMetadata ]:
226242 """
227243 Creates a data frame using a created visualization.
@@ -230,11 +246,14 @@ def for_created_visualization(
230246 created_visualizations_response (dict): Created visualization response.
231247 on_execution_submitted (Optional[Callable[[Execution], None]]): Callback to call when the execution was
232248 submitted to the backend.
249+ is_cancellable (bool, optional): Whether the execution should be cancelled when the connection is interrupted.
233250
234251 Returns:
235252 pandas.DataFrame: A DataFrame instance.
236253 """
237- execution_definition = self ._sdk .compute .build_exec_def_from_chat_result (created_visualizations_response )
254+ execution_definition = self ._sdk .compute .build_exec_def_from_chat_result (
255+ created_visualizations_response , is_cancellable = is_cancellable
256+ )
238257 return self .for_exec_def (
239258 exec_def = execution_definition ,
240259 on_execution_submitted = on_execution_submitted ,
0 commit comments