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

   <!-- Answer -->
   The 400 Bad Request error you're encountering when using the Celery warm-up 
cache in Superset version 4.0.2 is likely due to a validation error in the 
request body. The `warm_up_cache` endpoint expects a JSON payload that conforms 
to the `DatasetCacheWarmUpRequestSchema`. If the request body does not match 
this schema, a `ValidationError` is raised, resulting in a 400 error response.
   
   Initially, you received a 405 Method Not Allowed error, which suggests that 
the HTTP method used was incorrect. The `warm_up_cache` endpoint only allows 
the PUT method. Once you corrected the method to PUT, the request proceeded to 
the next stage, where it encountered the 400 error due to the invalid request 
body.
   
   To resolve the 400 error, ensure that your request body is correctly 
formatted according to the expected schema:
   
   ```json
   {
       "db_name": "string",  // The name of the database where the table is 
located
       "table_name": "string",  // The name of the table to warm up cache for
       "dashboard_id": integer,  // The ID of the dashboard to get filters for 
when warming cache
       "extra_filters": "string"  // Extra filters to apply when warming up 
cache
   }
   ```
   
   The fields `db_name` and `table_name` are required, while `dashboard_id` and 
`extra_filters` are optional 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset/datasets/api.py)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset/datasets/schemas.py)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


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