@@ -979,18 +979,14 @@ def test_make_date_invalid() -> None:
979979
980980
981981def test_make_timestamp () -> None :
982- df = daft .from_pydict (
983- {"y" : [2021 ], "m" : [1 ], "d" : [1 ], "h" : [12 ], "mi" : [30 ], "s" : [45.0 ]}
984- )
982+ df = daft .from_pydict ({"y" : [2021 ], "m" : [1 ], "d" : [1 ], "h" : [12 ], "mi" : [30 ], "s" : [45.0 ]})
985983 df = df .with_column ("ts" , make_timestamp (col ("y" ), col ("m" ), col ("d" ), col ("h" ), col ("mi" ), col ("s" )))
986984 result = df .to_pydict ()
987985 assert result ["ts" ] == [datetime (2021 , 1 , 1 , 12 , 30 , 45 )]
988986
989987
990988def test_make_timestamp_with_timezone () -> None :
991- df = daft .from_pydict (
992- {"y" : [2021 ], "m" : [1 ], "d" : [1 ], "h" : [12 ], "mi" : [0 ], "s" : [0.0 ]}
993- )
989+ df = daft .from_pydict ({"y" : [2021 ], "m" : [1 ], "d" : [1 ], "h" : [12 ], "mi" : [0 ], "s" : [0.0 ]})
994990 df = df .with_column (
995991 "ts" , make_timestamp (col ("y" ), col ("m" ), col ("d" ), col ("h" ), col ("mi" ), col ("s" ), timezone = "UTC" )
996992 )
@@ -1002,18 +998,14 @@ def test_make_timestamp_with_timezone() -> None:
1002998
1003999
10041000def test_make_timestamp_ltz () -> None :
1005- df = daft .from_pydict (
1006- {"y" : [2021 ], "m" : [1 ], "d" : [1 ], "h" : [12 ], "mi" : [0 ], "s" : [0.0 ]}
1007- )
1001+ df = daft .from_pydict ({"y" : [2021 ], "m" : [1 ], "d" : [1 ], "h" : [12 ], "mi" : [0 ], "s" : [0.0 ]})
10081002 df = df .with_column ("ts" , make_timestamp_ltz (col ("y" ), col ("m" ), col ("d" ), col ("h" ), col ("mi" ), col ("s" )))
10091003 result = df .to_pydict ()
10101004 assert result ["ts" ] == [datetime (2021 , 1 , 1 , 12 , 0 , 0 , tzinfo = timezone .utc )]
10111005
10121006
10131007def test_make_timestamp_ltz_with_timezone () -> None :
1014- df = daft .from_pydict (
1015- {"y" : [2021 ], "m" : [1 ], "d" : [1 ], "h" : [12 ], "mi" : [0 ], "s" : [0.0 ]}
1016- )
1008+ df = daft .from_pydict ({"y" : [2021 ], "m" : [1 ], "d" : [1 ], "h" : [12 ], "mi" : [0 ], "s" : [0.0 ]})
10171009 df = df .with_column (
10181010 "ts" , make_timestamp_ltz (col ("y" ), col ("m" ), col ("d" ), col ("h" ), col ("mi" ), col ("s" ), timezone = "US/Eastern" )
10191011 )
@@ -1026,9 +1018,7 @@ def test_make_timestamp_ltz_with_timezone() -> None:
10261018
10271019
10281020def test_last_day () -> None :
1029- df = daft .from_pydict (
1030- {"dt" : [date (2021 , 1 , 15 ), date (2021 , 2 , 10 ), date (2020 , 2 , 10 ), date (2021 , 4 , 1 )]}
1031- )
1021+ df = daft .from_pydict ({"dt" : [date (2021 , 1 , 15 ), date (2021 , 2 , 10 ), date (2020 , 2 , 10 ), date (2021 , 4 , 1 )]})
10321022 df = df .with_column ("last" , last_day (col ("dt" )))
10331023 result = df .to_pydict ()
10341024 assert result ["last" ] == [
0 commit comments