Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Feb 8, 2023
1 parent 01d135a commit 1e4d83c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 9 additions & 3 deletions polars/polars-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ decompress = ["flate2/miniz_oxide"]
decompress-fast = ["flate2/zlib-ng"]
dtype-categorical = ["polars-core/dtype-categorical"]
dtype-date = ["polars-core/dtype-date", "polars-time/dtype-date"]
dtype-datetime = ["polars-core/dtype-datetime", "polars-core/temporal", "polars-time/dtype-datetime", "chrono-tz", "chrono"]
dtype-datetime = [
"polars-core/dtype-datetime",
"polars-core/temporal",
"polars-time/dtype-datetime",
"chrono-tz",
"chrono",
]
dtype-time = ["polars-core/dtype-time", "polars-core/temporal", "polars-time/dtype-time"]
dtype-struct = ["polars-core/dtype-struct"]
dtype-binary = ["polars-core/dtype-binary"]
Expand All @@ -46,8 +52,8 @@ anyhow.workspace = true
arrow.workspace = true
async-trait = { version = "0.1.59", optional = true }
bytes = "1.3.0"
chrono = {version="0.4.23", optional=true}
chrono-tz = {version="0.8.1", optional=true}
chrono = { version = "0.4.23", optional = true }
chrono-tz = { version = "0.8.1", optional = true }
dirs = "4.0"
flate2 = { version = "1", optional = true, default-features = false }
futures = { version = "0.3.25", optional = true }
Expand Down
6 changes: 4 additions & 2 deletions py-polars/tests/unit/io/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import tempfile
import textwrap
import zlib
from datetime import date, datetime, time, timezone, timedelta
from datetime import date, datetime, time, timedelta, timezone
from pathlib import Path

import pytest
Expand Down Expand Up @@ -859,6 +859,7 @@ def test_datetime_format(fmt: str, expected: str) -> None:
csv = df.write_csv(datetime_format=fmt)
assert csv == expected


@pytest.mark.parametrize(
("fmt", "expected"),
[
Expand All @@ -870,12 +871,13 @@ def test_datetime_format(fmt: str, expected: str) -> None:
("%R%z", "dt\n00:00+0000\n"),
],
)
@pytest.mark.parametrize('tzinfo', [timezone.utc, timezone(timedelta(hours=0))])
@pytest.mark.parametrize("tzinfo", [timezone.utc, timezone(timedelta(hours=0))])
def test_datetime_format_tz_aware(fmt: str, expected: str, tzinfo: timezone) -> None:
df = pl.DataFrame({"dt": [datetime(2022, 1, 2, tzinfo=tzinfo)]})
csv = df.write_csv(datetime_format=fmt)
assert csv == expected


@pytest.mark.parametrize(
("tu1", "tu2", "expected"),
[
Expand Down

0 comments on commit 1e4d83c

Please sign in to comment.