Skip to content

Commit

Permalink
Remove trailing comma from Chapel upstream change
Browse files Browse the repository at this point in the history
In chapel-lang/chapel#19713, trailing commas
were added to 1 tuples and array creation was splitting on commas,
which caused a problem with the new comma. This PR removes the trailing
comma in the case of a 1-tuple for array creation.
  • Loading branch information
bmcdonald3 committed Jun 15, 2022
1 parent a7e45b1 commit 4612f8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arkouda/pdarrayclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,10 @@ def create_pdarray(repMsg: str) -> pdarray:
mydtype = fields[2]
size = int(fields[3])
ndim = int(fields[4])

# remove comma from 1 tuple with trailing comma
if fields[5][len(fields[5])-2] == ',':
fields[5] = fields[5].replace(',', '')
shape = [int(el) for el in fields[5][1:-1].split(",")]
itemsize = int(fields[6])
except Exception as e:
Expand Down

0 comments on commit 4612f8d

Please sign in to comment.