2020 register_env_tables ,
2121 remove_env_tables ,
2222)
23- from dataframe_sql .tests .markers import ibis_not_implemented
23+ from dataframe_sql .tests .markers import ibis_not_implemented , ibis_next_bug_fix
2424
2525
2626@pytest .fixture (autouse = True , scope = "module" )
@@ -445,6 +445,10 @@ def test_select_star_from_multiple_tables():
445445 tm .assert_frame_equal (pandas_frame , my_frame )
446446
447447
448+ @pytest .mark .xfail (
449+ raises = AssertionError ,
450+ reason = "Bug originating from ibis when " "performing cross join on same table" ,
451+ )
448452def test_select_columns_from_two_tables_with_same_column_name ():
449453 """
450454 Test selecting tables
@@ -453,7 +457,9 @@ def test_select_columns_from_two_tables_with_same_column_name():
453457 my_frame = query ("""select * from forest_fires table1, forest_fires table2""" )
454458 table1 = FOREST_FIRES .copy ()
455459 table2 = FOREST_FIRES .copy ()
456- pandas_frame = merge (table1 .assign (__ = 1 ), table2 .assign (__ = 1 ), on = "__" , how = "inner" )
460+ pandas_frame = merge (
461+ table1 .assign (__ = 1 ), table2 .assign (__ = 1 ), on = "__" , how = "inner" , copy = False
462+ )
457463 del pandas_frame ["__" ]
458464
459465 renamed = {}
@@ -464,10 +470,10 @@ def test_select_columns_from_two_tables_with_same_column_name():
464470 renamed [column ] = "table2." + column .replace ("_y" , "" )
465471 pandas_frame .rename (columns = renamed , inplace = True )
466472
467- tm . assert_frame_equal (
468- pandas_frame . sort_values ( by = list ( pandas_frame . columns ), kind = "mergesort" ),
469- my_frame . sort_values ( by = list ( my_frame . columns ), kind = "mergesort" ),
470- )
473+ for column in my_frame . columns :
474+ tm . assert_series_equal ( pandas_frame [ column ], my_frame [ column ])
475+
476+ tm . assert_frame_equal ( my_frame , pandas_frame )
471477
472478
473479def test_maintain_case_in_query ():
@@ -989,7 +995,7 @@ def test_timestamps():
989995 pandas_frame = FOREST_FIRES .copy ()[["wind" ]]
990996 pandas_frame ["now()" ] = datetime .now ()
991997 pandas_frame ["today()" ] = date .today ()
992- pandas_frame ["_literal5 " ] = datetime (2019 , 1 , 31 , 23 , 20 , 32 )
998+ pandas_frame ["_literal2 " ] = datetime (2019 , 1 , 31 , 23 , 20 , 32 )
993999 tm .assert_frame_equal (pandas_frame , my_frame )
9941000
9951001
@@ -1036,6 +1042,7 @@ def test_multiple_aliases_same_column():
10361042 tm .assert_frame_equal (pandas_frame , my_frame )
10371043
10381044
1045+ @ibis_next_bug_fix
10391046def test_sql_data_types ():
10401047 """
10411048 Tests sql data types
@@ -1142,4 +1149,3 @@ def test_boolean_order_of_operations_with_parens():
11421149 ].reset_index (drop = True )
11431150
11441151 tm .assert_frame_equal (pandas_frame , my_frame )
1145-
0 commit comments