File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,23 @@ def test_table_time_partitioning_with_timestamp_dialect_option(faux_conn):
193
193
)
194
194
195
195
196
+ def test_table_time_partitioning_with_date_dialect_option (faux_conn ):
197
+ # expect table creation to fail as SQLite does not support partitioned tables
198
+ with pytest .raises (sqlite3 .OperationalError ):
199
+ setup_table (
200
+ faux_conn ,
201
+ "some_table_2" ,
202
+ sqlalchemy .Column ("id" , sqlalchemy .Integer ),
203
+ sqlalchemy .Column ("createdAt" , sqlalchemy .DATE ),
204
+ bigquery_time_partitioning = TimePartitioning (field = "createdAt" ),
205
+ )
206
+ # confirm that the following code creates the correct SQL string
207
+ assert " " .join (faux_conn .test_data ["execute" ][- 1 ][0 ].strip ().split ()) == (
208
+ "CREATE TABLE `some_table_2` ( `id` INT64, `createdAt` DATE )"
209
+ " PARTITION BY createdAt"
210
+ )
211
+
212
+
196
213
def test_table_time_partitioning_dialect_option_partition_expiration_days (faux_conn ):
197
214
# expect table creation to fail as SQLite does not support partitioned tables
198
215
with pytest .raises (sqlite3 .OperationalError ):
You canβt perform that action at this time.
0 commit comments