1- from datetime import date , datetime
1+ from datetime import date , datetime , timedelta , timezone
22from decimal import Decimal
33from logging import getLogger
44from typing import List
@@ -67,8 +67,11 @@ def all_types_query() -> str:
6767 "'text' as \" string\" , "
6868 "CAST('2021-03-28' AS DATE) as \" date\" , "
6969 "CAST('1860-03-04' AS DATE_EXT) as \" date32\" ,"
70+ "pgdate '0001-01-01' as pgdate, "
7071 "CAST('2019-07-31 01:01:01' AS DATETIME) as \" datetime\" , "
7172 "CAST('2019-07-31 01:01:01.1234' AS TIMESTAMP_EXT(4)) as \" datetime64\" , "
73+ "CAST('1111-01-05 17:04:42.123456' as timestampntz) as timestampntz, "
74+ "'1111-01-05 17:04:42.123456'::timestamptz as timestamptz,"
7275 'true as "bool",'
7376 "[1,2,3,4] as \" array\" , cast('1231232.123459999990457054844258706536' as "
7477 'decimal(38,30)) as "decimal", '
@@ -92,8 +95,11 @@ def all_types_query_description() -> List[Column]:
9295 Column ("string" , str , None , None , None , None , None ),
9396 Column ("date" , date , None , None , None , None , None ),
9497 Column ("date32" , date , None , None , None , None , None ),
98+ Column ("pgdate" , date , None , None , None , None , None ),
9599 Column ("datetime" , datetime , None , None , None , None , None ),
96100 Column ("datetime64" , DATETIME64 (4 ), None , None , None , None , None ),
101+ Column ("timestampntz" , datetime , None , None , None , None , None ),
102+ Column ("timestamptz" , datetime , None , None , None , None , None ),
97103 Column ("bool" , int , None , None , None , None , None ),
98104 Column ("array" , ARRAY (int ), None , None , None , None , None ),
99105 Column ("decimal" , DECIMAL (38 , 30 ), None , None , None , None , None ),
@@ -102,7 +108,7 @@ def all_types_query_description() -> List[Column]:
102108
103109
104110@fixture
105- def all_types_query_response () -> List [ColType ]:
111+ def all_types_query_response (timezone_offset_seconds : int ) -> List [ColType ]:
106112 return [
107113 [
108114 1 ,
@@ -118,8 +124,20 @@ def all_types_query_response() -> List[ColType]:
118124 "text" ,
119125 date (2021 , 3 , 28 ),
120126 date (1860 , 3 , 4 ),
127+ date (1 , 1 , 1 ),
121128 datetime (2019 , 7 , 31 , 1 , 1 , 1 ),
122129 datetime (2019 , 7 , 31 , 1 , 1 , 1 , 123400 ),
130+ datetime (1111 , 1 , 5 , 17 , 4 , 42 , 123456 ),
131+ datetime (
132+ 1111 ,
133+ 1 ,
134+ 5 ,
135+ 17 ,
136+ 4 ,
137+ 42 ,
138+ 123456 ,
139+ tzinfo = timezone (timedelta (seconds = timezone_offset_seconds )),
140+ ),
123141 1 ,
124142 [1 , 2 , 3 , 4 ],
125143 Decimal ("1231232.123459999990457054844258706536" ),
@@ -128,6 +146,16 @@ def all_types_query_response() -> List[ColType]:
128146 ]
129147
130148
149+ @fixture
150+ def timezone_name () -> str :
151+ return "Asia/Calcutta"
152+
153+
154+ @fixture
155+ def timezone_offset_seconds () -> int :
156+ return 5 * 3600 + 53 * 60 + 28 # 05:53:28
157+
158+
131159@fixture
132160def create_drop_description () -> List [Column ]:
133161 return [
0 commit comments