diff --git a/rerun_py/src/dataframe.rs b/rerun_py/src/dataframe.rs index 95ef313f69d7..ecdef2ce0a6f 100644 --- a/rerun_py/src/dataframe.rs +++ b/rerun_py/src/dataframe.rs @@ -709,15 +709,14 @@ impl PyRecordingView { args: &Bound<'_, PyTuple>, columns: Option>, ) -> PyResult>> { + let mut query_expression = self.query_expression.clone(); + query_expression.selection = Self::select_args(args, columns)?; + match &self.recording { PyRecordingHandle::Local(recording) => { let borrowed = recording.borrow(py); let engine = borrowed.engine(); - let mut query_expression = self.query_expression.clone(); - - query_expression.selection = Self::select_args(args, columns)?; - let query_handle = engine.query(query_expression); // If the only contents found are static, we might need to warn the user since @@ -772,7 +771,7 @@ impl PyRecordingView { let mut borrowed_client = borrowed_recording.client.borrow_mut(py); borrowed_client.exec_query( borrowed_recording.store_info.store_id.clone(), - self.query_expression.clone(), + query_expression, ) } } @@ -815,26 +814,26 @@ impl PyRecordingView { // This is a static selection, so we clear the filtered index query_expression.filtered_index = None; + // If no columns provided, select all static columns + let static_columns = Self::select_args(args, columns) + .transpose() + .unwrap_or_else(|| { + Ok(self + .schema(py)? + .schema + .iter() + .filter(|col| col.is_static()) + .map(|col| col.clone().into()) + .collect()) + })?; + + query_expression.selection = Some(static_columns); + match &self.recording { PyRecordingHandle::Local(recording) => { let borrowed = recording.borrow(py); let engine = borrowed.engine(); - // If no columns provided, select all static columns - let static_columns = Self::select_args(args, columns) - .transpose() - .unwrap_or_else(|| { - Ok(self - .schema(py)? - .schema - .iter() - .filter(|col| col.is_static()) - .map(|col| col.clone().into()) - .collect()) - })?; - - query_expression.selection = Some(static_columns); - let query_handle = engine.query(query_expression); let non_static_cols = query_handle