@@ -49,6 +49,39 @@ def test_basic_scenario(timestream_database_and_table, pagination):
49
49
assert df .shape == (3 , 8 )
50
50
51
51
52
+ @pytest .mark .parametrize ("chunked" , [False , True ])
53
+ def test_empty_query (timestream_database_and_table : str , chunked : bool ) -> None :
54
+ df = pd .DataFrame (
55
+ {
56
+ "time" : [datetime .now () for _ in range (5 )],
57
+ "dim0" : ["foo" , "boo" , "bar" , "fizz" , "buzz" ],
58
+ "dim1" : [1 , 2 , 3 , 4 , 5 ],
59
+ "measure" : [1.0 , 1.1 , 1.2 , 1.3 , 1.4 ],
60
+ }
61
+ )
62
+ rejected_records = wr .timestream .write (
63
+ df = df ,
64
+ database = timestream_database_and_table ,
65
+ table = timestream_database_and_table ,
66
+ time_col = "time" ,
67
+ measure_col = "measure" ,
68
+ dimensions_cols = ["dim0" , "dim1" ],
69
+ )
70
+ assert len (rejected_records ) == 0
71
+
72
+ output = wr .timestream .query (
73
+ f"""SELECT *
74
+ FROM "{ timestream_database_and_table } "."{ timestream_database_and_table } "
75
+ WHERE dim0 = 'non_existing_test_dimension'
76
+ """ ,
77
+ )
78
+
79
+ if chunked :
80
+ assert list (output ) == []
81
+ else :
82
+ assert output .empty
83
+
84
+
52
85
def test_chunked_scenario (timestream_database_and_table ):
53
86
df = pd .DataFrame (
54
87
{
0 commit comments