File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -838,7 +838,7 @@ def _process_time_partitioning(
838
838
field = time_partitioning .field
839
839
if isinstance (
840
840
table .columns [time_partitioning .field ].type ,
841
- sqlalchemy .sql .sqltypes .DATE ,
841
+ ( sqlalchemy .sql .sqltypes .DATE , sqlalchemy . sql . sqltypes . Date ) ,
842
842
):
843
843
return f"PARTITION BY { field } "
844
844
elif isinstance (
Original file line number Diff line number Diff line change @@ -193,14 +193,15 @@ 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 ):
196
+ @pytest .mark .parametrize ("date_type" , [sqlalchemy .DATE , sqlalchemy .Date ])
197
+ def test_table_time_partitioning_with_date_dialect_option (faux_conn , date_type ):
197
198
# expect table creation to fail as SQLite does not support partitioned tables
198
199
with pytest .raises (sqlite3 .OperationalError ):
199
200
setup_table (
200
201
faux_conn ,
201
202
"some_table_2" ,
202
203
sqlalchemy .Column ("id" , sqlalchemy .Integer ),
203
- sqlalchemy .Column ("createdAt" , sqlalchemy . DATE ),
204
+ sqlalchemy .Column ("createdAt" , date_type ),
204
205
bigquery_time_partitioning = TimePartitioning (field = "createdAt" ),
205
206
)
206
207
You can’t perform that action at this time.
0 commit comments