File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ groupby_expr: expression -> group_by
2525
2626window_expr: [window_expr ","] _window_name "AS"i ( window_definition )
2727
28- SET_OP: "UNION"i [ ("ALL"i | "DISTINCT"i) ] | "INTERSECT"i "DISTINCT"i | "EXCEPT"i "DISTINCT"i
29-
3028from_item: NAME [ [ "AS"i ] alias ] -> table
3129 | join -> join
3230 | ( "(" query_expr ")" ) [ [ "AS"i ] alias ] -> subquery
@@ -85,6 +83,7 @@ TYPENAME: "object"i
8583 | "datetime64"i
8684 | "timestamp"i
8785 | "category"i
86+ | "string"i
8887AGGREGATION.8: "sum"i | "avg"i | "min"i | "max"i
8988alias: NAME -> alias_string
9089_window_name: NAME
Original file line number Diff line number Diff line change @@ -1367,7 +1367,8 @@ def test_sql_data_types():
13671367 cast(avocado_id as category) as avocado_id_category,
13681368 cast(date as datetime64) as date,
13691369 cast(date as timestamp) as time,
1370- cast(region as varchar) as region_varchar
1370+ cast(region as varchar) as region_varchar,
1371+ cast(region as string) as region_string
13711372 from avocado
13721373 """
13731374 )
@@ -1389,6 +1390,7 @@ def test_sql_data_types():
13891390 pandas_frame ["date" ] = pandas_frame ["Date" ].astype ("datetime64" )
13901391 pandas_frame ["time" ] = pandas_frame ["Date" ].astype ("datetime64" )
13911392 pandas_frame ["region_varchar" ] = pandas_frame ["region" ].astype ("string" )
1393+ pandas_frame ["region_string" ] = pandas_frame ["region" ].astype ("string" )
13921394 pandas_frame = pandas_frame .drop (columns = ["avocado_id" , "Date" , "region" ])
13931395
13941396 tm .assert_frame_equal (pandas_frame , my_frame )
@@ -1453,6 +1455,6 @@ def test_boolean_order_of_operations_with_parens():
14531455if __name__ == "__main__" :
14541456 register_env_tables ()
14551457
1456- test_boolean_order_of_operations_with_parens ()
1458+ test_sql_data_types ()
14571459
14581460 remove_env_tables ()
You can’t perform that action at this time.
0 commit comments