Skip to content

Commit 52b7c84

Browse files
committed
Reorganized imports, added skip
1 parent aa135df commit 52b7c84

File tree

1 file changed

+36
-34
lines changed

1 file changed

+36
-34
lines changed

frictionless/formats/polars/__spec__/test_parser.py

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from datetime import datetime, time, date
1+
from datetime import date, datetime, time
22
from decimal import Decimal
33

44
import isodate
55
import polars as pl
6+
import pytest
67
import pytz
78
from dateutil.tz import tzutc
89

@@ -168,36 +169,37 @@ def test_polars_write_constraints():
168169
]
169170

170171

171-
# def test_polars_parser_write_timezone():
172-
# # This Test fails because polars does not allow mixing tz aware time with naive time.
173-
# source = TableResource(path="data/timezone.csv")
174-
# target = source.write(format="polars")
175-
# with target:
176-
# # Assert schema
177-
# assert target.schema.to_descriptor() == {
178-
# "fields": [
179-
# {"name": "datetime", "type": "datetime"},
180-
# {"name": "time", "type": "time"},
181-
# ],
182-
# }
183-
# # Polars disallows comparing naive tzs with explicit tzs
184-
# # https://github.com/pola-rs/polars/pull/12966#pullrequestreview-1785291945
185-
# # Assert rows
186-
# assert target.read_rows() == [
187-
# {
188-
# "datetime": datetime(2020, 1, 1, 15, 0, tzinfo=tzutc()),
189-
# "time": time(15),
190-
# },
191-
# {
192-
# "datetime": datetime(2020, 1, 1, 15, 0, tzinfo=tzutc()),
193-
# "time": time(15),
194-
# },
195-
# {
196-
# "datetime": datetime(2020, 1, 1, 12, 0, tzinfo=tzutc()),
197-
# "time": time(12),
198-
# },
199-
# {
200-
# "datetime": datetime(2020, 1, 1, 18, 0, tzinfo=tzutc()),
201-
# "time": time(18),
202-
# },
203-
# ]
172+
# This Test fails because polars does not allow mixing tz aware time with naive time.
173+
@pytest.mark.skip
174+
def test_polars_parser_write_timezone():
175+
source = TableResource(path="data/timezone.csv")
176+
target = source.write(format="polars")
177+
with target:
178+
# Assert schema
179+
assert target.schema.to_descriptor() == {
180+
"fields": [
181+
{"name": "datetime", "type": "datetime"},
182+
{"name": "time", "type": "time"},
183+
],
184+
}
185+
# Polars disallows comparing naive tzs with explicit tzs
186+
# https://github.com/pola-rs/polars/pull/12966#pullrequestreview-1785291945
187+
# Assert rows
188+
assert target.read_rows() == [
189+
{
190+
"datetime": datetime(2020, 1, 1, 15, 0, tzinfo=tzutc()),
191+
"time": time(15),
192+
},
193+
{
194+
"datetime": datetime(2020, 1, 1, 15, 0, tzinfo=tzutc()),
195+
"time": time(15),
196+
},
197+
{
198+
"datetime": datetime(2020, 1, 1, 12, 0, tzinfo=tzutc()),
199+
"time": time(12),
200+
},
201+
{
202+
"datetime": datetime(2020, 1, 1, 18, 0, tzinfo=tzutc()),
203+
"time": time(18),
204+
},
205+
]

0 commit comments

Comments
 (0)