Skip to content

Commit 0e5e55d

Browse files
🧪 Simplify Labels.parse implementation
Switched to using `s.split()` which more cleanly handles empty strings and multiple spaces compared to the previous explicit checks. Co-authored-by: rnovatorov <[email protected]>
1 parent f953135 commit 0e5e55d

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎src/enapter/http/api/telemetry/labels.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ class Labels(collections.UserDict):
66

77
@classmethod
88
def parse(cls, s: str) -> Self:
9-
if not s:
10-
return cls()
11-
return cls(kv.split("=") for kv in s.split(" ") if kv)
9+
return cls(kv.split("=") for kv in s.split())
1210

1311
@property
1412
def device(self) -> str:

0 commit comments

Comments
 (0)