Skip to content

Commit

Permalink
moved from case to if statement
Browse files Browse the repository at this point in the history
not sure if our linter/parser was happy with the case statement so moved it back to an if statement
  • Loading branch information
mickeyyawn committed Nov 20, 2023
1 parent c0552d9 commit 4b79944
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions polygon/websocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,16 @@ def _parse_subscription(s: str):
split = s.split(".")
length = len(split)

match length:
case _ if length < 2:
logger.warning("invalid subscription:", s)
return [None, None]
case 3:
return split[0], split[1] + "." + split[2]
case _ if length > 3:
logger.warning("invalid subscription:", s)
return [None, None]
case _:
return split[0], split[1]

if length < 2:
logger.warning("invalid subscription:", s)
return [None, None]
if length == 2:
return split[0], split[1]
if length == 3:
return split[0], split[1] + "." + split[2]
if length > 3:
logger.warning("invalid subscription:", s)
return [None, None]


def subscribe(self, *subscriptions: str):
Expand Down

0 comments on commit 4b79944

Please sign in to comment.