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

   <!-- Greeting -->
   Hi @yanlizhi! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.
   
   <!-- Answer -->
   The error happens because the backend expects an integer database ID for 
filtering, but it's receiving a string like "doris-Apache Doris-1" instead. In 
Superset, the dbs.id column is an integer primary key, so filtering with a 
string causes a type mismatch and the psycopg2 error you see 
[reference](https://github.com/apache/superset/blob/f802474b07bc7a2765e57fcd6612d2b4454f5c62/superset/models/core.py).
   
   To filter datasets by database, you should first query the 
`/api/v1/database/` endpoint to get the integer ID for your database (using its 
name if needed), then use that ID in your dataset filter 
[reference](https://github.com/apache/superset/issues/33659). Sending the 
database name or a composite string directly will cause this error.
   
   Check if your frontend, API client, or any custom code is sending the 
database name instead of the integer ID when filtering datasets. If you 
recently updated Superset or customized dataset filtering, review those changes 
to ensure the correct value is being sent. If you’re using the API directly, 
always use the integer database ID in your filters.
   
   
   <!-- 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/99b8ed5b-595a-42b2-a37e-d74fb13ee2ba?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/99b8ed5b-595a-42b2-a37e-d74fb13ee2ba?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/99b8ed5b-595a-42b2-a37e-d74fb13ee2ba?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/99b8ed5b-595a-42b2-a37e-d74fb13ee2ba?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/99b8ed5b-595a-42b2-a37e-d74fb13ee2ba?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/99b8ed5b-595a-42b2-a37e-d74fb13ee2ba?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/99b8ed5b-595a-42b2-a37e-d74fb13ee2ba?feedback_type=other)</sup>&nbsp;&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/33914)


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