From abdfbe1036ff60fba6da632ac6041d193c3fc030 Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Wed, 2 Oct 2024 11:57:55 +0200 Subject: [PATCH 1/2] fix: Remove failing datetime subclass test --- py-polars/tests/unit/functions/test_lit.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/py-polars/tests/unit/functions/test_lit.py b/py-polars/tests/unit/functions/test_lit.py index 806d4077db13..16970f70720c 100644 --- a/py-polars/tests/unit/functions/test_lit.py +++ b/py-polars/tests/unit/functions/test_lit.py @@ -196,20 +196,3 @@ def test_lit_decimal_parametric(s: pl.Series) -> None: assert df.dtypes[0] == pl.Decimal(None, scale) assert result == value - -def test_lit_date_subclass() -> None: - class SubDate(date): - pass - - result = pl.select(a=pl.lit(SubDate(2024, 1, 1))) - expected = pl.DataFrame({"a": [date(2024, 1, 1)]}) - assert_frame_equal(result, expected) - - -def test_lit_datetime_subclass() -> None: - class SubDatetime(datetime): - pass - - result = pl.select(a=pl.lit(SubDatetime(2024, 1, 1))) - expected = pl.DataFrame({"a": [datetime(2024, 1, 1)]}) - assert_frame_equal(result, expected) From a8a4366e7f76afdde5f481ef6c8c6f3e37ed2288 Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Wed, 2 Oct 2024 11:59:36 +0200 Subject: [PATCH 2/2] fmt --- py-polars/tests/unit/functions/test_lit.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/py-polars/tests/unit/functions/test_lit.py b/py-polars/tests/unit/functions/test_lit.py index 16970f70720c..f48c6034f7fd 100644 --- a/py-polars/tests/unit/functions/test_lit.py +++ b/py-polars/tests/unit/functions/test_lit.py @@ -1,7 +1,7 @@ from __future__ import annotations import enum -from datetime import date, datetime, timedelta +from datetime import datetime, timedelta from decimal import Decimal from typing import TYPE_CHECKING, Any @@ -195,4 +195,3 @@ def test_lit_decimal_parametric(s: pl.Series) -> None: assert df.dtypes[0] == pl.Decimal(None, scale) assert result == value -