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

   <!-- Answer -->
   Even if the column is visible in your dataset metadata, Superset 6 
introduced stricter validation and a regression that can cause this exact error 
in embedded dashboards—especially if you use Row Level Security (RLS) rules 
with guest tokens.
   
   If your dataset is a virtual dataset (i.e., defined by a custom SQL query, 
not mapped directly to a physical table), Superset 6 can apply the RLS clause 
twice: once to the underlying table and again to the outer query. This double 
application causes SQL alias mismatches, so even valid columns like 
contract_document_number can trigger "unknown column" errors in the generated 
SQL, despite being present in the dataset and the database. This is a 
regression from Superset 5 and is tracked here: [Superset 6 double RLS 
regression](https://github.com/apache/superset/issues/37359).
   
   To confirm if this is the cause, try these steps:
   1. Remove all RLS rules (including guest token RLS) and reload the simple 
chart. If the error disappears, RLS is the trigger.
   2. If you must use RLS, and your dataset is virtual, try switching to a 
physical dataset (direct table mapping) as a temporary workaround.
   3. If you can, share the full SQL query Superset generates (from the error 
details or logs)—this will help confirm if the double RLS application is 
happening.
   
   There is currently no config workaround except using physical datasets. The 
fix will require a Superset code update to prevent double RLS application in 
this scenario. More details and tracking are here: [PR 
37395](https://github.com/apache/superset/pull/37395).
   
   Let me know if you need help checking if your dataset is virtual or 
physical, or if you want to try the RLS removal test.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/8567c72f-8fbe-4d03-ae31-ee51c3fee1eb?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/8567c72f-8fbe-4d03-ae31-ee51c3fee1eb?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/8567c72f-8fbe-4d03-ae31-ee51c3fee1eb?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/8567c72f-8fbe-4d03-ae31-ee51c3fee1eb?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/8567c72f-8fbe-4d03-ae31-ee51c3fee1eb?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/8567c72f-8fbe-4d03-ae31-ee51c3fee1eb?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/8567c72f-8fbe-4d03-ae31-ee51c3fee1eb?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Even%20if%20the%20column%20is%20visible%20in%20your%20dataset%20metadata%2C%20Superset%206%20introduced%20stricter%20validation%20and%20a%20regression%20that%20can%20cause%20this%20exact%20error%20in%20embedded%20dashboards%E2%80%94especially%20if%20you%20use%20Row%20Level%20Security%20%28RLS%29%20rules%20with%20guest%20tokens.%0A%0AIf%20your%20dataset%20is%20a%20virtual%20dataset%20%28i.e.%2C%20defined%20by%20a%20custom%20SQL%20query%2C%20not%20mapped%20directly%20to%20a%20physical%20table%29%2C%20Superset%206%20can%20apply%20the%20RLS%20clause%20twice%3A%20once%20to%20the%20underlying%20table%20and%20again%20to%20the%20outer%20query.%20This%20double%20application%20causes%20SQL%20alias%20mismatches%2C%20so%20even%20valid%20columns%20like%20contra
 
ct_document_number%20can%20trigger%20%22unknown%20column%22%20errors%20in%20the%20generated%20SQL%2C%20despite%20being%20present%20in%20the%20dataset%20and%20the%20database.%20This%20is%20a%20regression%20from%20Superset%205%20and%20is%20tracked%20here%3A%20%5BSuperset%206%20double%20RLS%20regression%5D%28https%3A//github.com/apache/superset/issues/37359%29.%0A%0ATo%20confirm%20if%20this%20is%20the%20cause%2C%20try%20these%20steps%3A%0A1.%20Remove%20all%20RLS%20rules%20%28including%20guest%20token%20RLS%29%20and%20reload%20the%20simple%20chart.%20If%20the%20error%20disappears%2C%20RLS%20is%20the%20trigger.%0A2.%20If%20you%20must%20use%20RLS%2C%20and%20your%20dataset%20is%20virtual%2C%20try%20switching%20to%20a%20physical%20dataset%20%28direct%20table%20mapping%29%20as%20a%20temporary%20workaround.%0A3.%20If%20you%20can%2C%20share%20the%20full%20SQL%20query%20Superset%20generates%20%28from%20the%20error%20details%20or%20logs%29%E2%80%94this%20will%20help%20confirm%20if%20the%20double
 
%20RLS%20application%20is%20happening.%0A%0AThere%20is%20currently%20no%20config%20workaround%20except%20using%20physical%20datasets.%20The%20fix%20will%20require%20a%20Superset%20code%20update%20to%20prevent%20double%20RLS%20application%20in%20this%20scenario.%20More%20details%20and%20tracking%20are%20here%3A%20%5BPR%2037395%5D%28https%3A//github.com/apache/superset/pull/37395%29.%0A%0ALet%20me%20know%20if%20you%20need%20help%20checking%20if%20your%20dataset%20is%20virtual%20or%20physical%2C%20or%20if%20you%20want%20to%20try%20the%20RLS%20removal%20test.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37551)


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