Skip to content

Support variable precision time timestamp #300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions tests/integration/test_dbapi_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def test_datetime_query_param(trino_connection):
rows = cur.fetchall()

assert rows[0][0] == params
assert cur.description[0][1] == "timestamp"
assert cur.description[0][1] == "timestamp(6)"


def test_datetime_with_utc_time_zone_query_param(trino_connection):
Expand All @@ -299,7 +299,7 @@ def test_datetime_with_utc_time_zone_query_param(trino_connection):
rows = cur.fetchall()

assert rows[0][0] == params
assert cur.description[0][1] == "timestamp with time zone"
assert cur.description[0][1] == "timestamp(6) with time zone"


def test_datetime_with_numeric_offset_time_zone_query_param(trino_connection):
Expand All @@ -313,7 +313,7 @@ def test_datetime_with_numeric_offset_time_zone_query_param(trino_connection):
rows = cur.fetchall()

assert rows[0][0] == params
assert cur.description[0][1] == "timestamp with time zone"
assert cur.description[0][1] == "timestamp(6) with time zone"


def test_datetime_with_named_time_zone_query_param(trino_connection):
Expand All @@ -325,7 +325,7 @@ def test_datetime_with_named_time_zone_query_param(trino_connection):
rows = cur.fetchall()

assert rows[0][0] == params
assert cur.description[0][1] == "timestamp with time zone"
assert cur.description[0][1] == "timestamp(6) with time zone"


def test_datetime_with_trailing_zeros(trino_connection):
Expand Down Expand Up @@ -463,6 +463,7 @@ def test_time_query_param(trino_connection):
rows = cur.fetchall()

assert rows[0][0] == params
assert cur.description[0][1] == "time(6)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for time with time zone?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added similar assertion to test_time_with_time_zone_negative_offset() and test_time_with_time_zone_positive_offset()



def test_time_with_named_time_zone_query_param(trino_connection):
Expand Down Expand Up @@ -492,6 +493,7 @@ def test_time(trino_connection):
rows = cur.fetchall()

assert rows[0][0] == time(1, 2, 3, 456000)
assert cur.description[0][1] == "time(3)"


def test_null_time(trino_connection):
Expand All @@ -512,6 +514,7 @@ def test_time_with_time_zone_negative_offset(trino_connection):
tz = timezone(-timedelta(hours=8, minutes=0))

assert rows[0][0] == time(1, 2, 3, 456000, tzinfo=tz)
assert cur.description[0][1] == "time(3) with time zone"


def test_time_with_time_zone_positive_offset(trino_connection):
Expand All @@ -523,6 +526,7 @@ def test_time_with_time_zone_positive_offset(trino_connection):
tz = timezone(timedelta(hours=8, minutes=0))

assert rows[0][0] == time(1, 2, 3, 456000, tzinfo=tz)
assert cur.description[0][1] == "time(3) with time zone"


def test_null_date_with_time_zone(trino_connection):
Expand Down
Loading