Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-sql/tests/empty_table_function.rs
6939 views
1
// https://github.com/pola-rs/polars-cli/issues/51
2
#[cfg(any(
3
feature = "csv",
4
feature = "parquet",
5
feature = "ipc",
6
feature = "json"
7
))]
8
use polars_sql::*;
9
10
#[test]
11
#[cfg(feature = "csv")]
12
fn test_empty_table_csv_function() {
13
let mut ctx = SQLContext::new();
14
let actual = ctx.execute("SELECT * FROM read_csv()");
15
assert!(actual.is_err());
16
}
17
18
#[test]
19
#[cfg(feature = "parquet")]
20
fn test_empty_table_parquet_function() {
21
let mut ctx = SQLContext::new();
22
let actual = ctx.execute("SELECT * FROM read_parquet()");
23
assert!(actual.is_err());
24
}
25
26
#[test]
27
#[cfg(feature = "ipc")]
28
fn test_empty_table_ipc_function() {
29
let mut ctx = SQLContext::new();
30
let actual = ctx.execute("SELECT * FROM read_ipc()");
31
assert!(actual.is_err());
32
}
33
34
#[test]
35
#[cfg(feature = "json")]
36
fn test_empty_table_json_function() {
37
let mut ctx = SQLContext::new();
38
let actual = ctx.execute("SELECT * FROM read_json()");
39
assert!(actual.is_err());
40
}
41
42