Skip to content

Commit

Permalink
modified isintance to include group when groups is len 0
Browse files Browse the repository at this point in the history
  • Loading branch information
aaTman committed Oct 30, 2024
1 parent dc66b2c commit 444ef01
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kerchunk/combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ def _get_value(self, index, z, var, fn=None):
elif isinstance(selector, list):
o = selector[index]
elif isinstance(selector, re.Pattern):
o = selector.search(fn).groups()[0]
if len(selector.search(fn).groups()) == 0:
o = selector.search(fn).group()
else:
o = selector.search(fn).groups()[0]
elif not isinstance(selector, str):
# constant, should be int or float
o = selector
Expand Down

0 comments on commit 444ef01

Please sign in to comment.