You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2022/10/25 17:34:16 UTC

[superset] branch john-bodley--fix-crash-numpy-vectorize created (now 12d7a75cff)

This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a change to branch john-bodley--fix-crash-numpy-vectorize
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 12d7a75cff fix: Crash caused by numpy.vectorize

This branch includes the following new commits:

     new 12d7a75cff fix: Crash caused by numpy.vectorize

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[superset] 01/01: fix: Crash caused by numpy.vectorize

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch john-bodley--fix-crash-numpy-vectorize
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 12d7a75cff4b11b57ef3a760657b0e851dced032
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Tue Oct 25 10:34:08 2022 -0700

    fix: Crash caused by numpy.vectorize
---
 superset/result_set.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/superset/result_set.py b/superset/result_set.py
index b8a5abb6d1..f9d28a2393 100644
--- a/superset/result_set.py
+++ b/superset/result_set.py
@@ -63,8 +63,12 @@ def stringify(obj: Any) -> str:
 
 
 def stringify_values(array: np.ndarray) -> np.ndarray:
-    vstringify = np.vectorize(stringify)
-    return vstringify(array)
+    result = np.copy(array)
+
+    for obj in np.nditer(result, flags=["refs_ok"], op_flags=["readwrite"]):
+        obj[...] = stringify(obj)
+    
+    return result
 
 
 def destringify(obj: str) -> Any: