Skip to content

Commit 5da1b9a

Browse files
committed
Remove filter none from dict util
with the previouse refactor of the Resource options it has become obsolete/ unused. This commit removes the unused code and assoctiated tests.
1 parent 0fb9ab1 commit 5da1b9a

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

src/jobs/util.py

-5
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ def to_rational(s: str) -> float:
4242
return factor * magnitude
4343

4444

45-
def remove_none_values(d: dict) -> dict:
46-
"""Remove all keys with a ``None`` value from a dict."""
47-
return {k: v for k, v in d.items() if v is not None}
48-
49-
5045
def sanitize_rfc1123_domain_name(s: str) -> str:
5146
"""Sanitize a string to be compliant with RFC 1123 domain name
5247

tests/unit/test_utils.py

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from jobs.util import remove_none_values, to_rational
3+
from jobs.util import to_rational
44

55

66
@pytest.mark.parametrize(
@@ -24,18 +24,3 @@ def test_to_rational(given: str, expected: float) -> None:
2424
actual = to_rational(given)
2525

2626
assert actual == pytest.approx(expected)
27-
28-
29-
@pytest.mark.parametrize(
30-
"given, expected",
31-
[
32-
(d := {"a": 1, "b": 2}, d),
33-
({"a": 42, "b": None, "c": "foo"}, {"a": 42, "c": "foo"}),
34-
({}, {}),
35-
(d := {None: 42}, d),
36-
({"a": None}, {}),
37-
],
38-
)
39-
def test_remove_none_values(given: dict, expected: dict) -> None:
40-
actual = remove_none_values(given)
41-
assert actual == expected

0 commit comments

Comments
 (0)