in src/dataframe.rs [211:235]
fn __repr__(&self, py: Python) -> PyDataFusionResult<String> {
// Get the Python formatter config
let PythonFormatter {
formatter: _,
config,
} = get_python_formatter_with_config(py)?;
let (batches, has_more) = wait_for_future(
py,
collect_record_batches_to_display(self.df.as_ref().clone(), config),
)?;
if batches.is_empty() {
// This should not be reached, but do it for safety since we index into the vector below
return Ok("No data to display".to_string());
}
let batches_as_displ =
pretty::pretty_format_batches(&batches).map_err(py_datafusion_err)?;
let additional_str = match has_more {
true => "\nData truncated.",
false => "",
};
Ok(format!("DataFrame()\n{batches_as_displ}{additional_str}"))
}