You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/06/23 03:18:04 UTC

[GitHub] [superset] lehug opened a new issue #15316: add filter with Chinese, then cause Issue 1002,but SQL exactly works well

lehug opened a new issue #15316:
URL: https://github.com/apache/superset/issues/15316


   add filter with Chinese, then cause Issue 1002,but SQL exactly works well .
   the filter is `code_project = '中文'`
   
   ### Actual results
   change to `line chart` then `Error: 'charmap' codec can't encode characters in position 233-235: character maps to <undefined>
   
   `
   response 
   `{"cache_key": "45f4a4f7a632467ddf2b39a3f518891b", "cached_dttm": null, "cache_timeout": 300, "errors": [{"message": "SELECT DATE(page_visit_at) AS __timestamp,\n       session_id AS session_id,\n       COUNT(*) AS count\nFROM `ray-tool-test`.user_behavior_record\nINNER JOIN\n  (SELECT session_id AS session_id__,\n          COUNT(*) AS mme_inner__\n   FROM `ray-tool-test`.user_behavior_record\n   WHERE code_project = '\u7231\u5bb6\u6821'\n     AND page_visit_at >= '2021-06-08 00:00:00.000000'\n     AND page_visit_at < '2021-06-23 00:00:00.000000'\n   GROUP BY session_id\n   ORDER BY mme_inner__ DESC\n   LIMIT 100) AS anon_1 ON session_id = session_id__\nWHERE page_visit_at >= '2021-06-08 00:00:00.000000'\n  AND page_visit_at < '2021-06-23 00:00:00.000000'\n  AND code_project = '\u7231\u5bb6\u6821'\nGROUP BY session_id,\n         DATE(page_visit_at)\nLIMIT 10000", "error_type": "GENERIC_DB_ENGINE_ERROR", "level": "error", "extra": {"engine_name": "MySQL", "issue_codes": [{"code": 1
 002, "message": "Issue 1002 - The database returned an unexpected error."}]}}], "form_data": {"viz_type": "line", "datasource": "2__table", "slice_id": 3, "url_params": {}, "time_range_endpoints": ["inclusive", "exclusive"], "granularity_sqla": "page_visit_at", "time_grain_sqla": "P1D", "time_range": "DATEADD(DATETIME(\"2021-06-23T00:00:00\"), -15, day) : 2021-06-23T00:00:00", "metrics": ["count"], "adhoc_filters": [{"expressionType": "SIMPLE", "subject": "code_project", "operator": "==", "operatorId": "EQUALS", "comparator": "\u7231\u5bb6\u6821", "clause": "WHERE", "sqlExpression": null, "isExtra": false, "isNew": false, "filterOptionName": "filter_01thl2lpi5j1_fogewr6s898"}], "groupby": ["session_id"], "limit": 100, "order_desc": true, "row_limit": 10000, "color_scheme": "supersetColors", "label_colors": {}, "show_brush": "auto", "rich_tooltip": true, "line_interpolation": "linear", "bottom_margin": "auto", "x_ticks_layout": "auto", "x_axis_format": "smart_date", "left_margin": "a
 uto", "y_axis_format": "SMART_NUMBER", "y_axis_bounds": [null, null], "rolling_type": "None", "comparison_type": "values", "annotation_layers": [], "applied_time_extras": {}, "where": "", "having": "", "having_filters": [], "filters": [{"col": "code_project", "op": "==", "val": "\u7231\u5bb6\u6821"}]}, "is_cached": false, "query": "SELECT DATE(page_visit_at) AS __timestamp,\n       session_id AS session_id,\n       COUNT(*) AS count\nFROM `ray-tool-test`.user_behavior_record\nINNER JOIN\n  (SELECT session_id AS session_id__,\n          COUNT(*) AS mme_inner__\n   FROM `ray-tool-test`.user_behavior_record\n   WHERE code_project = '\u7231\u5bb6\u6821'\n     AND page_visit_at >= '2021-06-08 00:00:00.000000'\n     AND page_visit_at < '2021-06-23 00:00:00.000000'\n   GROUP BY session_id\n   ORDER BY mme_inner__ DESC\n   LIMIT 100) AS anon_1 ON session_id = session_id__\nWHERE page_visit_at >= '2021-06-08 00:00:00.000000'\n  AND page_visit_at < '2021-06-23 00:00:00.000000'\n  AND code_pro
 ject = '\u7231\u5bb6\u6821'\nGROUP BY session_id,\n         DATE(page_visit_at)\nLIMIT 10000", "from_dttm": 1623110400000.0, "to_dttm": 1624406400000.0, "status": "failed", "stacktrace": null, "rowcount": 0, "applied_filters": [{"column": "code_project"}], "rejected_filters": []}`
   change to `filter box' then `Unexpected error
   Error: 'charmap' codec can't encode characters in position 199-201: character maps to <undefined>`
   
   ### Environment
   
   (please complete the following information):
   - helm 0.1.5
   - superset version: `3f158fd32e50ba08a09689422709d2d8911c69fd692b96f06e12377b08c39a0b` latest
   - python version: `python --version`
   - node.js version: `node -v`
   
   


-- 
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.

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


[GitHub] [superset] lehug commented on issue #15316: add filter with Chinese, then cause Issue 1002,but SQL exactly works well

Posted by GitBox <gi...@apache.org>.
lehug commented on issue #15316:
URL: https://github.com/apache/superset/issues/15316#issuecomment-869440558


   > @lehug , This problem looks like with your system environment. please check environment variable `PYTHONIOENCODING`
   data -- database, then edit SQLALCHEMY URI, add ?charset=utf8, then fix~
   
   
   


-- 
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


[GitHub] [superset] lehug commented on issue #15316: add filter with Chinese, then cause Issue 1002,but SQL exactly works well

Posted by GitBox <gi...@apache.org>.
lehug commented on issue #15316:
URL: https://github.com/apache/superset/issues/15316#issuecomment-869436794


   data -- database, then edit SQLALCHEMY URI, add `?charset=utf8`, then fix~


-- 
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


[GitHub] [superset] lehug commented on issue #15316: add filter with Chinese, then cause Issue 1002,but SQL exactly works well

Posted by GitBox <gi...@apache.org>.
lehug commented on issue #15316:
URL: https://github.com/apache/superset/issues/15316#issuecomment-869398283


   @zhaoyongjie 
   ```
   SELECT DATE(page_visit_at) AS __timestamp,
          count(DISTINCT session_id) AS `COUNT_DISTINCT(session_id)`
   FROM `ray-test`.user_behavior_record
   WHERE page_visit_at >= '2021-06-08 00:00:00.000000'
     AND page_visit_at < '2021-06-23 00:00:00.000000'
     AND ((code_project = '中文'))
   GROUP BY DATE(page_visit_at)
   LIMIT 500;
   ```
   
   it works well with mysql woekbench, but not work well with superset


-- 
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


[GitHub] [superset] zhaoyongjie commented on issue #15316: add filter with Chinese, then cause Issue 1002,but SQL exactly works well

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on issue #15316:
URL: https://github.com/apache/superset/issues/15316#issuecomment-869436985


   @lehug , This problem looks like with your system environment. please check environment variable `PYTHONIOENCODING`


-- 
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


[GitHub] [superset] zhaoyongjie commented on issue #15316: add filter with Chinese, then cause Issue 1002,but SQL exactly works well

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on issue #15316:
URL: https://github.com/apache/superset/issues/15316#issuecomment-867296475


   It works fine in my local, can you provide context for this issue?
   
   ![image](https://user-images.githubusercontent.com/2016594/123195675-2a726b00-d4db-11eb-8a5f-66cb1bdf38fd.png)
   


-- 
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.

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


[GitHub] [superset] lehug commented on issue #15316: add filter with Chinese, then cause Issue 1002,but SQL exactly works well

Posted by GitBox <gi...@apache.org>.
lehug commented on issue #15316:
URL: https://github.com/apache/superset/issues/15316#issuecomment-869401216


   ```
   2021-06-28 06:33:06,052:WARNING:superset.connectors.sqla.models:Query SELECT DATE(page_visit_at) AS __timestamp,
          count(DISTINCT session_id) AS `COUNT_DISTINCT(session_id)`
   FROM `ray-tool-test`.user_behavior_record
   WHERE page_visit_at >= '2021-06-08 00:00:00.000000'
     AND page_visit_at < '2021-06-23 00:00:00.000000'
     AND ((code_project = '中文'))
   GROUP BY DATE(page_visit_at)
   LIMIT 500 on schema ray-tool-test failed
   Traceback (most recent call last):
     File "/app/superset/connectors/sqla/models.py", line 1508, in query
       df = self.database.get_df(sql, self.schema, mutator=assign_column_label)
     File "/app/superset/models/core.py", line 411, in get_df
       self.db_engine_spec.execute(cursor, sqls[-1])
     File "/app/superset/db_engine_specs/base.py", line 1085, in execute
       raise cls.get_dbapi_mapped_exception(ex)
     File "/app/superset/db_engine_specs/base.py", line 1083, in execute
       cursor.execute(query)
     File "/usr/local/lib/python3.7/site-packages/MySQLdb/cursors.py", line 188, in execute
       query = query.encode(db.encoding)
     File "/usr/local/lib/python3.7/encodings/cp1252.py", line 12, in encode
       return codecs.charmap_encode(input,errors,encoding_table)
   UnicodeEncodeError: 'charmap' codec can't encode characters in position 278-279: character maps to <undefined>
   
   ```


-- 
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


[GitHub] [superset] zhaoyongjie commented on issue #15316: add filter with Chinese, then cause Issue 1002,but SQL exactly works well

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on issue #15316:
URL: https://github.com/apache/superset/issues/15316#issuecomment-869442368


   Nice. thank for this debuging.


-- 
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


[GitHub] [superset] lehug edited a comment on issue #15316: add filter with Chinese, then cause Issue 1002,but SQL exactly works well

Posted by GitBox <gi...@apache.org>.
lehug edited a comment on issue #15316:
URL: https://github.com/apache/superset/issues/15316#issuecomment-869398283


   @zhaoyongjie 
   ```
   SELECT DATE(page_visit_at) AS __timestamp,
          count(DISTINCT session_id) AS `COUNT_DISTINCT(session_id)`
   FROM `ray-test`.user_behavior_record
   WHERE page_visit_at >= '2021-06-08 00:00:00.000000'
     AND page_visit_at < '2021-06-23 00:00:00.000000'
     AND ((code_project = '中文'))
   GROUP BY DATE(page_visit_at)
   LIMIT 500;
   ```
   
   it works well with mysql woekbench, but not work well with superset.
   when I change "中文" to "abc", then no error happen.


-- 
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


[GitHub] [superset] lehug closed issue #15316: add filter with Chinese, then cause Issue 1002,but SQL exactly works well

Posted by GitBox <gi...@apache.org>.
lehug closed issue #15316:
URL: https://github.com/apache/superset/issues/15316


   


-- 
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