-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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(cache): respect default cache timeout on v1 chart data requests #21441
Conversation
3cd5a1a
to
1c43b47
Compare
1c43b47
to
a67bafd
Compare
Codecov Report
@@ Coverage Diff @@
## master #21441 +/- ##
==========================================
- Coverage 66.53% 65.20% -1.34%
==========================================
Files 1791 1791
Lines 68599 68602 +3
Branches 7320 7320
==========================================
- Hits 45645 44731 -914
- Misses 21064 21981 +917
Partials 1890 1890
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
272bfe7
to
694356b
Compare
694356b
to
e03c418
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the comprehensive tests.
@@ -32,4 +32,4 @@ superset init | |||
|
|||
echo "Running tests" | |||
|
|||
pytest --durations-min=2 --maxfail=1 --cov-report= --cov=superset "$@" | |||
pytest --durations-min=2 --maxfail=1 --cov-report= --cov=superset ./tests/integration_tests "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assuming we were running unittests twice
hi @villebro have 1 question. is this still in development to use recently I have seen a problem its not respecting cache timeout setup in chart properties (I created ticket #21635 ) so to fix it, should we send chart's timeout from frontend inside form_data to chart.data api in |
SUMMARY
Currently the default timeout set in the cache config is not respected in v1 chart data requests. Notice specifically how the following lines in
viz.py
are missing inquery_context_processor.py
:superset/superset/viz.py
Lines 434 to 435 in 79cb268
In addition,
custom_cache_timeout
was missing from the chart data request schema, making it impossible to override the defaults. This PR fixes both errors and adds tests to cover default timeout, cache config timeout and custom timeout.Finally, it appears we've been running the unit tests every time we run integration tests (this can be confirmed by looking at integration CI workflows which execute unit tests after integration tests). This changes the integration test script so that only the integration tests are executed.
See CI output after (1732 items):
tests/integration_tests/access_tests.py ..................... [ 1%]
tests/integration_tests/base_api_tests.py ...... [ 1%]
tests/integration_tests/cache_tests.py .. [ 1%]
tests/integration_tests/celery_tests.py ................... [ 2%]
tests/integration_tests/cli_tests.py ............. [ 3%]
tests/integration_tests/commands_test.py .... [ 3%]
tests/integration_tests/core_tests.py .................................. [ 5%]
.................................. [ 7%]
tests/integration_tests/dashboard_tests.py .................. [ 8%]
tests/integration_tests/datasource_tests.py ....................... [ 10%]
tests/integration_tests/dict_import_export_tests.py ....... [ 10%]
tests/integration_tests/dynamic_plugins_tests.py .. [ 10%]
tests/integration_tests/email_tests.py ........... [ 11%]
tests/integration_tests/event_logger_tests.py ........ [ 11%]
tests/integration_tests/form_tests.py .. [ 11%]
tests/integration_tests/import_export_tests.py ss.............. [ 12%]
tests/integration_tests/log_api_tests.py ...... [ 13%]
tests/integration_tests/log_model_view_tests.py .. [ 13%]
tests/integration_tests/logging_configurator_tests.py . [ 13%]
tests/integration_tests/model_tests.py ....................... [ 14%]
tests/integration_tests/query_context_tests.py ......................... [ 15%]
... [ 16%]
tests/integration_tests/result_set_tests.py ............... [ 17%]
tests/integration_tests/security_tests.py .............................. [ 18%]
................................. [ 20%]
tests/integration_tests/sql_validator_tests.py ............ [ 21%]
tests/integration_tests/sqla_models_tests.py ........................... [ 22%]
. [ 22%]
tests/integration_tests/sqllab_tests.py ................................ [ 24%]
..... [ 25%]
tests/integration_tests/stats_logger_tests.py .. [ 25%]
tests/integration_tests/strategy_tests.py .. [ 25%]
tests/integration_tests/tagging_tests.py .. [ 25%]
tests/integration_tests/test_jinja_context.py ................... [ 26%]
tests/integration_tests/thumbnails_tests.py s........s...... [ 27%]
tests/integration_tests/utils_tests.py ................................. [ 29%]
.................. [ 30%]
tests/integration_tests/viz_tests.py ................................... [ 32%]
...................... [ 33%]
tests/integration_tests/advanced_data_type/api_tests.py ..... [ 34%]
tests/integration_tests/annotation_layers/api_tests.py ................. [ 34%]
................. [ 35%]
tests/integration_tests/async_events/api_tests.py ..... [ 36%]
tests/integration_tests/available_domains/api_tests.py . [ 36%]
tests/integration_tests/cachekeys/api_tests.py ..... [ 36%]
tests/integration_tests/charts/api_tests.py ............................ [ 38%]
............................ [ 39%]
. [ 94%]
tests/integration_tests/security/analytics_db_safety_tests.py .. [ 94%]
tests/integration_tests/security/api_tests.py ....... [ 95%]
tests/integration_tests/security/guest_token_security_tests.py ......... [ 95%]
............. [ 96%]
tests/integration_tests/security/migrate_roles_tests.py ......... [ 97%]
tests/integration_tests/security/row_level_security_tests.py ........... [ 97%]
... [ 97%]
tests/integration_tests/sql_lab/test_execute_sql_statements.py . [ 98%]
tests/integration_tests/tasks/async_queries_tests.py ...... [ 98%]
tests/integration_tests/users/api_tests.py ..... [ 98%]
tests/integration_tests/utils/cache_manager_tests.py .... [ 98%]
tests/integration_tests/utils/core_tests.py ... [ 99%]
tests/integration_tests/utils/csv_tests.py .. [ 99%]
tests/integration_tests/utils/decorators_tests.py .. [ 99%]
tests/integration_tests/utils/encrypt_tests.py .. [ 99%]
tests/integration_tests/utils/hashing_tests.py .... [ 99%]
tests/integration_tests/utils/machine_auth_tests.py ... [ 99%]
tests/integration_tests/utils/public_interfaces_test.py s.. [100%]
vs before this PR (2252 items; note that unit tests are 520 tests, which is precisely the difference):
tests/example_data/data_generator/tests/test_string_generator.py . [ 0%]
tests/integration_tests/access_tests.py ..................... [ 0%]
tests/integration_tests/base_api_tests.py ...... [ 1%]
tests/integration_tests/cache_tests.py .. [ 1%]
tests/integration_tests/celery_tests.py ................... [ 2%]
tests/integration_tests/cli_tests.py ............. [ 2%]
tests/integration_tests/commands_test.py .... [ 2%]
tests/integration_tests/core_tests.py .................................. [ 4%]
.................................. [ 5%]
tests/integration_tests/dashboard_tests.py .................. [ 6%]
tests/integration_tests/datasource_tests.py ....................... [ 7%]
tests/integration_tests/dict_import_export_tests.py ....... [ 8%]
tests/integration_tests/dynamic_plugins_tests.py .. [ 8%]
tests/integration_tests/email_tests.py ........... [ 8%]
tests/integration_tests/event_logger_tests.py ........ [ 9%]
tests/integration_tests/form_tests.py .. [ 9%]
tests/integration_tests/import_export_tests.py ss.............. [ 9%]
tests/integration_tests/log_api_tests.py ...... [ 10%]
tests/integration_tests/log_model_view_tests.py .. [ 10%]
tests/integration_tests/logging_configurator_tests.py . [ 10%]
tests/integration_tests/model_tests.py ....................... [ 11%]
tests/integration_tests/query_context_tests.py ......................... [ 12%]
... [ 12%]
tests/integration_tests/result_set_tests.py ............... [ 13%]
tests/integration_tests/security_tests.py .............................. [ 14%]
................................. [ 15%]
tests/integration_tests/sql_validator_tests.py ............ [ 16%]
tests/integration_tests/sqla_models_tests.py ........................... [ 17%]
. [ 17%]
tests/integration_tests/sqllab_tests.py ................................ [ 19%]
..... [ 19%]
tests/integration_tests/stats_logger_tests.py .. [ 19%]
tests/integration_tests/strategy_tests.py .. [ 19%]
tests/integration_tests/tagging_tests.py .. [ 19%]
tests/integration_tests/test_jinja_context.py ................... [ 20%]
tests/integration_tests/thumbnails_tests.py s........s...... [ 21%]
tests/integration_tests/utils_tests.py ................................. [ 22%]
.................. [ 23%]
tests/integration_tests/viz_tests.py ................................... [ 25%]
...................... [ 26%]
tests/integration_tests/advanced_data_type/api_tests.py ..... [ 26%]
tests/integration_tests/annotation_layers/api_tests.py ................. [ 26%]
................. [ 27%]
tests/integration_tests/async_events/api_tests.py ..... [ 27%]
tests/integration_tests/available_domains/api_tests.py . [ 28%]
tests/integration_tests/cachekeys/api_tests.py ..... [ 28%]
tests/integration_tests/charts/api_tests.py ............................ [ 29%]
............................ [ 30%]
tests/integration_tests/charts/commands_tests.py ............ [ 31%]
tests/integration_tests/charts/schema_tests.py ... [ 31%]
tests/integration_tests/charts/data/api_tests.py .......ss.............. [ 32%]
...................... [ 33%]
tests/integration_tests/css_templates/api_tests.py ................ [ 34%]
tests/integration_tests/dashboards/api_tests.py ........................ [ 35%]
................................................. [ 37%]
tests/integration_tests/dashboards/commands_tests.py .......... [ 37%]
tests/integration_tests/dashboards/dao_tests.py .. [ 37%]
tests/integration_tests/dashboards/filter_sets/create_api_tests.py ..... [ 38%]
....................... [ 39%]
tests/integration_tests/dashboards/filter_sets/delete_api_tests.py ..... [ 39%]
..... [ 39%]
tests/integration_tests/dashboards/filter_sets/get_api_tests.py ...... [ 39%]
tests/integration_tests/dashboards/filter_sets/update_api_tests.py ..... [ 40%]
.................. [ 40%]
tests/integration_tests/dashboards/filter_state/api_tests.py ........... [ 41%]
........... [ 41%]
tests/integration_tests/dashboards/permalink/api_tests.py .... [ 42%]
tests/integration_tests/dashboards/security/security_dataset_tests.py .. [ 42%]
..... [ 42%]
tests/integration_tests/dashboards/security/security_rbac_tests.py ..... [ 42%]
......... [ 42%]
tests/integration_tests/databases/api_tests.py ......................... [ 44%]
....................................................... [ 46%]
tests/integration_tests/databases/commands_tests.py ..s................. [ 47%]
... [ 47%]
tests/integration_tests/datasets/api_tests.py .........s................ [ 48%]
........s..............s......................... [ 50%]
tests/integration_tests/datasets/commands_tests.py ........... [ 51%]
tests/integration_tests/datasets/model_tests.py ... [ 51%]
tests/integration_tests/db_engine_specs/ascend_tests.py . [ 51%]
tests/integration_tests/db_engine_specs/base_engine_spec_tests.py ...... [ 51%]
......................... [ 52%]
tests/integration_tests/db_engine_specs/bigquery_tests.py .......... [ 53%]
tests/integration_tests/db_engine_specs/clickhouse_tests.py .. [ 53%]
tests/integration_tests/db_engine_specs/crate_tests.py .... [ 53%]
tests/integration_tests/db_engine_specs/dremio_tests.py . [ 53%]
tests/integration_tests/db_engine_specs/drill_tests.py . [ 53%]
tests/integration_tests/db_engine_specs/druid_tests.py .... [ 53%]
tests/integration_tests/db_engine_specs/elasticsearch_tests.py ...... [ 54%]
tests/integration_tests/db_engine_specs/firebird_tests.py ........ [ 54%]
tests/integration_tests/db_engine_specs/firebolt_tests.py .. [ 54%]
tests/integration_tests/db_engine_specs/gsheets_tests.py . [ 54%]
tests/integration_tests/db_engine_specs/hana_tests.py . [ 54%]
tests/integration_tests/db_engine_specs/hive_tests.py .................. [ 55%]
........... [ 55%]
tests/integration_tests/db_engine_specs/impala_tests.py . [ 56%]
tests/integration_tests/db_engine_specs/kylin_tests.py . [ 56%]
tests/integration_tests/db_engine_specs/mysql_tests.py ......... [ 56%]
tests/integration_tests/db_engine_specs/oracle_tests.py .......... [ 56%]
tests/integration_tests/db_engine_specs/pinot_tests.py ...... [ 57%]
tests/integration_tests/db_engine_specs/postgres_tests.py .............. [ 57%]
....... [ 58%]
tests/integration_tests/db_engine_specs/presto_tests.py ................ [ 58%]
........................... [ 60%]
tests/integration_tests/db_engine_specs/redshift_tests.py . [ 60%]
tests/integration_tests/db_engine_specs/trino_tests.py ........ [ 60%]
tests/integration_tests/embedded/api_tests.py .. [ 60%]
tests/integration_tests/embedded/dao_tests.py .. [ 60%]
tests/integration_tests/explore/api_tests.py ......... [ 60%]
tests/integration_tests/explore/form_data/api_tests.py ................. [ 61%]
........ [ 62%]
tests/integration_tests/explore/form_data/commands_tests.py ........ [ 62%]
tests/integration_tests/explore/permalink/api_tests.py ..... [ 62%]
tests/integration_tests/explore/permalink/commands_tests.py ... [ 62%]
tests/integration_tests/extensions/metastore_cache_test.py .. [ 62%]
tests/integration_tests/importexport/commands_tests.py . [ 62%]
tests/integration_tests/key_value/commands/create_test.py .. [ 63%]
tests/integration_tests/key_value/commands/delete_test.py ... [ 63%]
tests/integration_tests/key_value/commands/get_test.py ..... [ 63%]
tests/integration_tests/key_value/commands/update_test.py ... [ 63%]
tests/integration_tests/key_value/commands/upsert_test.py ... [ 63%]
tests/integration_tests/migrations/06e1e70058c7_migrate_legacy_area__tests.py . [ 63%]
[ 63%]
tests/integration_tests/migrations/ad07e4fdbaba_rm_time_range_endpoints_from_qc_3__test.py . [ 63%]
. [ 63%]
tests/integration_tests/migrations/c747c78868b6_migrating_legacy_treemap__tests.py . [ 63%]
[ 63%]
tests/integration_tests/migrations/f1410ed7ec95_migrate_native_filters_to_new_schema__tests.py . [ 63%]
. [ 63%]
tests/integration_tests/migrations/fb13d49b72f9_better_filters__tests.py . [ 63%]
[ 63%]
tests/integration_tests/migrations/fc3a3a8ff221_migrate_filter_sets_to_new_format__tests.py . [ 64%]
.. [ 64%]
tests/integration_tests/queries/api_tests.py .......... [ 64%]
tests/integration_tests/queries/saved_queries/api_tests.py ............. [ 65%]
................... [ 65%]
tests/integration_tests/queries/saved_queries/commands_tests.py ........ [ 66%]
[ 66%]
tests/integration_tests/reports/alert_tests.py .... [ 66%]
tests/integration_tests/reports/api_tests.py ........................... [ 67%]
............. [ 68%]
tests/integration_tests/reports/commands_tests.py ...................... [ 69%]
........................................................................ [ 72%]
.. [ 72%]
tests/integration_tests/reports/scheduler_tests.py ..... [ 72%]
tests/integration_tests/reports/commands/create_dashboard_report_tests.py . [ 72%]
. [ 72%]
tests/integration_tests/reports/commands/execute_dashboard_report_tests.py . [ 72%]
. [ 72%]
tests/integration_tests/security/analytics_db_safety_tests.py .. [ 73%]
tests/integration_tests/security/api_tests.py ....... [ 73%]
tests/integration_tests/security/guest_token_security_tests.py ......... [ 73%]
............. [ 74%]
tests/integration_tests/security/migrate_roles_tests.py ......... [ 74%]
tests/integration_tests/security/row_level_security_tests.py ........... [ 75%]
... [ 75%]
tests/integration_tests/sql_lab/test_execute_sql_statements.py . [ 75%]
tests/integration_tests/tasks/async_queries_tests.py ...... [ 75%]
tests/integration_tests/users/api_tests.py ..... [ 75%]
tests/integration_tests/utils/cache_manager_tests.py .... [ 76%]
tests/integration_tests/utils/core_tests.py ... [ 76%]
tests/integration_tests/utils/csv_tests.py .. [ 76%]
tests/integration_tests/utils/decorators_tests.py .. [ 76%]
tests/integration_tests/utils/encrypt_tests.py .. [ 76%]
tests/integration_tests/utils/hashing_tests.py .... [ 76%]
tests/integration_tests/utils/machine_auth_tests.py ... [ 76%]
tests/integration_tests/utils/public_interfaces_test.py s.. [ 76%]
tests/unit_tests/config_test.py ...... [ 77%]
tests/unit_tests/core_tests.py ............. [ 77%]
tests/unit_tests/dataframe_test.py .... [ 77%]
tests/unit_tests/extension_tests.py .. [ 78%]
tests/unit_tests/feature_flag_test.py ... [ 78%]
tests/unit_tests/jinja_context_test.py .. [ 78%]
tests/unit_tests/memoized_tests.py ... [ 78%]
tests/unit_tests/result_set_test.py . [ 78%]
tests/unit_tests/sql_lab_test.py ... [ 78%]
tests/unit_tests/sql_parse_tests.py ............s....................... [ 80%]
....................................................... [ 82%]
tests/unit_tests/test_jinja_context.py ................... [ 83%]
tests/unit_tests/advanced_data_type/types_tests.py ..................... [ 84%]
..... [ 84%]
tests/unit_tests/annotation_layers/schema_tests.py .................... [ 85%]
tests/unit_tests/charts/test_post_processing.py ................. [ 86%]
tests/unit_tests/charts/commands/importers/v1/import_test.py .. [ 86%]
tests/unit_tests/charts/dao/dao_tests.py .. [ 86%]
tests/unit_tests/columns/test_models.py . [ 86%]
tests/unit_tests/commands/export_test.py . [ 86%]
tests/unit_tests/common/test_dataframe_utils.py . [ 86%]
tests/unit_tests/common/test_query_object_factory.py ... [ 86%]
tests/unit_tests/dao/queries_test.py . [ 86%]
tests/unit_tests/dashboards/commands/importers/v1/import_test.py .. [ 86%]
tests/unit_tests/dashboards/commands/importers/v1/utils_test.py .. [ 86%]
tests/unit_tests/databases/api_test.py ..s [ 87%]
tests/unit_tests/databases/schema_tests.py ..... [ 87%]
tests/unit_tests/databases/utils_test.py .. [ 87%]
tests/unit_tests/databases/commands/importers/v1/import_test.py .. [ 87%]
tests/unit_tests/datasets/test_models.py ............. [ 88%]
tests/unit_tests/datasets/commands/export_test.py . [ 88%]
tests/unit_tests/datasets/commands/importers/v1/import_test.py .... [ 88%]
tests/unit_tests/datasets/dao/dao_tests.py .. [ 88%]
tests/unit_tests/datasource/dao_tests.py ........ [ 88%]
tests/unit_tests/db_engine_specs/test_athena.py ... [ 88%]
tests/unit_tests/db_engine_specs/test_base.py ...... [ 89%]
tests/unit_tests/db_engine_specs/test_bigquery.py .... [ 89%]
tests/unit_tests/db_engine_specs/test_drill.py .... [ 89%]
tests/unit_tests/db_engine_specs/test_gsheets.py .... [ 89%]
tests/unit_tests/db_engine_specs/test_kusto.py ...................... [ 90%]
tests/unit_tests/db_engine_specs/test_mssql.py ......................... [ 91%]
...... [ 91%]
tests/unit_tests/db_engine_specs/test_presto.py ..... [ 92%]
tests/unit_tests/db_engine_specs/test_snowflake.py ........ [ 92%]
tests/unit_tests/db_engine_specs/test_sqlite.py ........................ [ 93%]
..... [ 93%]
tests/unit_tests/db_engine_specs/test_teradata.py ....... [ 94%]
tests/unit_tests/db_engine_specs/test_trino.py .. [ 94%]
tests/unit_tests/explore/api_test.py . [ 94%]
tests/unit_tests/explore/utils_test.py .............. [ 94%]
tests/unit_tests/importexport/api_test.py ...... [ 95%]
tests/unit_tests/key_value/utils_test.py .... [ 95%]
tests/unit_tests/models/core_test.py .. [ 95%]
tests/unit_tests/notifications/email_tests.py . [ 95%]
tests/unit_tests/pandas_postprocessing/test_aggregate.py . [ 95%]
tests/unit_tests/pandas_postprocessing/test_boxplot.py ..... [ 95%]
tests/unit_tests/pandas_postprocessing/test_compare.py ...... [ 96%]
tests/unit_tests/pandas_postprocessing/test_contribution.py . [ 96%]
tests/unit_tests/pandas_postprocessing/test_cum.py .... [ 96%]
tests/unit_tests/pandas_postprocessing/test_diff.py . [ 96%]
tests/unit_tests/pandas_postprocessing/test_flatten.py ........ [ 96%]
tests/unit_tests/pandas_postprocessing/test_geography.py ... [ 96%]
tests/unit_tests/pandas_postprocessing/test_pivot.py ....... [ 97%]
tests/unit_tests/pandas_postprocessing/test_prophet.py ss..... [ 97%]
tests/unit_tests/pandas_postprocessing/test_rename.py ......... [ 97%]
tests/unit_tests/pandas_postprocessing/test_resample.py ...... [ 98%]
tests/unit_tests/pandas_postprocessing/test_rolling.py ..... [ 98%]
tests/unit_tests/pandas_postprocessing/test_select.py . [ 98%]
tests/unit_tests/pandas_postprocessing/test_sort.py . [ 98%]
tests/unit_tests/pandas_postprocessing/test_utils.py . [ 98%]
tests/unit_tests/tables/test_models.py . [ 98%]
tests/unit_tests/tasks/test_cron_util.py ......................... [ 99%]
tests/unit_tests/utils/cache_test.py . [ 99%]
tests/unit_tests/utils/date_parser_tests.py ....... [ 99%]
tests/unit_tests/utils/urls_tests.py .. [100%]
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION