Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix: Crash caused by numpy.vectorize (apache#21936)
Browse files Browse the repository at this point in the history
(cherry picked from commit 059e53a)
  • Loading branch information
john-bodley committed Nov 3, 2022
1 parent 0dcdf9e commit d13f568
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 d13f568

Please sign in to comment.