Skip to content

Commit

Permalink
fix: Crash caused by numpy.vectorize
Browse files Browse the repository at this point in the history
Update result_set.py

Update result_set.py
  • Loading branch information
john-bodley committed Oct 25, 2022
1 parent 1388f21 commit 83d8739
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions superset/result_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ def stringify(obj: Any) -> str:


def stringify_values(array: np.ndarray) -> np.ndarray:
vstringify = np.vectorize(stringify)
return vstringify(array)
result = np.copy(array)

with np.nditer(result, flags=["refs_ok"], op_flags=["readwrite"]) as it:
for obj in it:
obj[...] = stringify(obj)

return result


def destringify(obj: str) -> Any:
Expand Down

0 comments on commit 83d8739

Please sign in to comment.