fix: ensure numeric values for extra metadata_cache_timeout payloads
SUMMARY
We identified an issue where FileSystemCache is used, setting values for table_cache_timeout and schema_cache_timeout in the database properties modal leads to failures in fetching schema and table lists in SQLLab. The requests to /api/v1/database/{dbId}/tables/?q=(force:!f,schema_name:{schemaName}) were returning a 422 UNPROCESSABLE ENTITY status.
The root cause of the issue was that table_cache_timeout and schema_cache_timeout values were being serialized as strings instead of numbers. The backend expected numeric values, resulting in the 422 error when it encountered strings. To resolve this, we need to ensure that these values are correctly converted to numbers before they are sent in the payload.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
https://github.com/apache/superset/assets/8809047/86dd8c56-0015-4450-ad51-bb49e7f85f2b
After
https://github.com/apache/superset/assets/8809047/88c1f072-1637-47d6-9510-52a4b85556dd
TESTING INSTRUCTIONS
- Ensure CACHE_CONFIG is set to use FileSystemCache in config.py/superset_config.py
- Go to Settings → Database Connections
- Edit a DB connection
- Go to Advanced → Performance
- Set values to
SCHEMA CACHE TIMEOUTandTABLE CACHE TIMEOUT - Go to SqlLab, select the DB you edited
- Try to refresh the schema list and table list
ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #28735
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
closing/reopening to kick-start CI. Let's see if we can get this across the finish line! CC @betodealmeida / @mistercrunch to see if we can get some 👀 on it.
Ooops, one test is failing
FAIL src/components/Chart/DrillDetail/DrillDetailMenuItems.test.tsx (26.67 s)
@kidusmakonnen can you look into the test failure? Would love to get this across the finish line :D
@kidusmakonnen can you look into the test failure? Would love to get this across the finish line :D
Test is passing locally, hopefully CI agrees this time :sweat_smile:
Merged! Thank you for the contribution!