dosubot[bot] commented on issue #33557:
URL: https://github.com/apache/superset/issues/33557#issuecomment-2900128508

   <!-- Answer -->
   Based on what I found, the error message "Custom SQL fields cannot contain 
subqueries" is a recognized error in Superset and is defined in the codebase, 
but there is no further documentation or explanation available about its 
specific cause or handling in the official sources I checked 
([source](https://github.com/apache/superset/blob/master/superset/errors.py)).
   
   I did not find any documentation or existing issues specifically related to 
using AS with string names containing spaces in Superset. In standard SQL, 
using AS with quoted identifiers (including spaces or non-Latin characters) is 
valid, and your query executes successfully in SQL Lab, which suggests the 
database itself accepts your syntax.
   
   However, the error appears when you try to "Save or Overwrite Dataset" and 
then switch to "Chart Source." This suggests that Superset may be parsing or 
transforming the SQL in a way that triggers this error, possibly due to how it 
handles custom SQL fields or aliases with spaces or special characters.
   
   Since I could not find any official workaround or documentation addressing 
this specific scenario, here are some suggestions you can try:
   
   - Use underscores (_) instead of spaces in your column aliases, e.g., AS 
"Дата_отчетного_периода", to see if this avoids the error.
   - Try using simple ASCII-only aliases to check if the issue is related to 
non-Latin characters.
   - If possible, simplify your query to remove any expressions or CASE 
statements and see if the error persists, then gradually add complexity back to 
isolate the trigger.
   
   If none of these workarounds help, the issue may be a limitation or bug in 
how Superset processes custom SQL fields when saving datasets or generating 
charts. If you have already searched the issue tracker and found nothing 
similar, it may be worth reporting this as a potential bug with a minimal 
reproducible example.
   
   Let me know if you want help narrowing down the cause further or if you have 
more details from Superset logs or stack traces.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://go.dosu.dev/dosubot), mention 
@dosu-bot.*
   
   ---
   <sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/7f013a8d-c80e-4daa-8899-bc5167c08b27?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/7f013a8d-c80e-4daa-8899-bc5167c08b27?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/7f013a8d-c80e-4daa-8899-bc5167c08b27?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/7f013a8d-c80e-4daa-8899-bc5167c08b27?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/7f013a8d-c80e-4daa-8899-bc5167c08b27?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/7f013a8d-c80e-4daa-8899-bc5167c08b27?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/7f013a8d-c80e-4daa-8899-bc5167c08b27?feedback_type=other)</sup>
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to