Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure numeric values for extra metadata_cache_timeout payloads #28737

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kidusmakonnen
Copy link

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

bug-superset-db-timeout.mp4

After

Screencast.from.05-28-2024.05.46.23.AM.mp4

TESTING INSTRUCTIONS

  1. Ensure CACHE_CONFIG is set to use FileSystemCache in config.py/superset_config.py
  2. Go to Settings → Database Connections
  3. Edit a DB connection
  4. Go to Advanced → Performance
  5. Set values to SCHEMA CACHE TIMEOUT and TABLE CACHE TIMEOUT
  6. Go to SqlLab, select the DB you edited
  7. Try to refresh the schema list and table list

ADDITIONAL INFORMATION

@dosubot dosubot bot added data:databases Related to database configurations and connections sqllab Namespace | Anything related to the SQL Lab labels May 28, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@john-bodley john-bodley requested a review from betodealmeida May 29, 2024 17:25
@rusackas rusackas requested a review from craig-rueda May 29, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:databases Related to database configurations and connections size/S sqllab Namespace | Anything related to the SQL Lab
Projects
None yet
1 participant