MCPcopy Create free account
hub / github.com/apache/datafusion / print_empty

Function print_empty

datafusion-cli/src/print_format.rs:227–256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225
226 #[test]
227 fn print_empty() {
228 for format in [
229 PrintFormat::Csv,
230 PrintFormat::Tsv,
231 PrintFormat::Json,
232 PrintFormat::NdJson,
233 PrintFormat::Automatic,
234 ] {
235 // no output for empty batches, even with header set
236 let output = PrintBatchesTest::new()
237 .with_format(format)
238 .with_schema(three_column_schema())
239 .with_batches(vec![])
240 .run();
241 assert_eq!(output, "")
242 }
243
244 // output column headers for empty batches when format is Table
245 let output = PrintBatchesTest::new()
246 .with_format(PrintFormat::Table)
247 .with_schema(three_column_schema())
248 .with_batches(vec![])
249 .run();
250 assert_snapshot!(output, @r"
251 +---+---+---+
252 | a | b | c |
253 +---+---+---+
254 +---+---+---+
255 ");
256 }
257
258 #[test]
259 fn print_csv_no_header() {

Callers

nothing calls this directly

Calls 6

newFunction · 0.85
three_column_schemaFunction · 0.85
runMethod · 0.45
with_batchesMethod · 0.45
with_schemaMethod · 0.45
with_formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…