Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard/dataset export raises schema issues #17199

Closed
LeiZhangImo opened this issue Oct 22, 2021 · 7 comments
Closed

dashboard/dataset export raises schema issues #17199

LeiZhangImo opened this issue Oct 22, 2021 · 7 comments
Assignees
Labels
question & help wanted Use Github discussions instead

Comments

@LeiZhangImo
Copy link

LeiZhangImo commented Oct 22, 2021

A clear and concise description of what the bug is.

How to reproduce the bug

  1. Go to swagger/v1 scroll down to dataset/export
  2. Click on 'Try it out'
  3. Put 1 in the 'q' filed
  4. See error

Expected results

get 200 without error

Actual results

When I use swagger for testing dataset export API in
mysupersite.com/swagger/v1
under the dataset/export part, after putting 1 in the 'q' filed, I'm getting this error:
{
"message": "Not a valid rison schema '1' is not of type 'integer'\n\nFailed validating 'type' in schema['items']:\n {'type': 'integer'}\n\nOn instance[0]:\n '1'"
}

Screenshots

image
image

Environment

  • browser type and version: Chrome/94.0.4606.61
  • superset version: superset docker: apache/superset:1.3.2
  • python version: Python 3.8.12
  • node.js version: not know
  • any feature flags active: connected to aws Anthena

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [x ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [ x] 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

I'm using the Admin user

@LeiZhangImo LeiZhangImo added the #bug Bug report label Oct 22, 2021
@StpMax
Copy link

StpMax commented Oct 22, 2021

Looks like this is issue in one of Superset dependencies. Here is request url that swagger compose:

/api/v1/dataset/export/?q=%5B%221%22%5D

%5B%221%22%5D is really ["1"]. Value send as string, instead of integer. I tend to think that the issue is in flask-appbuilder or in swagger itself.

@LeiZhangImo
Copy link
Author

Looks like this is issue in one of Superset dependencies. Here is request url that swagger compose:

/api/v1/dataset/export/?q=%5B%221%22%5D

%5B%221%22%5D is really ["1"]. Value send as string, instead of integer. I tend to think that the issue is in flask-appbuilder or in swagger itself.

Thank for your reply,
however, in the error log, it complains '1' is not type of 'integer instead of '["1"]' is not type of 'interger'

@jayakrishnankk
Copy link
Contributor

Try this instead : %5B1%2C%222%22%5D , you will get error message about '2'. 1 will be successful since 1 is integer in this encoded string. Try the given string in https://meyerweb.com/eric/tools/dencoder/

@LeiZhangImo
Copy link
Author

Try this instead : %5B1%2C%222%22%5D , you will get error message about '2'. 1 will be successful since 1 is integer in this encoded string. Try the given string in https://meyerweb.com/eric/tools/dencoder/

yes, you are right, the API work if do url encode my myself, the there must be some swagger bug.

@LeiZhangImo
Copy link
Author

after I manually fixed this error, the import/create API aways get ERROR:
#17206

@dpgaspar
Copy link
Member

This endpoint is expecting /api/v1/dataset/export/?q=(1,2,3) for example, the REST API uses Rison parameters or a JSON encoded string. Looks like swagger is sending a JSON encoded string. I'll look into finding a solution

@dpgaspar dpgaspar self-assigned this Oct 29, 2021
@jayakrishnankk
Copy link
Contributor

This endpoint is expecting /api/v1/dataset/export/?q=(1,2,3) for example, the REST API uses Rison parameters or a JSON encoded string. Looks like swagger is sending a JSON encoded string. I'll look into finding a solution

@dpgaspar - wondering if you found a solution to this.

@geido geido added question & help wanted Use Github discussions instead and removed #bug Bug report labels Jan 26, 2022
@apache apache locked and limited conversation to collaborators Feb 2, 2022
@geido geido converted this issue into discussion #18336 Feb 2, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question & help wanted Use Github discussions instead
Projects
None yet
Development

No branches or pull requests

5 participants