Skip to content

Commit

Permalink
resolve test_api_to_sql_index_label_multiindex error
Browse files Browse the repository at this point in the history
  • Loading branch information
UmbertoFasci committed Dec 20, 2024
1 parent a354c59 commit b18c79c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ def test_api_to_sql_index_label_multiindex(conn, request):
# no index name, defaults to 'level_0' and 'level_1'
result = sql.to_sql(temp_frame, table_uuid, conn)
assert result == expected_row_count
frame = sql.read_sql_query("SELECT * FROM table_uuid", conn)
frame = sql.read_sql_query(f"SELECT * FROM {table_uuid}", conn)
assert frame.columns[0] == "level_0"
assert frame.columns[1] == "level_1"

Expand Down Expand Up @@ -2058,7 +2058,7 @@ def test_api_to_sql_index_label_multiindex(conn, request):
index_label=["C", "D"],
)
assert result == expected_row_count
frame = sql.read_sql_query("SELECT * FROM table_uuid", conn)
frame = sql.read_sql_query(f"SELECT * FROM {table_uuid}", conn)
assert frame.columns[:2].tolist() == ["C", "D"]

msg = "Length of 'index_label' should match number of levels, which is 2"
Expand Down

0 comments on commit b18c79c

Please sign in to comment.