Skip to content

Commit

Permalink
Merge pull request #267 from Mause/242-ensure-timedelta-interval-is-s…
Browse files Browse the repository at this point in the history
…upported

test: add xfail test for intervals
  • Loading branch information
kodiakhq[bot] authored Jun 15, 2022
2 parents 6d879f3 + 46379ba commit 9e70b34
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions duckdb_engine/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Column,
ForeignKey,
Integer,
Interval,
MetaData,
Sequence,
String,
Expand Down Expand Up @@ -52,6 +53,14 @@ class Owner(Base):
) # type: RelationshipProperty[FakeModel]


class IntervalModel(Base):
__tablename__ = "IntervalModel"

id = Column(Integer, Sequence("IntervalModel_id_sequence"), primary_key=True)

field = Column(Interval)


@fixture
def session(engine: Engine) -> Session:
return sessionmaker(bind=engine)()
Expand Down Expand Up @@ -179,3 +188,13 @@ def test_description() -> None:
import duckdb

duckdb.connect("").description


@mark.xfail(reason="support not released", raises=RuntimeError)
def test_intervals(session: Session) -> None:
session.add(IntervalModel(field=timedelta(days=1)))
session.commit()

owner = session.query(IntervalModel).one() # act

assert owner.field == timedelta(days=1)

0 comments on commit 9e70b34

Please sign in to comment.