Unable to import dataset and feed it with CSV data from API :
Bug description
I am encountering an issue while attempting to import a dataset through the Superset API within a local Docker container environment. Despite trying various solutions, including following suggestions from previous issues and referencing external resources such as Stack Overflow (https://stackoverflow.com/questions/66015739/use-apache-superset-api-to-feed-a-dataset...), I am still unable to resolve the problem.
Additionally, I attempted to upload the file via the Swagger/v1 interface, but encountered the same error consistently:
422, superset.commands.exceptions.CommandInvalidError: Could not find a valid command to import file I have thoroughly reviewed the provided solutions and documentation, ensuring that I adhere to the correct request format, data types, and authentication procedures. However, the issue persists.
Any assistance or guidance in resolving this matter would be greatly appreciated.
Expected Behavior: The dataset should be successfully imported into Superset without encountering any errors. Actual Behavior: Encountering a 422 error with the following message: "superset.commands.exceptions.CommandInvalidError: Could not find a valid command to import file".
Additional Information:
Operating environment: local Docker container Utilized solutions from previous issues and external resources, but to no avail. Attempted to upload the file via the Swagger/v1 interface, resulting in the same error. Verified adherence to API documentation, request format, data types, and authentication procedures. Any assistance or insights into resolving this issue would be highly appreciated.
How to reproduce the bug
Attempt to import a dataset through the Superset API in a local Docker container environment. Alternatively, try uploading the file via the Swagger/v1 interface. Observe the consistent occurrence of the 422 error along with the associated error message.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@betodealmeida If you can have a look at this it would help a lot !
@EddyBess are you still facing this? Also curious why you're uploading CSV via swagger instead of via the UI. I guess swagger should work, but I see that more as a testbed than a go-to utility, personally. I wonder if Postman or similar would work. Closing this as stale for the moment, but I'm more than happy to reopen it if this is still a bug.
Hey @rusackas , I ended up giving up this solution for the problem I was facing. Basically , we have a codebook (which means that an integer is representing a string in our database) , so if a user is making a query, in the result he would have the Integer instead of the corresponding String value. My plan was to upload using the API the dataset which is making the "translation" so User could query this one to get the corresponding value.
Struggled a bit with the API (probably me that was not passing the right args to the query, it was by the time 2 weeks I started working with Superset) so I created a virtual table in DB with the dataset.
Know you know everything ahaha :)
Thank you anyway for your help , have a nice day/evening depending when you read this !