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 2023/01/13 15:28:42 UTC

[GitHub] [superset] jansule opened a new issue, #22722: Missing fields in the chart params JSON string

jansule opened a new issue, #22722:
URL: https://github.com/apache/superset/issues/22722

   Sometimes, when I create a chart and add it to the dashboard, the chart cannot be rendered. Instead, the `unexpected error` text is shown (see screenshot below). In the API Endpoint `GET /api/v1/chart` I can see that some fields in the JSON string of the `params` property of respective chart are missing, which seems to lead to the error. Unfortunately, this error cannot be reproduced on every try, but it seems to appear more regularly when using the `echarts_timeseries_line` viz_type. Directly adding a chart to a dashboard when saving, seems to circumvent the problem.
   
   In the explore view of respective chart, everything looks fine.
   
   #### How to reproduce the bug
   
   1. Click on `+ Chart` in the charts view
   2. Select a dataset and chart type `Time-series Line Chart`
   4. Click `Create new chart`
   5. In explore view select a metric and a dimension
   6. Click `Create chart`
   7. Click `Save` and provide a chart name
   8. Copy the `slice_id` value from the url bar
   9. Go to the swagger documentation and set following query params in the `GET /api/v1/chart` endpoint:
   ```
   {"filters":[{"col":"id","opr":"eq","value":71}]}
   ```
   10. Replace the `71` above with the copied `slice_id`
   11. Click `Execute`
   12. Check the value of the `param` field
   13. Use `json.parse` with the content of the `param` field for better inspection
   
   ### Expected results
   
   In the working cases, the parsed content of `params` looks as follows
   
   ```json
   {
       "datasource": "14__table",
       "viz_type": "echarts_timeseries_line",
       "slice_id": 135,
       "granularity_sqla": "start_measure",
       "time_grain_sqla": "P1D",
       "time_range": "No filter",
       "metrics": [
           {
               "aggregate": "COUNT",
               "column": {
                   "advanced_data_type": null,
                   "certification_details": null,
                   "certified_by": null,
                   "column_name": "nuclide",
                   "description": null,
                   "expression": null,
                   "filterable": true,
                   "groupby": true,
                   "id": 663,
                   "is_certified": false,
                   "is_dttm": false,
                   "python_date_format": null,
                   "type": "STRING",
                   "type_generic": 1,
                   "verbose_name": null,
                   "warning_markdown": null
               },
               "datasourceWarning": false,
               "expressionType": "SIMPLE",
               "hasCustomLabel": false,
               "isNew": false,
               "label": "COUNT(nuclide)",
               "optionName": "metric_49whyu646zb_gojb50g7hm7",
               "sqlExpression": null
           }
       ],
       "groupby": [
           "nuclide"
       ],
       "adhoc_filters": [],
       "order_desc": true,
       "row_limit": 10000,
       "truncate_metric": true,
       "show_empty_columns": true,
       "comparison_type": "values",
       "annotation_layers": [],
       "forecastPeriods": 10,
       "forecastInterval": 0.8,
       "x_axis_title_margin": 15,
       "y_axis_title_margin": 15,
       "y_axis_title_position": "Left",
       "color_scheme": "supersetColors",
       "seriesType": "line",
       "only_total": true,
       "opacity": 0.2,
       "markerSize": 6,
       "show_legend": true,
       "legendType": "scroll",
       "legendOrientation": "top",
       "x_axis_time_format": "smart_date",
       "rich_tooltip": true,
       "tooltipTimeFormat": "smart_date",
       "y_axis_format": "SMART_NUMBER",
       "y_axis_bounds": [
           null,
           null
       ],
       "extra_form_data": {},
       "dashboards": [
           11
       ]
   }
   ```
   
   ### Actual results
   
   In the not working cases, the parsed content of `params` looks as follows
   
   ```json
   {
       "adhoc_filters": [],
       "applied_time_extras": {},
       "datasource": "14__table",
       "viz_type": "echarts_timeseries_line",
       "time_range": "No filter",
       "metrics": [
           {
               "expressionType": "SIMPLE",
               "column": {
                   "advanced_data_type": null,
                   "certification_details": null,
                   "certified_by": null,
                   "column_name": "nuclide",
                   "description": null,
                   "expression": null,
                   "filterable": true,
                   "groupby": true,
                   "id": 663,
                   "is_certified": false,
                   "is_dttm": false,
                   "python_date_format": null,
                   "type": "STRING",
                   "type_generic": 1,
                   "verbose_name": null,
                   "warning_markdown": null
               },
               "aggregate": "COUNT",
               "sqlExpression": null,
               "isNew": false,
               "datasourceWarning": false,
               "hasCustomLabel": false,
               "label": "COUNT(nuclide)",
               "optionName": "metric_fmfqq78gsbj_l4xfzkprywr"
           }
       ],
       "groupby": [
           "nuclide"
       ],
       "dashboards": []
   }
   ```
   
   #### Screenshots
   
   Error Message:
   ![image](https://user-images.githubusercontent.com/12186477/212350078-7f2d6844-f37c-4d3a-8b99-b375314dc3bb.png)
   
   
   
   ### Environment
   
   I am running the dev setup of the master branch based on commit `734d423ca094746ee1c2f2c1e72138ed9e69cdee`.
   
   For setup, I just run `docker-compose up`, after initially installing `superset-frontend` dependencies via `npm ci`
   
   (please complete the following information):
   
   - browser type and version: Chromium Version 108.0.5359.124 (Official Build) for Linux Mint (64-bit)
   - superset version: `superset version` master branch based on commit `734d423ca094746ee1c2f2c1e72138ed9e69cdee`
   - python version: `python --version`
   - node.js version: `node -v`
   - any feature flags active: none
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   @villebro This is what I talked about this morning.
   


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


Re: [I] Missing fields in the chart params JSON string [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #22722:
URL: https://github.com/apache/superset/issues/22722#issuecomment-1945292990

   Is this still an issue @jansule? Sorry it's slipped under the collective radar for so long. 


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


Re: [I] Missing fields in the chart params JSON string [superset]

Posted by "jansule (via GitHub)" <gi...@apache.org>.
jansule commented on issue #22722:
URL: https://github.com/apache/superset/issues/22722#issuecomment-1945556069

   I did not face this error for a while now, so I guess this can be closed.


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


Re: [I] Missing fields in the chart params JSON string [superset]

Posted by "jansule (via GitHub)" <gi...@apache.org>.
jansule closed issue #22722: Missing fields in the chart params JSON string
URL: https://github.com/apache/superset/issues/22722


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