Path: blob/main/crates/polars-sql/tests/empty_table_function.rs
6939 views
// https://github.com/pola-rs/polars-cli/issues/511#[cfg(any(2feature = "csv",3feature = "parquet",4feature = "ipc",5feature = "json"6))]7use polars_sql::*;89#[test]10#[cfg(feature = "csv")]11fn test_empty_table_csv_function() {12let mut ctx = SQLContext::new();13let actual = ctx.execute("SELECT * FROM read_csv()");14assert!(actual.is_err());15}1617#[test]18#[cfg(feature = "parquet")]19fn test_empty_table_parquet_function() {20let mut ctx = SQLContext::new();21let actual = ctx.execute("SELECT * FROM read_parquet()");22assert!(actual.is_err());23}2425#[test]26#[cfg(feature = "ipc")]27fn test_empty_table_ipc_function() {28let mut ctx = SQLContext::new();29let actual = ctx.execute("SELECT * FROM read_ipc()");30assert!(actual.is_err());31}3233#[test]34#[cfg(feature = "json")]35fn test_empty_table_json_function() {36let mut ctx = SQLContext::new();37let actual = ctx.execute("SELECT * FROM read_json()");38assert!(actual.is_err());39}404142