You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/03/01 08:54:46 UTC

[GitHub] [superset] villebro opened a new pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

villebro opened a new pull request #18976:
URL: https://github.com/apache/superset/pull/18976


   ### SUMMARY
   WIP
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aae4da3) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.18%`.
   > The diff coverage is `91.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.21%   -0.19%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63526       +8     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42062     -114     
   - Misses      19681    19803     +122     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.84% <91.66%> (+<0.01%)` | :arrow_up: |
   | postgres | `81.88% <91.66%> (+<0.01%)` | :arrow_up: |
   | presto | `?` | |
   | python | `81.93% <91.66%> (-0.39%)` | :arrow_down: |
   | sqlite | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.74% <88.88%> (-0.19%)` | :arrow_down: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `97.95% <100.00%> (-0.09%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `74.31% <100.00%> (-0.22%)` | :arrow_down: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `70.00% <0.00%> (-15.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-5.65%)` | :arrow_down: |
   | ... and [16 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...aae4da3](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a73f7ac) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.01%`.
   > The diff coverage is `95.65%`.
   
   > :exclamation: Current head a73f7ac differs from pull request most recent head 62cd84f. Consider uploading reports for the commit 62cd84f to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.38%   -0.02%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63528      +10     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42173       -3     
   - Misses      19681    19694      +13     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <86.95%> (+0.01%)` | :arrow_up: |
   | mysql | `?` | |
   | postgres | `81.89% <95.65%> (+<0.01%)` | :arrow_up: |
   | presto | `52.45% <86.95%> (+0.01%)` | :arrow_up: |
   | python | `82.28% <95.65%> (-0.04%)` | :arrow_down: |
   | sqlite | `81.58% <95.65%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.04% <100.00%> (+0.12%)` | :arrow_up: |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `98.03% <100.00%> (ø)` | |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `75.22% <100.00%> (+0.70%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   | [superset/common/utils/dataframe\_utils.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3V0aWxzL2RhdGFmcmFtZV91dGlscy5weQ==) | `85.71% <0.00%> (-7.15%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `93.97% <0.00%> (-3.62%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.19% <0.00%> (-0.73%)` | :arrow_down: |
   | ... and [1 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...62cd84f](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (62cd84f) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.01%`.
   > The diff coverage is `95.65%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.38%   -0.02%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63528      +10     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42170       -6     
   - Misses      19681    19697      +16     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <86.95%> (+0.01%)` | :arrow_up: |
   | mysql | `81.84% <95.65%> (+<0.01%)` | :arrow_up: |
   | postgres | `?` | |
   | presto | `52.45% <86.95%> (+0.01%)` | :arrow_up: |
   | python | `82.27% <95.65%> (-0.05%)` | :arrow_down: |
   | sqlite | `81.58% <95.65%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.04% <100.00%> (+0.12%)` | :arrow_up: |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `98.03% <100.00%> (ø)` | |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `75.22% <100.00%> (+0.70%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/reports/commands/log\_prune.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9sb2dfcHJ1bmUucHk=) | `85.71% <0.00%> (-3.58%)` | :arrow_down: |
   | [superset/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL3V0aWxzLnB5) | `89.13% <0.00%> (-2.18%)` | :arrow_down: |
   | ... and [4 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...62cd84f](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2f207c7) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.12%`.
   > The diff coverage is `80.00%`.
   
   > :exclamation: Current head 2f207c7 differs from pull request most recent head a73f7ac. Consider uploading reports for the commit a73f7ac to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.27%   -0.13%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63522       +4     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42098      -78     
   - Misses      19681    19763      +82     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | postgres | `81.88% <100.00%> (+<0.01%)` | :arrow_up: |
   | presto | `52.45% <100.00%> (+<0.01%)` | :arrow_up: |
   | python | `82.05% <100.00%> (-0.27%)` | :arrow_down: |
   | sqlite | `81.58% <100.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...lugin-chart-echarts/src/Timeseries/transformers.ts](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy90cmFuc2Zvcm1lcnMudHM=) | `51.23% <33.33%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.00% <100.00%> (+0.07%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `70.00% <0.00%> (-15.77%)` | :arrow_down: |
   | [superset/common/utils/dataframe\_utils.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3V0aWxzL2RhdGFmcmFtZV91dGlscy5weQ==) | `85.71% <0.00%> (-7.15%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `93.97% <0.00%> (-3.62%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.19% <0.00%> (-0.73%)` | :arrow_down: |
   | [superset/views/core.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `77.06% <0.00%> (-0.45%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `89.14% <0.00%> (-0.34%)` | :arrow_down: |
   | ... and [2 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...a73f7ac](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a73f7ac) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.18%`.
   > The diff coverage is `95.65%`.
   
   > :exclamation: Current head a73f7ac differs from pull request most recent head 62cd84f. Consider uploading reports for the commit 62cd84f to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.21%   -0.19%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63528      +10     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42068     -108     
   - Misses      19681    19799     +118     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <86.95%> (+0.01%)` | :arrow_up: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `52.45% <86.95%> (+0.01%)` | :arrow_up: |
   | python | `81.94% <95.65%> (-0.38%)` | :arrow_down: |
   | sqlite | `81.58% <95.65%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.04% <100.00%> (+0.12%)` | :arrow_up: |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `98.03% <100.00%> (ø)` | |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `75.22% <100.00%> (+0.70%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `31.37% <0.00%> (-56.87%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `60.34% <0.00%> (-20.69%)` | :arrow_down: |
   | ... and [18 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...62cd84f](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817873193



##########
File path: UPDATING.md
##########
@@ -26,6 +26,7 @@ assists people when migrating to a new version.
 
 ### Breaking Changes
 
+- [18976](https://github.com/apache/superset/pull/18976): When running the app in debug mode, the app will default to use `SimpleCache` for `FILTER_STATE_CACHE_CONFIG` and `EXPLORE_FORM_DATA_CACHE_CONFIG`. When running in non-debug mode, a cache backend will need to be defined, otherwise the application will fail to start. For installations using Redis or other caching backends, it is recommended to use the same backend for both cache configs.

Review comment:
       > For installations using Redis or other caching backends, it is recommended to use the same backend for both cache configs.
   
   I'm wondering if there is a real need in configuring different cache expiration for both cache storages? If not, maybe we should just merge them---into something like `SEMI_PERSISTENT_CACHE_CONFIG` (albeit it'd be a bigger breaking change)? I don't think it matters if we save explore state cache for 23 days more.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817873193



##########
File path: UPDATING.md
##########
@@ -26,6 +26,7 @@ assists people when migrating to a new version.
 
 ### Breaking Changes
 
+- [18976](https://github.com/apache/superset/pull/18976): When running the app in debug mode, the app will default to use `SimpleCache` for `FILTER_STATE_CACHE_CONFIG` and `EXPLORE_FORM_DATA_CACHE_CONFIG`. When running in non-debug mode, a cache backend will need to be defined, otherwise the application will fail to start. For installations using Redis or other caching backends, it is recommended to use the same backend for both cache configs.

Review comment:
       > For installations using Redis or other caching backends, it is recommended to use the same backend for both cache configs.
   
   I'm wondering if there is a real need in configuring different cache expiration for both cache storages? If not, maybe we should just merge them (albeit it'd be a bigger breaking change)?  
   




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817013950



##########
File path: superset/config.py
##########
@@ -576,29 +577,43 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",

Review comment:
       We just need to make sure the failing message clearly states what are these configurations and help the user to configure them properly (maybe refer to Flask-Caching docs).




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r816966656



##########
File path: superset/config.py
##########
@@ -576,29 +577,43 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",

Review comment:
       I think it would be a good idea to warn the user when the cache is set to `NullCache` because it effectively disables the cache. This may occur because the administrator forgot to configure it properly. If not a global message, then at least for Explore/dashboard states because they won't work properly.

##########
File path: superset/utils/cache_manager.py
##########
@@ -29,40 +29,22 @@ def __init__(self) -> None:
         self._explore_form_data_cache = Cache()
 
     def init_app(self, app: Flask) -> None:
+        default_cache_config = app.config["DEFAULT_CACHE_CONFIG_FUNC"](app)
         self._cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["CACHE_CONFIG"],
-            },
+            app, {**default_cache_config, **app.config["CACHE_CONFIG"]},
         )
         self._data_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["DATA_CACHE_CONFIG"],
-            },
+            app, {**default_cache_config, **app.config["DATA_CACHE_CONFIG"]},
         )
         self._thumbnail_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["THUMBNAIL_CACHE_CONFIG"],
-            },
+            app, {**default_cache_config, **app.config["THUMBNAIL_CACHE_CONFIG"]},
         )
         self._filter_state_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["FILTER_STATE_CACHE_CONFIG"],
-            },
+            app, {**default_cache_config, **app.config["FILTER_STATE_CACHE_CONFIG"]},
         )
         self._explore_form_data_cache.init_app(
             app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["EXPLORE_FORM_DATA_CACHE_CONFIG"],
-            },
+            {**default_cache_config, **app.config["EXPLORE_FORM_DATA_CACHE_CONFIG"],},

Review comment:
       ```suggestion
               {**default_cache_config, **app.config["EXPLORE_FORM_DATA_CACHE_CONFIG"]},
   ```




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r816762727



##########
File path: superset/typing.py
##########
@@ -69,7 +57,7 @@ class AdhocColumn(TypedDict, total=False):
     sqlExpression: Optional[str]
 
 
-CacheConfig = Union[Callable[[Flask], Cache], Dict[str, Any]]
+CacheConfig = Dict[str, Any]

Review comment:
       Support for `Callable[[Flask], Cache]` based `CacheConfig`s was removed here:  #10887




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817712823



##########
File path: tests/integration_tests/cache_tests.py
##########
@@ -67,10 +67,10 @@ def test_slice_data_cache(self):
         data_cache_config = app.config["DATA_CACHE_CONFIG"]
         cache_default_timeout = app.config["CACHE_DEFAULT_TIMEOUT"]
         app.config["CACHE_DEFAULT_TIMEOUT"] = 100
+
         app.config["DATA_CACHE_CONFIG"] = {
-            "CACHE_TYPE": "simple",
+            "CACHE_TYPE": "SimpleCache",
             "CACHE_DEFAULT_TIMEOUT": 10,
-            "CACHE_KEY_PREFIX": "superset_data_cache",

Review comment:
       `CACHE_KEY_PREFIX` not supported on `SimpleCache`




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro merged pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro merged pull request #18976:
URL: https://github.com/apache/superset/pull/18976


   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4a6a9e0) into [master](https://codecov.io/gh/apache/superset/commit/bd63a1bd98c1faf152205b3b862119a1c59b2f05?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bd63a1b) will **decrease** coverage by `0.00%`.
   > The diff coverage is `88.88%`.
   
   > :exclamation: Current head 4a6a9e0 differs from pull request most recent head d5f8d42. Consider uploading reports for the commit d5f8d42 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.58%   66.58%   -0.01%     
   ==========================================
     Files        1641     1641              
     Lines       63533    63548      +15     
     Branches     6424     6424              
   ==========================================
   + Hits        42303    42311       +8     
   - Misses      19551    19558       +7     
     Partials     1679     1679              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <88.88%> (+0.01%)` | :arrow_up: |
   | mysql | `81.83% <88.88%> (-0.01%)` | :arrow_down: |
   | postgres | `81.86% <88.88%> (-0.02%)` | :arrow_down: |
   | presto | `52.45% <88.88%> (+0.01%)` | :arrow_up: |
   | python | `82.30% <88.88%> (-0.02%)` | :arrow_down: |
   | sqlite | `81.57% <88.88%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `93.75% <86.36%> (-6.25%)` | :arrow_down: |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.92% <100.00%> (ø)` | |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `97.95% <100.00%> (-0.09%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `74.52% <100.00%> (ø)` | |
   | [superset/reports/commands/log\_prune.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9sb2dfcHJ1bmUucHk=) | `85.71% <0.00%> (-3.58%)` | :arrow_down: |
   | [superset/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL3V0aWxzLnB5) | `89.13% <0.00%> (-2.18%)` | :arrow_down: |
   | [superset/common/query\_object.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X29iamVjdC5weQ==) | `95.13% <0.00%> (-0.55%)` | :arrow_down: |
   | [superset/reports/commands/execute.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9leGVjdXRlLnB5) | `91.14% <0.00%> (-0.37%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [bd63a1b...d5f8d42](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] john-bodley commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
john-bodley commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r816975361



##########
File path: superset/config.py
##########
@@ -576,29 +577,43 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The config flag CACHE_DEFAULT_TIMEOUT has been deprecated "

Review comment:
       This isn't quite true, i.e., this flag is defined by Flask-Caching per [here](https://flask-caching.readthedocs.io/en/latest/#configuring-flask-caching) but I get the gist of the comment.

##########
File path: superset/utils/cache.py
##########
@@ -55,7 +60,11 @@ def set_and_log_cache(
     if isinstance(cache_instance.cache, NullCache):
         return
 
-    timeout = cache_timeout if cache_timeout else config["CACHE_DEFAULT_TIMEOUT"]
+    timeout = (
+        cache_timeout
+        if cache_timeout

Review comment:
       ```suggestion
           if cache_timeout is not None
   ```
   
   I know this is just a rewrite of the above but `cache_timeout` could be `0` i.e., per Flask-Caching, 
   
   > A timeout of 0 indicates that the cache never expires.
   
   so a truthiness check isn't suffice.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817871711



##########
File path: superset/utils/cache_manager.py
##########
@@ -28,41 +34,47 @@ def __init__(self) -> None:
         self._filter_state_cache = Cache()
         self._explore_form_data_cache = Cache()
 
+    @staticmethod
+    def _init_cache(
+        app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        cache_config = app.config[cache_config_key]
+        cache_type = cache_config.get("CACHE_TYPE")
+        if app.debug and cache_type is None:
+            cache_threshold = cache_config.get("CACHE_THRESHOLD", math.inf)
+            cache_config.update(
+                {"CACHE_TYPE": "SimpleCache", "CACHE_THRESHOLD": cache_threshold,}
+            )
+
+        if "CACHE_DEFAULT_TIMEOUT" not in cache_config:
+            default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+            cache_config["CACHE_DEFAULT_TIMEOUT"] = default_timeout
+
+        if required and cache_type in ("null", "NullCache"):
+            raise Exception(
+                _(
+                    "The CACHE_TYPE `%(cache_type)s` for `%(cache_config_key)s` is not "
+                    "supported. It is recommended to use `RedisCache`, "
+                    "`MemcachedCache` or another dedicated caching backend for "
+                    "production deployments",
+                    cache_type=cache_config["CACHE_TYPE"],
+                    cache_config_key=cache_config_key,
+                ),
+            )
+        cache.init_app(app, cache_config)
+
     def init_app(self, app: Flask) -> None:
-        self._cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["CACHE_CONFIG"],
-            },
-        )
-        self._data_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["DATA_CACHE_CONFIG"],
-            },
-        )
-        self._thumbnail_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["THUMBNAIL_CACHE_CONFIG"],
-            },
-        )
-        self._filter_state_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["FILTER_STATE_CACHE_CONFIG"],
-            },
+        self._init_cache(app, self._cache, "CACHE_CONFIG")
+        self._init_cache(app, self._data_cache, "DATA_CACHE_CONFIG")
+        self._init_cache(app, self._thumbnail_cache, "THUMBNAIL_CACHE_CONFIG")
+        self._init_cache(
+            app, self._filter_state_cache, "FILTER_STATE_CACHE_CONFIG", required=True

Review comment:
       Not required but it would be a good idea to extract these strings into constants to avoid typing errors.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (62cd84f) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.18%`.
   > The diff coverage is `95.65%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.21%   -0.19%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63528      +10     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42068     -108     
   - Misses      19681    19799     +118     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <86.95%> (+0.01%)` | :arrow_up: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `52.45% <86.95%> (+0.01%)` | :arrow_up: |
   | python | `81.94% <95.65%> (-0.38%)` | :arrow_down: |
   | sqlite | `81.58% <95.65%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.04% <100.00%> (+0.12%)` | :arrow_up: |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `98.03% <100.00%> (ø)` | |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `75.22% <100.00%> (+0.70%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `31.37% <0.00%> (-56.87%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `60.34% <0.00%> (-20.69%)` | :arrow_down: |
   | ... and [18 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...62cd84f](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817013950



##########
File path: superset/config.py
##########
@@ -576,29 +577,43 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",

Review comment:
       We just need to ensure that the failure message clearly indicates what these settings are and helps the user to configure them correctly (maybe refer to Flask-Caching docs).




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2f207c7) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.12%`.
   > The diff coverage is `80.00%`.
   
   > :exclamation: Current head 2f207c7 differs from pull request most recent head bab168a. Consider uploading reports for the commit bab168a to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.27%   -0.13%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63522       +4     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42098      -78     
   - Misses      19681    19763      +82     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | postgres | `81.88% <100.00%> (+<0.01%)` | :arrow_up: |
   | presto | `52.45% <100.00%> (+<0.01%)` | :arrow_up: |
   | python | `82.05% <100.00%> (-0.27%)` | :arrow_down: |
   | sqlite | `81.58% <100.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...lugin-chart-echarts/src/Timeseries/transformers.ts](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy90cmFuc2Zvcm1lcnMudHM=) | `51.23% <33.33%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.00% <100.00%> (+0.07%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `70.00% <0.00%> (-15.77%)` | :arrow_down: |
   | [superset/common/utils/dataframe\_utils.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3V0aWxzL2RhdGFmcmFtZV91dGlscy5weQ==) | `85.71% <0.00%> (-7.15%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `93.97% <0.00%> (-3.62%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.19% <0.00%> (-0.73%)` | :arrow_down: |
   | [superset/views/core.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `77.06% <0.00%> (-0.45%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `89.14% <0.00%> (-0.34%)` | :arrow_down: |
   | ... and [2 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...bab168a](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817189859



##########
File path: superset/config.py
##########
@@ -576,31 +578,44 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name

Review comment:
       I'm not sure we need a whole function for this. Ideally the config file should have as little Python code as possible. How about simply setting `FILTER_STATE_CACHE_CONFIG` and `EXPLORE_FORM_DATA_CACHE_CONFIG` to `NullCache` and override it to `SimpleCache` or raise exception when app is starting (depending on whether `app.debug` is true)?




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (62cd84f) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **increase** coverage by `0.00%`.
   > The diff coverage is `95.65%`.
   
   > :exclamation: Current head 62cd84f differs from pull request most recent head 099b13f. Consider uploading reports for the commit 099b13f to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #18976   +/-   ##
   =======================================
     Coverage   66.40%   66.40%           
   =======================================
     Files        1641     1641           
     Lines       63518    63528   +10     
     Branches     6422     6422           
   =======================================
   + Hits        42176    42186   +10     
     Misses      19681    19681           
     Partials     1661     1661           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <86.95%> (+0.01%)` | :arrow_up: |
   | mysql | `81.84% <95.65%> (+<0.01%)` | :arrow_up: |
   | postgres | `81.89% <95.65%> (+<0.01%)` | :arrow_up: |
   | presto | `52.45% <86.95%> (+0.01%)` | :arrow_up: |
   | python | `82.32% <95.65%> (+<0.01%)` | :arrow_up: |
   | sqlite | `81.58% <95.65%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.04% <100.00%> (+0.12%)` | :arrow_up: |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `98.03% <100.00%> (ø)` | |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `75.22% <100.00%> (+0.70%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...099b13f](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817871711



##########
File path: superset/utils/cache_manager.py
##########
@@ -28,41 +34,47 @@ def __init__(self) -> None:
         self._filter_state_cache = Cache()
         self._explore_form_data_cache = Cache()
 
+    @staticmethod
+    def _init_cache(
+        app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        cache_config = app.config[cache_config_key]
+        cache_type = cache_config.get("CACHE_TYPE")
+        if app.debug and cache_type is None:
+            cache_threshold = cache_config.get("CACHE_THRESHOLD", math.inf)
+            cache_config.update(
+                {"CACHE_TYPE": "SimpleCache", "CACHE_THRESHOLD": cache_threshold,}
+            )
+
+        if "CACHE_DEFAULT_TIMEOUT" not in cache_config:
+            default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+            cache_config["CACHE_DEFAULT_TIMEOUT"] = default_timeout
+
+        if required and cache_type in ("null", "NullCache"):
+            raise Exception(
+                _(
+                    "The CACHE_TYPE `%(cache_type)s` for `%(cache_config_key)s` is not "
+                    "supported. It is recommended to use `RedisCache`, "
+                    "`MemcachedCache` or another dedicated caching backend for "
+                    "production deployments",
+                    cache_type=cache_config["CACHE_TYPE"],
+                    cache_config_key=cache_config_key,
+                ),
+            )
+        cache.init_app(app, cache_config)
+
     def init_app(self, app: Flask) -> None:
-        self._cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["CACHE_CONFIG"],
-            },
-        )
-        self._data_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["DATA_CACHE_CONFIG"],
-            },
-        )
-        self._thumbnail_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["THUMBNAIL_CACHE_CONFIG"],
-            },
-        )
-        self._filter_state_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["FILTER_STATE_CACHE_CONFIG"],
-            },
+        self._init_cache(app, self._cache, "CACHE_CONFIG")
+        self._init_cache(app, self._data_cache, "DATA_CACHE_CONFIG")
+        self._init_cache(app, self._thumbnail_cache, "THUMBNAIL_CACHE_CONFIG")
+        self._init_cache(
+            app, self._filter_state_cache, "FILTER_STATE_CACHE_CONFIG", required=True

Review comment:
       Not required but it would be a good idea to extract these strings are constants to avoid typing errors.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817150715



##########
File path: superset/config.py
##########
@@ -576,29 +577,43 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",

Review comment:
       Thanks for reminding - I'll add the throw + an error message 👍 




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817194254



##########
File path: superset/config.py
##########
@@ -576,31 +578,44 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The global config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",
+        "CACHE_THRESHOLD": math.inf,

Review comment:
       To keep things simple, the default could be just a `NullCache` that does not work with the most appropriate values set for other cache options.
   
   A `DEFAULT_CACHE_CONFIG_FUNC` factory is also confusing since ideally all of Superset should just use the same cache, we introduced so many different cache storages because they SHOULD  be configured differently in accord with their different purposes. If the all are using the same DEFAULT_CACHE, then it should just use the default cache storage.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817007509



##########
File path: superset/config.py
##########
@@ -576,29 +577,43 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",

Review comment:
       Yeah - I'm almost wondering if we need to fail starting up if `EXPLORE_FORM_DATA_CACHE_CONFIG` or `FILTER_STATE_CACHE_CONFIG` are `NullCache`, as the app really won't be usable in that case. Thoughts?




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817583020



##########
File path: superset/utils/cache_manager.py
##########
@@ -14,73 +14,78 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+import logging
+import math
+
 from flask import Flask
+from flask_babel import gettext as _
 from flask_caching import Cache
 
+from superset.typing import CacheConfig
+
+logger = logging.getLogger(__name__)
+
 
 class CacheManager:
     def __init__(self) -> None:
         super().__init__()
 
-        self._cache = Cache()
-        self._data_cache = Cache()
-        self._thumbnail_cache = Cache()
-        self._filter_state_cache = Cache()
-        self._explore_form_data_cache = Cache()
+        self._default_cache_config: CacheConfig = {}
+        self.cache = Cache()
+        self.data_cache = Cache()
+        self.thumbnail_cache = Cache()
+        self.filter_state_cache = Cache()
+        self.explore_form_data_cache = Cache()
+
+    def _init_cache(
+        self, app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        config = {**self._default_cache_config, **app.config[cache_config_key]}
+        if required and config["CACHE_TYPE"] in ("null", "NullCache"):
+            raise Exception(
+                _(
+                    "The CACHE_TYPE `%(cache_type)s` for `%(cache_config_key)s` is not "
+                    "supported. It is recommended to use `RedisCache`, `MemcachedCache` "
+                    "or another dedicated caching backend for production deployments",
+                    cache_type=config["CACHE_TYPE"],
+                    cache_config_key=cache_config_key,
+                ),
+            )
+        cache.init_app(app, config)
 
     def init_app(self, app: Flask) -> None:
-        self._cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["CACHE_CONFIG"],
-            },
-        )
-        self._data_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["DATA_CACHE_CONFIG"],
-            },
-        )
-        self._thumbnail_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["THUMBNAIL_CACHE_CONFIG"],
-            },
-        )
-        self._filter_state_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["FILTER_STATE_CACHE_CONFIG"],
-            },
+        if app.debug:
+            self._default_cache_config = {
+                "CACHE_TYPE": "SimpleCache",
+                "CACHE_THRESHOLD": math.inf,
+            }
+        else:
+            self._default_cache_config = {}
+
+        default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+        if default_timeout is not None:
+            self._default_cache_config["CACHE_DEFAULT_TIMEOUT"] = default_timeout
+            logger.warning(
+                _(
+                    "The global config flag `CACHE_DEFAULT_TIMEOUT` has been "
+                    "deprecated and will be removed in Superset 2.0. Please set "
+                    "default cache options in the `DEFAULT_CACHE_CONFIG` parameter"
+                ),
+            )
+        self._default_cache_config = {
+            **self._default_cache_config,
+            **app.config["DEFAULT_CACHE_CONFIG"],
+        }
+
+        self._init_cache(app, self.cache, "CACHE_CONFIG")
+        self._init_cache(app, self.data_cache, "DATA_CACHE_CONFIG")
+        self._init_cache(app, self.thumbnail_cache, "THUMBNAIL_CACHE_CONFIG")
+        self._init_cache(
+            app, self.filter_state_cache, "FILTER_STATE_CACHE_CONFIG", required=True
         )
-        self._explore_form_data_cache.init_app(
+        self._init_cache(
             app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["EXPLORE_FORM_DATA_CACHE_CONFIG"],
-            },
+            self.explore_form_data_cache,
+            "EXPLORE_FORM_DATA_CACHE_CONFIG",
+            required=True,
         )
-
-    @property
-    def data_cache(self) -> Cache:
-        return self._data_cache
-
-    @property
-    def cache(self) -> Cache:
-        return self._cache
-
-    @property
-    def thumbnail_cache(self) -> Cache:
-        return self._thumbnail_cache
-
-    @property
-    def filter_state_cache(self) -> Cache:
-        return self._filter_state_cache
-
-    @property
-    def explore_form_data_cache(self) -> Cache:
-        return self._explore_form_data_cache

Review comment:
       This seemed very Java getter/setter-like with little utility (I assume a remnant from old times)




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817583374



##########
File path: superset/utils/cache.py
##########
@@ -55,7 +60,11 @@ def set_and_log_cache(
     if isinstance(cache_instance.cache, NullCache):
         return
 
-    timeout = cache_timeout if cache_timeout else config["CACHE_DEFAULT_TIMEOUT"]
+    timeout = (
+        cache_timeout
+        if cache_timeout

Review comment:
       Made the change




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2f207c7) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.12%`.
   > The diff coverage is `80.00%`.
   
   > :exclamation: Current head 2f207c7 differs from pull request most recent head 7b1926e. Consider uploading reports for the commit 7b1926e to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.27%   -0.13%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63522       +4     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42098      -78     
   - Misses      19681    19763      +82     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | postgres | `81.88% <100.00%> (+<0.01%)` | :arrow_up: |
   | presto | `52.45% <100.00%> (+<0.01%)` | :arrow_up: |
   | python | `82.05% <100.00%> (-0.27%)` | :arrow_down: |
   | sqlite | `81.58% <100.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...lugin-chart-echarts/src/Timeseries/transformers.ts](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy90cmFuc2Zvcm1lcnMudHM=) | `51.23% <33.33%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.00% <100.00%> (+0.07%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `70.00% <0.00%> (-15.77%)` | :arrow_down: |
   | [superset/common/utils/dataframe\_utils.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3V0aWxzL2RhdGFmcmFtZV91dGlscy5weQ==) | `85.71% <0.00%> (-7.15%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `93.97% <0.00%> (-3.62%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.19% <0.00%> (-0.73%)` | :arrow_down: |
   | [superset/views/core.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `77.06% <0.00%> (-0.45%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `89.14% <0.00%> (-0.34%)` | :arrow_down: |
   | ... and [2 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...7b1926e](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2f207c7) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.13%`.
   > The diff coverage is `80.00%`.
   
   > :exclamation: Current head 2f207c7 differs from pull request most recent head bab168a. Consider uploading reports for the commit bab168a to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.26%   -0.14%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63522       +4     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42094      -82     
   - Misses      19681    19767      +86     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | postgres | `81.87% <100.00%> (-0.02%)` | :arrow_down: |
   | presto | `52.45% <100.00%> (+<0.01%)` | :arrow_up: |
   | python | `82.04% <100.00%> (-0.28%)` | :arrow_down: |
   | sqlite | `81.58% <100.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...lugin-chart-echarts/src/Timeseries/transformers.ts](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy90cmFuc2Zvcm1lcnMudHM=) | `51.23% <33.33%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.00% <100.00%> (+0.07%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `70.00% <0.00%> (-15.77%)` | :arrow_down: |
   | [superset/common/utils/dataframe\_utils.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3V0aWxzL2RhdGFmcmFtZV91dGlscy5weQ==) | `85.71% <0.00%> (-7.15%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `93.97% <0.00%> (-3.62%)` | :arrow_down: |
   | [superset/reports/commands/log\_prune.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9sb2dfcHJ1bmUucHk=) | `85.71% <0.00%> (-3.58%)` | :arrow_down: |
   | [superset/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL3V0aWxzLnB5) | `89.13% <0.00%> (-2.18%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.19% <0.00%> (-0.73%)` | :arrow_down: |
   | ... and [6 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...bab168a](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817189859



##########
File path: superset/config.py
##########
@@ -576,31 +578,44 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name

Review comment:
       I'm not sure we need a whole function for this. How about simply setting `FILTER_STATE_CACHE_CONFIG` and `EXPLORE_FORM_DATA_CACHE_CONFIG` to `NullCache` and override it to `SimpleCache` or raise exception when app is starting (depending on whether `app.debug` is true)?




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (62cd84f) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **increase** coverage by `0.00%`.
   > The diff coverage is `95.65%`.
   
   > :exclamation: Current head 62cd84f differs from pull request most recent head 7e6c041. Consider uploading reports for the commit 7e6c041 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #18976   +/-   ##
   =======================================
     Coverage   66.40%   66.40%           
   =======================================
     Files        1641     1641           
     Lines       63518    63528   +10     
     Branches     6422     6422           
   =======================================
   + Hits        42176    42186   +10     
     Misses      19681    19681           
     Partials     1661     1661           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <86.95%> (+0.01%)` | :arrow_up: |
   | mysql | `81.84% <95.65%> (+<0.01%)` | :arrow_up: |
   | postgres | `81.89% <95.65%> (+<0.01%)` | :arrow_up: |
   | presto | `52.45% <86.95%> (+0.01%)` | :arrow_up: |
   | python | `82.32% <95.65%> (+<0.01%)` | :arrow_up: |
   | sqlite | `81.58% <95.65%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.04% <100.00%> (+0.12%)` | :arrow_up: |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `98.03% <100.00%> (ø)` | |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `75.22% <100.00%> (+0.70%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...7e6c041](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817583020



##########
File path: superset/utils/cache_manager.py
##########
@@ -14,73 +14,78 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+import logging
+import math
+
 from flask import Flask
+from flask_babel import gettext as _
 from flask_caching import Cache
 
+from superset.typing import CacheConfig
+
+logger = logging.getLogger(__name__)
+
 
 class CacheManager:
     def __init__(self) -> None:
         super().__init__()
 
-        self._cache = Cache()
-        self._data_cache = Cache()
-        self._thumbnail_cache = Cache()
-        self._filter_state_cache = Cache()
-        self._explore_form_data_cache = Cache()
+        self._default_cache_config: CacheConfig = {}
+        self.cache = Cache()
+        self.data_cache = Cache()
+        self.thumbnail_cache = Cache()
+        self.filter_state_cache = Cache()
+        self.explore_form_data_cache = Cache()
+
+    def _init_cache(
+        self, app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        config = {**self._default_cache_config, **app.config[cache_config_key]}
+        if required and config["CACHE_TYPE"] in ("null", "NullCache"):
+            raise Exception(
+                _(
+                    "The CACHE_TYPE `%(cache_type)s` for `%(cache_config_key)s` is not "
+                    "supported. It is recommended to use `RedisCache`, `MemcachedCache` "
+                    "or another dedicated caching backend for production deployments",
+                    cache_type=config["CACHE_TYPE"],
+                    cache_config_key=cache_config_key,
+                ),
+            )
+        cache.init_app(app, config)
 
     def init_app(self, app: Flask) -> None:
-        self._cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["CACHE_CONFIG"],
-            },
-        )
-        self._data_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["DATA_CACHE_CONFIG"],
-            },
-        )
-        self._thumbnail_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["THUMBNAIL_CACHE_CONFIG"],
-            },
-        )
-        self._filter_state_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["FILTER_STATE_CACHE_CONFIG"],
-            },
+        if app.debug:
+            self._default_cache_config = {
+                "CACHE_TYPE": "SimpleCache",
+                "CACHE_THRESHOLD": math.inf,
+            }
+        else:
+            self._default_cache_config = {}
+
+        default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+        if default_timeout is not None:
+            self._default_cache_config["CACHE_DEFAULT_TIMEOUT"] = default_timeout
+            logger.warning(
+                _(
+                    "The global config flag `CACHE_DEFAULT_TIMEOUT` has been "
+                    "deprecated and will be removed in Superset 2.0. Please set "
+                    "default cache options in the `DEFAULT_CACHE_CONFIG` parameter"
+                ),
+            )
+        self._default_cache_config = {
+            **self._default_cache_config,
+            **app.config["DEFAULT_CACHE_CONFIG"],
+        }
+
+        self._init_cache(app, self.cache, "CACHE_CONFIG")
+        self._init_cache(app, self.data_cache, "DATA_CACHE_CONFIG")
+        self._init_cache(app, self.thumbnail_cache, "THUMBNAIL_CACHE_CONFIG")
+        self._init_cache(
+            app, self.filter_state_cache, "FILTER_STATE_CACHE_CONFIG", required=True
         )
-        self._explore_form_data_cache.init_app(
+        self._init_cache(
             app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["EXPLORE_FORM_DATA_CACHE_CONFIG"],
-            },
+            self.explore_form_data_cache,
+            "EXPLORE_FORM_DATA_CACHE_CONFIG",
+            required=True,
         )
-
-    @property
-    def data_cache(self) -> Cache:
-        return self._data_cache
-
-    @property
-    def cache(self) -> Cache:
-        return self._cache
-
-    @property
-    def thumbnail_cache(self) -> Cache:
-        return self._thumbnail_cache
-
-    @property
-    def filter_state_cache(self) -> Cache:
-        return self._filter_state_cache
-
-    @property
-    def explore_form_data_cache(self) -> Cache:
-        return self._explore_form_data_cache

Review comment:
       This seemed very Java getter-like and un-pythonic (I assume a remnant from old times)




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4a6a9e0) into [master](https://codecov.io/gh/apache/superset/commit/bd63a1bd98c1faf152205b3b862119a1c59b2f05?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bd63a1b) will **increase** coverage by `0.00%`.
   > The diff coverage is `88.88%`.
   
   > :exclamation: Current head 4a6a9e0 differs from pull request most recent head d5f8d42. Consider uploading reports for the commit d5f8d42 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #18976   +/-   ##
   =======================================
     Coverage   66.58%   66.58%           
   =======================================
     Files        1641     1641           
     Lines       63533    63548   +15     
     Branches     6424     6424           
   =======================================
   + Hits        42303    42315   +12     
   - Misses      19551    19554    +3     
     Partials     1679     1679           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <88.88%> (+0.01%)` | :arrow_up: |
   | mysql | `81.83% <88.88%> (-0.01%)` | :arrow_down: |
   | postgres | `81.88% <88.88%> (-0.01%)` | :arrow_down: |
   | presto | `52.45% <88.88%> (+0.01%)` | :arrow_up: |
   | python | `82.31% <88.88%> (-0.01%)` | :arrow_down: |
   | sqlite | `81.57% <88.88%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `93.75% <86.36%> (-6.25%)` | :arrow_down: |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.92% <100.00%> (ø)` | |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `97.95% <100.00%> (-0.09%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `74.52% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [bd63a1b...d5f8d42](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817609009



##########
File path: docs/docs/installation/cache.mdx
##########
@@ -7,37 +7,36 @@ version: 1
 
 ## Caching
 
-Superset uses [Flask-Caching](https://flask-caching.readthedocs.io/) for caching purpose. For security reasons,
-there are two separate cache configs for Superset's own metadata (`CACHE_CONFIG`) and charting data queried from
-connected datasources (`DATA_CACHE_CONFIG`). However, Query results from SQL Lab are stored in another backend
-called `RESULTS_BACKEND`, See [Async Queries via Celery](/docs/installation/async-queries-celery) for details.
-
-Configuring caching is as easy as providing `CACHE_CONFIG` and `DATA_CACHE_CONFIG` in your
+Superset uses [Flask-Caching](https://flask-caching.readthedocs.io/) for caching purpose. Default caching options
+can be set by overriding the `DEFAULT_CACHE_CONFIG` in your `superset_config.py`. Unless overridden, the default
+cache type will be set to `SimpleCache` when running in debug mode, and `NullCache` otherwise.
+
+Currently there are five separate cache configurations to provide additional security and more granular customization options:
+- Metadata cache (optional): `CACHE_CONFIG`
+- Charting data queried from datasets (optional): `DATA_CACHE_CONFIG`
+- SQL Lab query results (optional): `RESULTS_BACKEND`. See [Async Queries via Celery](/docs/installation/async-queries-celery) for details
+- Dashboard filter state (required): `FILTER_STATE_CACHE_CONFIG`.
+- Explore chart form data (required): `EXPLORE_FORM_DATA_CACHE_CONFIG`
+
+Configuring caching is as easy as providing a custom cache config in your
 `superset_config.py` that complies with [the Flask-Caching specifications](https://flask-caching.readthedocs.io/en/latest/#configuring-flask-caching).
-
 Flask-Caching supports various caching backends, including Redis, Memcached, SimpleCache (in-memory), or the
-local filesystem.
+local filesystem. Custom cache backends are also supported. See [here](https://flask-caching.readthedocs.io/en/latest/#custom-cache-backends) for specifics.
 
+Note that Dashboard and Explore caching is required, and configuring the application with either of these caches set to `NullCache` will
+cause the application to fail on startup. Also keep in mind, tht when running Superset on a multi-worker setup, a dedicated cache is required.

Review comment:
       ```suggestion
   cause the application to fail on startup. Also, keep in mind that when running Superset on a multi-worker setup, a dedicated cache is required.
   ```




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817010495



##########
File path: superset/config.py
##########
@@ -576,29 +577,43 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",

Review comment:
       I agree. I remember this comment as well from @ktmud [here](https://github.com/apache/superset/pull/18181#issuecomment-1041907138):
   
   > We should probably set it to NullCache and throw an exception at startup.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817005998



##########
File path: superset/utils/cache.py
##########
@@ -55,7 +60,11 @@ def set_and_log_cache(
     if isinstance(cache_instance.cache, NullCache):
         return
 
-    timeout = cache_timeout if cache_timeout else config["CACHE_DEFAULT_TIMEOUT"]
+    timeout = (
+        cache_timeout
+        if cache_timeout

Review comment:
       Oops!




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (62cd84f) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **increase** coverage by `0.00%`.
   > The diff coverage is `95.65%`.
   
   > :exclamation: Current head 62cd84f differs from pull request most recent head 8b71ba1. Consider uploading reports for the commit 8b71ba1 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #18976   +/-   ##
   =======================================
     Coverage   66.40%   66.40%           
   =======================================
     Files        1641     1641           
     Lines       63518    63528   +10     
     Branches     6422     6422           
   =======================================
   + Hits        42176    42186   +10     
     Misses      19681    19681           
     Partials     1661     1661           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <86.95%> (+0.01%)` | :arrow_up: |
   | mysql | `81.84% <95.65%> (+<0.01%)` | :arrow_up: |
   | postgres | `81.89% <95.65%> (+<0.01%)` | :arrow_up: |
   | presto | `52.45% <86.95%> (+0.01%)` | :arrow_up: |
   | python | `82.32% <95.65%> (+<0.01%)` | :arrow_up: |
   | sqlite | `81.58% <95.65%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.04% <100.00%> (+0.12%)` | :arrow_up: |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `98.03% <100.00%> (ø)` | |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `75.22% <100.00%> (+0.70%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...8b71ba1](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817724710



##########
File path: superset/config.py
##########
@@ -576,31 +578,44 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The global config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",
+        "CACHE_THRESHOLD": math.inf,

Review comment:
       I removed the `DEFAULT_CACHE_CONFIG`




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817871711



##########
File path: superset/utils/cache_manager.py
##########
@@ -28,41 +34,47 @@ def __init__(self) -> None:
         self._filter_state_cache = Cache()
         self._explore_form_data_cache = Cache()
 
+    @staticmethod
+    def _init_cache(
+        app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        cache_config = app.config[cache_config_key]
+        cache_type = cache_config.get("CACHE_TYPE")
+        if app.debug and cache_type is None:
+            cache_threshold = cache_config.get("CACHE_THRESHOLD", math.inf)
+            cache_config.update(
+                {"CACHE_TYPE": "SimpleCache", "CACHE_THRESHOLD": cache_threshold,}
+            )
+
+        if "CACHE_DEFAULT_TIMEOUT" not in cache_config:
+            default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+            cache_config["CACHE_DEFAULT_TIMEOUT"] = default_timeout
+
+        if required and cache_type in ("null", "NullCache"):
+            raise Exception(
+                _(
+                    "The CACHE_TYPE `%(cache_type)s` for `%(cache_config_key)s` is not "
+                    "supported. It is recommended to use `RedisCache`, "
+                    "`MemcachedCache` or another dedicated caching backend for "
+                    "production deployments",
+                    cache_type=cache_config["CACHE_TYPE"],
+                    cache_config_key=cache_config_key,
+                ),
+            )
+        cache.init_app(app, cache_config)
+
     def init_app(self, app: Flask) -> None:
-        self._cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["CACHE_CONFIG"],
-            },
-        )
-        self._data_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["DATA_CACHE_CONFIG"],
-            },
-        )
-        self._thumbnail_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["THUMBNAIL_CACHE_CONFIG"],
-            },
-        )
-        self._filter_state_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["FILTER_STATE_CACHE_CONFIG"],
-            },
+        self._init_cache(app, self._cache, "CACHE_CONFIG")
+        self._init_cache(app, self._data_cache, "DATA_CACHE_CONFIG")
+        self._init_cache(app, self._thumbnail_cache, "THUMBNAIL_CACHE_CONFIG")
+        self._init_cache(
+            app, self._filter_state_cache, "FILTER_STATE_CACHE_CONFIG", required=True

Review comment:
       Not required but it would be a good idea to extract these strings as constants to avoid typing errors.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817583020



##########
File path: superset/utils/cache_manager.py
##########
@@ -14,73 +14,78 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+import logging
+import math
+
 from flask import Flask
+from flask_babel import gettext as _
 from flask_caching import Cache
 
+from superset.typing import CacheConfig
+
+logger = logging.getLogger(__name__)
+
 
 class CacheManager:
     def __init__(self) -> None:
         super().__init__()
 
-        self._cache = Cache()
-        self._data_cache = Cache()
-        self._thumbnail_cache = Cache()
-        self._filter_state_cache = Cache()
-        self._explore_form_data_cache = Cache()
+        self._default_cache_config: CacheConfig = {}
+        self.cache = Cache()
+        self.data_cache = Cache()
+        self.thumbnail_cache = Cache()
+        self.filter_state_cache = Cache()
+        self.explore_form_data_cache = Cache()
+
+    def _init_cache(
+        self, app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        config = {**self._default_cache_config, **app.config[cache_config_key]}
+        if required and config["CACHE_TYPE"] in ("null", "NullCache"):
+            raise Exception(
+                _(
+                    "The CACHE_TYPE `%(cache_type)s` for `%(cache_config_key)s` is not "
+                    "supported. It is recommended to use `RedisCache`, `MemcachedCache` "
+                    "or another dedicated caching backend for production deployments",
+                    cache_type=config["CACHE_TYPE"],
+                    cache_config_key=cache_config_key,
+                ),
+            )
+        cache.init_app(app, config)
 
     def init_app(self, app: Flask) -> None:
-        self._cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["CACHE_CONFIG"],
-            },
-        )
-        self._data_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["DATA_CACHE_CONFIG"],
-            },
-        )
-        self._thumbnail_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["THUMBNAIL_CACHE_CONFIG"],
-            },
-        )
-        self._filter_state_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["FILTER_STATE_CACHE_CONFIG"],
-            },
+        if app.debug:
+            self._default_cache_config = {
+                "CACHE_TYPE": "SimpleCache",
+                "CACHE_THRESHOLD": math.inf,
+            }
+        else:
+            self._default_cache_config = {}
+
+        default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+        if default_timeout is not None:
+            self._default_cache_config["CACHE_DEFAULT_TIMEOUT"] = default_timeout
+            logger.warning(
+                _(
+                    "The global config flag `CACHE_DEFAULT_TIMEOUT` has been "
+                    "deprecated and will be removed in Superset 2.0. Please set "
+                    "default cache options in the `DEFAULT_CACHE_CONFIG` parameter"
+                ),
+            )
+        self._default_cache_config = {
+            **self._default_cache_config,
+            **app.config["DEFAULT_CACHE_CONFIG"],
+        }
+
+        self._init_cache(app, self.cache, "CACHE_CONFIG")
+        self._init_cache(app, self.data_cache, "DATA_CACHE_CONFIG")
+        self._init_cache(app, self.thumbnail_cache, "THUMBNAIL_CACHE_CONFIG")
+        self._init_cache(
+            app, self.filter_state_cache, "FILTER_STATE_CACHE_CONFIG", required=True
         )
-        self._explore_form_data_cache.init_app(
+        self._init_cache(
             app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["EXPLORE_FORM_DATA_CACHE_CONFIG"],
-            },
+            self.explore_form_data_cache,
+            "EXPLORE_FORM_DATA_CACHE_CONFIG",
+            required=True,
         )
-
-    @property
-    def data_cache(self) -> Cache:
-        return self._data_cache
-
-    @property
-    def cache(self) -> Cache:
-        return self._cache
-
-    @property
-    def thumbnail_cache(self) -> Cache:
-        return self._thumbnail_cache
-
-    @property
-    def filter_state_cache(self) -> Cache:
-        return self._filter_state_cache
-
-    @property
-    def explore_form_data_cache(self) -> Cache:
-        return self._explore_form_data_cache

Review comment:
       This seemed very Java getter-like and un-pythonic (I assume a remnant from old times)




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817194254



##########
File path: superset/config.py
##########
@@ -576,31 +578,44 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The global config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",
+        "CACHE_THRESHOLD": math.inf,

Review comment:
       To keep things simple, the default could be just a `NullCache` that does not work with the most appropriate values set for other cache options.
   
   A `DEFAULT_CACHE_CONFIG_FUNC` factory is also confusing since ideally all of Superset should just use the same cache, we introduced so many different cache storages because they SHOULD  be configured differently in accord with their different purposes. If some place needs to use the same DEFAULT_CACHE_CONFIG, then it should just use the default cache storage. If an administrator wants to use the same Redis server for all caches, it's not difficult to reuse an ENV variable or extend a shared Python variable in their own config file.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817586481



##########
File path: superset/config.py
##########
@@ -576,29 +577,43 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The config flag CACHE_DEFAULT_TIMEOUT has been deprecated "

Review comment:
       added "global" in front of "config flag" to distinguish from the Flask config.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817868929



##########
File path: superset/utils/cache_manager.py
##########
@@ -28,41 +34,47 @@ def __init__(self) -> None:
         self._filter_state_cache = Cache()
         self._explore_form_data_cache = Cache()
 
+    @staticmethod
+    def _init_cache(
+        app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        cache_config = app.config[cache_config_key]
+        cache_type = cache_config.get("CACHE_TYPE")
+        if app.debug and cache_type is None:
+            cache_threshold = cache_config.get("CACHE_THRESHOLD", math.inf)
+            cache_config.update(
+                {"CACHE_TYPE": "SimpleCache", "CACHE_THRESHOLD": cache_threshold,}

Review comment:
       ```suggestion
                   {"CACHE_TYPE": "SimpleCache", "CACHE_THRESHOLD": cache_threshold}
   ```




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817870166



##########
File path: superset/utils/cache_manager.py
##########
@@ -28,41 +34,47 @@ def __init__(self) -> None:
         self._filter_state_cache = Cache()
         self._explore_form_data_cache = Cache()
 
+    @staticmethod
+    def _init_cache(
+        app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        cache_config = app.config[cache_config_key]
+        cache_type = cache_config.get("CACHE_TYPE")
+        if app.debug and cache_type is None:
+            cache_threshold = cache_config.get("CACHE_THRESHOLD", math.inf)
+            cache_config.update(
+                {"CACHE_TYPE": "SimpleCache", "CACHE_THRESHOLD": cache_threshold,}

Review comment:
       I'm surprised this is not catched by `black`.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2f207c7) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.12%`.
   > The diff coverage is `80.00%`.
   
   > :exclamation: Current head 2f207c7 differs from pull request most recent head 62cd84f. Consider uploading reports for the commit 62cd84f to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.27%   -0.13%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63522       +4     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42098      -78     
   - Misses      19681    19763      +82     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | postgres | `81.88% <100.00%> (+<0.01%)` | :arrow_up: |
   | presto | `52.45% <100.00%> (+<0.01%)` | :arrow_up: |
   | python | `82.05% <100.00%> (-0.27%)` | :arrow_down: |
   | sqlite | `81.58% <100.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...lugin-chart-echarts/src/Timeseries/transformers.ts](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy90cmFuc2Zvcm1lcnMudHM=) | `51.23% <33.33%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.00% <100.00%> (+0.07%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `70.00% <0.00%> (-15.77%)` | :arrow_down: |
   | [superset/common/utils/dataframe\_utils.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3V0aWxzL2RhdGFmcmFtZV91dGlscy5weQ==) | `85.71% <0.00%> (-7.15%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `93.97% <0.00%> (-3.62%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.19% <0.00%> (-0.73%)` | :arrow_down: |
   | [superset/views/core.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `77.06% <0.00%> (-0.45%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `89.14% <0.00%> (-0.34%)` | :arrow_down: |
   | ... and [2 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...62cd84f](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817367280



##########
File path: superset/config.py
##########
@@ -576,31 +578,44 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name

Review comment:
       I agree, that's probably a better solution - I'll move the check for debug to `CacheManager.init_app`, seems like a cleaner approach 👍 




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4a6a9e0) into [master](https://codecov.io/gh/apache/superset/commit/bd63a1bd98c1faf152205b3b862119a1c59b2f05?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bd63a1b) will **decrease** coverage by `0.02%`.
   > The diff coverage is `88.88%`.
   
   > :exclamation: Current head 4a6a9e0 differs from pull request most recent head d5f8d42. Consider uploading reports for the commit d5f8d42 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.58%   66.56%   -0.03%     
   ==========================================
     Files        1641     1641              
     Lines       63533    63548      +15     
     Branches     6424     6424              
   ==========================================
   - Hits        42303    42299       -4     
   - Misses      19551    19570      +19     
     Partials     1679     1679              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <88.88%> (+0.01%)` | :arrow_up: |
   | mysql | `81.83% <88.88%> (-0.01%)` | :arrow_down: |
   | postgres | `?` | |
   | presto | `52.45% <88.88%> (+0.01%)` | :arrow_up: |
   | python | `82.26% <88.88%> (-0.06%)` | :arrow_down: |
   | sqlite | `81.57% <88.88%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `93.75% <86.36%> (-6.25%)` | :arrow_down: |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.92% <100.00%> (ø)` | |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `97.95% <100.00%> (-0.09%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `74.52% <100.00%> (ø)` | |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/reports/commands/log\_prune.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9sb2dfcHJ1bmUucHk=) | `85.71% <0.00%> (-3.58%)` | :arrow_down: |
   | [superset/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL3V0aWxzLnB5) | `89.13% <0.00%> (-2.18%)` | :arrow_down: |
   | [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `95.45% <0.00%> (-1.82%)` | :arrow_down: |
   | [superset/common/query\_object.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X29iamVjdC5weQ==) | `95.13% <0.00%> (-0.55%)` | :arrow_down: |
   | [superset/views/base\_api.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvYmFzZV9hcGkucHk=) | `97.47% <0.00%> (-0.43%)` | :arrow_down: |
   | ... and [1 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [bd63a1b...d5f8d42](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817896513



##########
File path: superset/utils/cache_manager.py
##########
@@ -28,41 +34,47 @@ def __init__(self) -> None:
         self._filter_state_cache = Cache()
         self._explore_form_data_cache = Cache()
 
+    @staticmethod
+    def _init_cache(
+        app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        cache_config = app.config[cache_config_key]
+        cache_type = cache_config.get("CACHE_TYPE")
+        if app.debug and cache_type is None:
+            cache_threshold = cache_config.get("CACHE_THRESHOLD", math.inf)
+            cache_config.update(
+                {"CACHE_TYPE": "SimpleCache", "CACHE_THRESHOLD": cache_threshold,}
+            )
+
+        if "CACHE_DEFAULT_TIMEOUT" not in cache_config:
+            default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+            cache_config["CACHE_DEFAULT_TIMEOUT"] = default_timeout
+
+        if required and cache_type in ("null", "NullCache"):
+            raise Exception(
+                _(
+                    "The CACHE_TYPE `%(cache_type)s` for `%(cache_config_key)s` is not "
+                    "supported. It is recommended to use `RedisCache`, "
+                    "`MemcachedCache` or another dedicated caching backend for "
+                    "production deployments",
+                    cache_type=cache_config["CACHE_TYPE"],
+                    cache_config_key=cache_config_key,
+                ),
+            )
+        cache.init_app(app, cache_config)
+
     def init_app(self, app: Flask) -> None:
-        self._cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["CACHE_CONFIG"],
-            },
-        )
-        self._data_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["DATA_CACHE_CONFIG"],
-            },
-        )
-        self._thumbnail_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["THUMBNAIL_CACHE_CONFIG"],
-            },
-        )
-        self._filter_state_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["FILTER_STATE_CACHE_CONFIG"],
-            },
+        self._init_cache(app, self._cache, "CACHE_CONFIG")
+        self._init_cache(app, self._data_cache, "DATA_CACHE_CONFIG")
+        self._init_cache(app, self._thumbnail_cache, "THUMBNAIL_CACHE_CONFIG")
+        self._init_cache(
+            app, self._filter_state_cache, "FILTER_STATE_CACHE_CONFIG", required=True

Review comment:
       Good idea - If I need to push changes to this PR I'll add that




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817887532



##########
File path: UPDATING.md
##########
@@ -26,6 +26,7 @@ assists people when migrating to a new version.
 
 ### Breaking Changes
 
+- [18976](https://github.com/apache/superset/pull/18976): When running the app in debug mode, the app will default to use `SimpleCache` for `FILTER_STATE_CACHE_CONFIG` and `EXPLORE_FORM_DATA_CACHE_CONFIG`. When running in non-debug mode, a cache backend will need to be defined, otherwise the application will fail to start. For installations using Redis or other caching backends, it is recommended to use the same backend for both cache configs.

Review comment:
       @ktmud I think the jury is still out on a few aspects of this feature:
   - will people predominantly use direct URLs or permalinks for sharing
   - what's the sweet spot timeout for these caches
   - will we ever need multiple key-value states on a resource, or can we just collapse them into one key-value pair per resource
   
   etc. I'm happy to keep iterating on this, and when we do a 3.0 release, I think it would be a perfect time to clean up some of the cruft we've accumulated here.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: [WIP] chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (62cd84f) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **increase** coverage by `0.00%`.
   > The diff coverage is `95.65%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #18976   +/-   ##
   =======================================
     Coverage   66.40%   66.40%           
   =======================================
     Files        1641     1641           
     Lines       63518    63528   +10     
     Branches     6422     6422           
   =======================================
   + Hits        42176    42186   +10     
     Misses      19681    19681           
     Partials     1661     1661           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <86.95%> (+0.01%)` | :arrow_up: |
   | mysql | `81.84% <95.65%> (+<0.01%)` | :arrow_up: |
   | postgres | `81.89% <95.65%> (+<0.01%)` | :arrow_up: |
   | presto | `52.45% <86.95%> (+0.01%)` | :arrow_up: |
   | python | `82.32% <95.65%> (+<0.01%)` | :arrow_up: |
   | sqlite | `81.58% <95.65%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `92.04% <100.00%> (+0.12%)` | :arrow_up: |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `98.03% <100.00%> (ø)` | |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `75.22% <100.00%> (+0.70%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...62cd84f](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aae4da3) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.16%`.
   > The diff coverage is `91.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.23%   -0.17%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63526       +8     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42075     -101     
   - Misses      19681    19790     +109     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.84% <91.66%> (+<0.01%)` | :arrow_up: |
   | postgres | `81.88% <91.66%> (+<0.01%)` | :arrow_up: |
   | presto | `?` | |
   | python | `81.97% <91.66%> (-0.35%)` | :arrow_down: |
   | sqlite | `81.58% <91.66%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.74% <88.88%> (-0.19%)` | :arrow_down: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `97.95% <100.00%> (-0.09%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `75.22% <100.00%> (+0.70%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `70.00% <0.00%> (-15.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-5.65%)` | :arrow_down: |
   | ... and [9 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...aae4da3](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817873193



##########
File path: UPDATING.md
##########
@@ -26,6 +26,7 @@ assists people when migrating to a new version.
 
 ### Breaking Changes
 
+- [18976](https://github.com/apache/superset/pull/18976): When running the app in debug mode, the app will default to use `SimpleCache` for `FILTER_STATE_CACHE_CONFIG` and `EXPLORE_FORM_DATA_CACHE_CONFIG`. When running in non-debug mode, a cache backend will need to be defined, otherwise the application will fail to start. For installations using Redis or other caching backends, it is recommended to use the same backend for both cache configs.

Review comment:
       > For installations using Redis or other caching backends, it is recommended to use the same backend for both cache configs.
   
   I'm wondering if there is a real need in configuring different cache expiration for both cache storages? If not, maybe we should just merge them---into something like `SEMI_PERSISTENT_CACHE_CONFIG` (albeit it'd be a bigger breaking change)?  
   




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #18976:
URL: https://github.com/apache/superset/pull/18976#issuecomment-1055196255


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18976](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aae4da3) into [master](https://codecov.io/gh/apache/superset/commit/7e336d1230ca8333afc3e5be7780bc962cbf8478?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e336d1) will **decrease** coverage by `0.16%`.
   > The diff coverage is `91.66%`.
   
   > :exclamation: Current head aae4da3 differs from pull request most recent head a976056. Consider uploading reports for the commit a976056 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18976/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #18976      +/-   ##
   ==========================================
   - Coverage   66.40%   66.23%   -0.17%     
   ==========================================
     Files        1641     1641              
     Lines       63518    63526       +8     
     Branches     6422     6422              
   ==========================================
   - Hits        42176    42075     -101     
   - Misses      19681    19790     +109     
     Partials     1661     1661              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.84% <91.66%> (+<0.01%)` | :arrow_up: |
   | postgres | `81.88% <91.66%> (+<0.01%)` | :arrow_up: |
   | presto | `?` | |
   | python | `81.97% <91.66%> (-0.35%)` | :arrow_down: |
   | sqlite | `81.58% <91.66%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `81.71% <50.00%> (+0.07%)` | :arrow_up: |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.74% <88.88%> (-0.19%)` | :arrow_down: |
   | [superset/common/query\_context\_processor.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | `91.46% <100.00%> (ø)` | |
   | [superset/typing.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdHlwaW5nLnB5) | `97.95% <100.00%> (-0.09%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `75.22% <100.00%> (+0.70%)` | :arrow_up: |
   | [superset/utils/cache\_manager.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGVfbWFuYWdlci5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdml6LnB5) | `58.26% <100.00%> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `70.00% <0.00%> (-15.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-5.65%)` | :arrow_down: |
   | ... and [9 more](https://codecov.io/gh/apache/superset/pull/18976/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7e336d1...a976056](https://codecov.io/gh/apache/superset/pull/18976?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817194254



##########
File path: superset/config.py
##########
@@ -576,31 +578,44 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The global config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",
+        "CACHE_THRESHOLD": math.inf,

Review comment:
       To keep things simple, the defaults could be just a `SimpleCache` with other cache options setting to the most appropriate values for production (e.g. cache expire date set to 6 months or 1 year).
   
   A `DEFAULT_CACHE_CONFIG_FUNC` factory is somewhat confusing since ideally all of Superset should just use the same cache, we introduced so many different cache storages because they SHOULD  be configured differently in accord with their different purposes. If some place needs to use the same DEFAULT_CACHE_CONFIG, then it should just use the default cache storage. If an administrator wants to use the same Redis server for all caches, it's not difficult to reuse an ENV variable or extend a shared Python variable in their own config file.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817145733



##########
File path: superset/config.py
##########
@@ -576,31 +578,44 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The global config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",
+        "CACHE_THRESHOLD": math.inf,

Review comment:
       It turns out `FileSystemCache` treats `"CACHE_THRESHOLD": 0` as "no threshold", while `SimpleCache` treats it as "expire everything".
   - `SimpleCache`: https://github.com/pallets-eco/flask-caching/blob/058629ca4d38d1215fd911d41443751d0806bd4c/src/flask_caching/backends/simplecache.py#L61-L69
   - `FileSystemCache`: https://github.com/pallets-eco/flask-caching/blob/058629ca4d38d1215fd911d41443751d0806bd4c/src/flask_caching/backends/filesystemcache.py#L128-L147
   
   Both default to 500 if unset (The setting has no effect on other backends). To avoid a situation where someone wonders why their cache starts expiring entries before the timeout I decided to set `CACHE_THRESHOLD` to `math.inf`.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817879887



##########
File path: superset/utils/cache_manager.py
##########
@@ -28,41 +34,47 @@ def __init__(self) -> None:
         self._filter_state_cache = Cache()
         self._explore_form_data_cache = Cache()
 
+    @staticmethod
+    def _init_cache(
+        app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        cache_config = app.config[cache_config_key]
+        cache_type = cache_config.get("CACHE_TYPE")
+        if app.debug and cache_type is None:
+            cache_threshold = cache_config.get("CACHE_THRESHOLD", math.inf)
+            cache_config.update(
+                {"CACHE_TYPE": "SimpleCache", "CACHE_THRESHOLD": cache_threshold,}

Review comment:
       Yeah this has been annoying me for a long time. I'm sure it's been fixed in a new version of black, would be nice to take a stab at updating it.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817005785



##########
File path: superset/config.py
##########
@@ -576,29 +577,43 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The config flag CACHE_DEFAULT_TIMEOUT has been deprecated "

Review comment:
       Ah yes - I was referring to the Superset config param, not the Flask-Caching cache config param. I agree and I see it now, this needs to be reworded.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817583280



##########
File path: superset/config.py
##########
@@ -576,29 +577,43 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
 # Setup image size default is (300, 200, True)
 # IMG_SIZE = (300, 200, True)
 
-# Default cache timeout, applies to all cache backends unless specifically overridden in
+
+# Default cache config, applies to all cache backends unless specifically overridden in
 # each cache config.
-CACHE_DEFAULT_TIMEOUT = int(timedelta(days=1).total_seconds())
+def DEFAULT_CACHE_CONFIG_FUNC(  # pylint: disable=invalid-name
+    app: Flask,
+) -> CacheConfig:
+    default_timeout = app.config.get("CACHE_DEFAULT_TIMEOUT")
+    if default_timeout is None:
+        default_timeout = int(timedelta(days=1).total_seconds())
+    else:
+        logger.warning(
+            "The config flag CACHE_DEFAULT_TIMEOUT has been deprecated "
+            "and will be removed in Superset 2.0. Please set default cache options in "
+            "DEFAULT_CACHE_CONFIG_FUNC"
+        )
+
+    return {
+        "CACHE_TYPE": "SimpleCache" if app.debug else "NullCache",

Review comment:
       Made changes




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817619939



##########
File path: superset/utils/cache_manager.py
##########
@@ -14,73 +14,78 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+import logging
+import math
+
 from flask import Flask
+from flask_babel import gettext as _
 from flask_caching import Cache
 
+from superset.typing import CacheConfig
+
+logger = logging.getLogger(__name__)
+
 
 class CacheManager:
     def __init__(self) -> None:
         super().__init__()
 
-        self._cache = Cache()
-        self._data_cache = Cache()
-        self._thumbnail_cache = Cache()
-        self._filter_state_cache = Cache()
-        self._explore_form_data_cache = Cache()
+        self._default_cache_config: CacheConfig = {}
+        self.cache = Cache()
+        self.data_cache = Cache()
+        self.thumbnail_cache = Cache()
+        self.filter_state_cache = Cache()
+        self.explore_form_data_cache = Cache()
+
+    def _init_cache(
+        self, app: Flask, cache: Cache, cache_config_key: str, required: bool = False
+    ) -> None:
+        config = {**self._default_cache_config, **app.config[cache_config_key]}
+        if required and config["CACHE_TYPE"] in ("null", "NullCache"):
+            raise Exception(
+                _(
+                    "The CACHE_TYPE `%(cache_type)s` for `%(cache_config_key)s` is not "
+                    "supported. It is recommended to use `RedisCache`, `MemcachedCache` "
+                    "or another dedicated caching backend for production deployments",
+                    cache_type=config["CACHE_TYPE"],
+                    cache_config_key=cache_config_key,
+                ),
+            )
+        cache.init_app(app, config)
 
     def init_app(self, app: Flask) -> None:
-        self._cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["CACHE_CONFIG"],
-            },
-        )
-        self._data_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["DATA_CACHE_CONFIG"],
-            },
-        )
-        self._thumbnail_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["THUMBNAIL_CACHE_CONFIG"],
-            },
-        )
-        self._filter_state_cache.init_app(
-            app,
-            {
-                "CACHE_DEFAULT_TIMEOUT": app.config["CACHE_DEFAULT_TIMEOUT"],
-                **app.config["FILTER_STATE_CACHE_CONFIG"],
-            },
+        if app.debug:
+            self._default_cache_config = {
+                "CACHE_TYPE": "SimpleCache",
+                "CACHE_THRESHOLD": math.inf,
+            }
+        else:
+            self._default_cache_config = {}

Review comment:
       Is this required? `_default_cache_config` is already being initialized in the constructor.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #18976: chore(cache): default to SimpleCache in debug mode

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #18976:
URL: https://github.com/apache/superset/pull/18976#discussion_r817873193



##########
File path: UPDATING.md
##########
@@ -26,6 +26,7 @@ assists people when migrating to a new version.
 
 ### Breaking Changes
 
+- [18976](https://github.com/apache/superset/pull/18976): When running the app in debug mode, the app will default to use `SimpleCache` for `FILTER_STATE_CACHE_CONFIG` and `EXPLORE_FORM_DATA_CACHE_CONFIG`. When running in non-debug mode, a cache backend will need to be defined, otherwise the application will fail to start. For installations using Redis or other caching backends, it is recommended to use the same backend for both cache configs.

Review comment:
       > For installations using Redis or other caching backends, it is recommended to use the same backend for both cache configs.
   
   I'm wondering if there is a real need in configuring different cache expiration for both cache storages? If not, maybe we should just merge them---into something like `SEMI_PERSISTENT_CACHE_STORAGE` (albeit it'd be a bigger breaking change)?  
   




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org