Skip to content

Commit

Permalink
swap
Browse files Browse the repository at this point in the history
  • Loading branch information
lalo committed Feb 1, 2023
1 parent 11f713f commit 58d15b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/vowpalwabbit/pyvw.py
Original file line number Diff line number Diff line change
Expand Up @@ -1724,14 +1724,14 @@ def get_feature_id(
if isinstance(feature, int):
return feature
if isinstance(feature, str):
if ns_hash is None and type(ns) == NamespaceId:
if ns_hash is None:
if type(ns) != NamespaceId:
ns = self.get_ns(ns)
ns_hash = (
self.vw.hash_space(ns.full)
if ns.full
else self.vw.hash_space(ns.ns)
)
elif ns_hash is None:
ns_hash = self.vw.hash_space(ns)
return self.vw.hash_feature(feature, ns_hash)
raise Exception("cannot extract feature of type: " + str(type(feature)))

Expand Down

0 comments on commit 58d15b1

Please sign in to comment.