Skip to content

Commit

Permalink
Only enable outer join sqlite tests if version >= 3.39.0
Browse files Browse the repository at this point in the history
  • Loading branch information
NMAC427 committed Jul 17, 2023
1 parent bcdf868 commit 6541dda
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions tests/test_sql_table.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

import sqlite3

import pandas as pd
import pytest
import sqlalchemy as sa
Expand Down Expand Up @@ -164,19 +166,20 @@ def test_join(self, tbl_left, tbl_right):
pd.DataFrame({"a": [1, 2, 2], "b_df_right": [1, 2, 2]}),
)

assert_equal(
(
tbl_left
>> join(tbl_right, tbl_left.a == tbl_right.b, "outer")
>> select(tbl_left.a, tbl_right.b)
),
pd.DataFrame(
{
"a": [1.0, 2.0, 2.0, 3.0, 4.0, pd.NA],
"b_df_right": [1.0, 2.0, 2.0, pd.NA, pd.NA, 0.0],
}
),
)
if sqlite3.sqlite_version_info >= (3, 39, 0):
assert_equal(
(
tbl_left
>> join(tbl_right, tbl_left.a == tbl_right.b, "outer")
>> select(tbl_left.a, tbl_right.b)
),
pd.DataFrame(
{
"a": [1.0, 2.0, 2.0, 3.0, 4.0, pd.NA],
"b_df_right": [1.0, 2.0, 2.0, pd.NA, pd.NA, 0.0],
}
),
)

def test_filter(self, tbl1, tbl2):
# Simple filter expressions
Expand Down

0 comments on commit 6541dda

Please sign in to comment.