Skip to content

Commit ed3cc68

Browse files
committed
fix networks issue
1 parent 0977d30 commit ed3cc68

2 files changed

Lines changed: 19 additions & 14 deletions

File tree

src/synoptic/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ def df(self) -> pl.DataFrame:
704704
pl.concat([pl.DataFrame(i) for i in self.MNET], how="diagonal_relaxed")
705705
.with_columns(
706706
pl.col("ID", "CATEGORY").cast(pl.UInt32),
707-
pl.col("LAST_OBSERVATION").str.to_datetime(),
707+
pl.col("LAST_OBSERVATION").str.to_datetime(time_zone="UTC"),
708708
pl.struct(
709709
pl.col("PERIOD_OF_RECORD")
710710
.struct.field("start")

tests/test_metadata_tables.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,27 @@ def test_Variables():
1818
assert len(s.df())
1919

2020

21-
def test_Networks():
22-
"""Get DataFrame of all networks."""
23-
s = ss.Networks()
21+
def test_NetworkTypes():
22+
"""Get DataFrame of all network types."""
23+
s = ss.NetworkTypes()
2424
assert len(s.df())
2525

26-
s = ss.Networks(id=1)
27-
assert len(s.df()) == 1
2826

29-
s = ss.Networks(id=[1, 2, 3])
30-
assert len(s.df()) == 3
27+
class TestNetworks:
28+
"""Get DataFrame of all networks."""
29+
30+
def test_networks_default(self):
31+
s = ss.Networks()
32+
assert len(s.df())
3133

32-
s = ss.Networks(shortname="uunet,raws")
33-
assert len(s.df()) == 2
34+
def test_networks_1(self):
35+
s = ss.Networks(id=1)
36+
assert len(s.df()) == 1
3437

38+
def test_networks_123(self):
39+
s = ss.Networks(id=[1, 2, 3])
40+
assert len(s.df()) == 3
3541

36-
def test_NetworkTypes():
37-
"""Get DataFrame of all network types."""
38-
s = ss.NetworkTypes()
39-
assert len(s.df())
42+
def test_networks_shortname(self):
43+
s = ss.Networks(shortname="uunet,raws")
44+
assert len(s.df()) == 2

0 commit comments

Comments
 (0)