Skip to content

Commit

Permalink
fix: Crash caused by numpy.vectorize (#21936)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley committed Oct 26, 2022
1 parent 4002406 commit 059e53a
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 059e53a

Please sign in to comment.