You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "betodealmeida (via GitHub)" <gi...@apache.org> on 2023/01/30 17:21:03 UTC

[GitHub] [superset] betodealmeida commented on a diff in pull request #22881: fix: edit pyarrow stringify to better handle emojis and accents

betodealmeida commented on code in PR #22881:
URL: https://github.com/apache/superset/pull/22881#discussion_r1090922138


##########
superset/result_set.py:
##########
@@ -70,9 +70,14 @@ def stringify_values(array: NDArray[Any]) -> NDArray[Any]:
         for obj in it:
             if na_obj := pd.isna(obj):
                 # pandas <NA> type cannot be converted to string
-                obj[na_obj] = None  # type: ignore
+                obj[na_obj] = None
             else:
-                obj[...] = stringify(obj)  # type: ignore
+                try:
+                    # for simple string conversions
+                    # this handles odd character types better
+                    obj[...] = obj.astype(str)

Review Comment:
   I think it should be fine, because even though we're using `json.dumps()` in `stringify` we're not trying to generate valid JSON, we're just trying to make sure complex/nested objects can be converted to a string. So it should be fine to update the tests to match the new output.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org