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 2021/12/28 18:01:25 UTC

[GitHub] [superset] michael-s-molina opened a new pull request #17882: feat: Adds a key-value endpoint to store charts form data

michael-s-molina opened a new pull request #17882:
URL: https://github.com/apache/superset/pull/17882


   ### SUMMARY
   Currently, the Explore state is being stored in the URL to allow users to preserve their current interactions in case of a refresh and also to transfer context between the dashboard and Explore. The problem with this approach is that when the size of the state is big, it provokes URL length problems with the major browsers.
   
   The proposed solution in this PR is to store the Explore state on the server-side and keep in the URL only a secure key that gives access to the stored content. To do that, we'll extend the current chart endpoint with an additional path that supports the storage of information in the form of key-value entries. By making this endpoint relative to the main resource we can reuse the security model and access grants.
   
   The additional endpoint and the supported operations are:
   
   ```
   POST api/v1/chart/<id>/form_data
   
   BODY 
   {
      // Any type of JSON supported text.
      value: <string>,
   }
   
   RESPONSE
   {
      // The key generated on the server-side
      key: <string>
   }
   ```
   ```
   PUT api/v1/chart/<id>/form_data/<key>
   
   BODY
   {
      // Any type of JSON supported text.
      value: <string>,
   }
   
   RESPONSE
   {
      // The result of the operation
      message: <string>
   }
   ```
   ```
   GET api/v1/chart/<id>/form_data/<key>
   
   RESPONSE
   {
      // Any type of JSON supported text.
      value: <string>,
   }
   ```
   ```
   DELETE api/v1/chart/<id>/form_data/<key>
   
   RESPONSE
   {
      // The result of the operation
      message: <string>
   }
   ```
   
   All the endpoints accept an optional query parameter called `dataset_id` that is used for the cases when a chart is not saved yet but we want to preserve the state. In this case, the chart ID shall be set to 0:
   ```
   POST api/v1/chart/0/form_data?dataset_id=<id>
   ```
   
   
   The keys are generated on the server-side using the https://docs.python.org/3/library/secrets.html#secrets.token_urlsafe function and the value can be any JSON supported text.
   
   To store the key-value entries, this PR uses Flask-Caching, which enables support to different backends like Redis, Memcached, file system, etc. It also allows the configuration of expiration times for the stored entries in order to discard the ones that are not being used anymore and optimize the required storage space.
   
   This PR also allows a configuration to preserve actively accessed entries by renewing the expiration time every time a value is retrieved.
   
   ### TESTING INSTRUCTIONS
   1 - Execute Python tests
   2 - All tests should pass
   
   ### ADDITIONAL INFORMATION
   - [ ] 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
   - [x] 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] michael-s-molina commented on pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1011042880


   > > > I can create the same cache of form_data and not any limitation. Is it by design?
   > > 
   > > 
   > > @zhaoyongjie Yes. It's by design. This is especially useful when a user shares a URL with someone. We save the same content over a different key so that any modification made by a user does not affect the other one.
   > 
   > The problem is that the same user session and the same query payload. It will generate the different cache keys. In the other word, **EVERY** HTTP request will generate a new **record** or **entity** in cache system. It will quickly consume the cache system.
   
   That's not how it will work. A new key will be generated only when mounting. After that, we'll use the `PUT` method to replace the values.


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0892cd0) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **increase** coverage by `0.02%`.
   > The diff coverage is `97.22%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.12%   +0.02%     
   ==========================================
     Files        1612     1619       +7     
     Lines       64999    65264     +265     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43810     +194     
   - Misses      19513    19584      +71     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.27% <50.34%> (-0.05%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `82.23% <97.22%> (-0.04%)` | :arrow_down: |
   | presto | `53.11% <50.34%> (-0.05%)` | :arrow_down: |
   | python | `82.63% <97.22%> (-0.09%)` | :arrow_down: |
   | sqlite | `81.93% <97.22%> (-0.03%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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.69% <100.00%> (+0.05%)` | :arrow_up: |
   | ... and [27 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...0892cd0](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f72023d) into [master](https://codecov.io/gh/apache/superset/commit/ef57bd19024e2e8bac64d5475e74b7d0c215872d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ef57bd1) will **increase** coverage by `0.25%`.
   > The diff coverage is `92.54%`.
   
   > :exclamation: Current head f72023d differs from pull request most recent head 322c8c9. Consider uploading reports for the commit 322c8c9 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   66.91%   67.17%   +0.25%     
   ==========================================
     Files        1609     1615       +6     
     Lines       64897    65059     +162     
     Branches     6866     6866              
   ==========================================
   + Hits        43426    43703     +277     
   + Misses      19605    19490     -115     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `81.89% <92.54%> (?)` | |
   | mysql | `82.26% <92.54%> (+0.07%)` | :arrow_up: |
   | postgres | `82.32% <92.54%> (+0.07%)` | :arrow_up: |
   | presto | `82.19% <92.54%> (?)` | |
   | python | `82.80% <92.54%> (+0.47%)` | :arrow_up: |
   | sqlite | `82.00% <92.54%> (+0.07%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `60.71% <60.71%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `88.23% <87.50%> (+1.56%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `88.88% <88.88%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `93.75% <93.75%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `89.65% <97.14%> (+11.34%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [22 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [ef57bd1...322c8c9](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/utils.py
##########
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from superset import security_manager
+from superset.charts.commands.exceptions import (
+    ChartAccessDeniedError,
+    ChartNotFoundError,
+)
+from superset.charts.dao import ChartDAO
+from superset.datasets.commands.exceptions import (
+    DatasetAccessDeniedError,
+    DatasetNotFoundError,
+)
+from superset.datasets.dao import DatasetDAO
+from superset.key_value.commands.parameters import CommandParameters
+from superset.views.base import is_user_admin
+from superset.views.utils import is_owner
+
+
+def get_dataset_id(cmd_params: CommandParameters) -> Optional[str]:
+    query_params = cmd_params.query_params
+    if query_params:
+        return query_params.get("dataset_id")
+    return None
+
+
+def check_access(cmd_params: CommandParameters) -> Optional[bool]:
+    resource_id = cmd_params.resource_id
+    actor = cmd_params.actor
+    if resource_id == 0:
+        dataset_id = get_dataset_id(cmd_params)
+        if dataset_id:
+            dataset = DatasetDAO.find_by_id(int(dataset_id))
+            if dataset:
+                can_access_datasource = security_manager.can_access_datasource(dataset)
+                if can_access_datasource:
+                    return True
+                raise DatasetAccessDeniedError()
+        raise DatasetNotFoundError()
+    chart = ChartDAO.find_by_id(resource_id)
+    if chart:
+        can_access_chart = (
+            is_user_admin()
+            or is_owner(chart, actor)
+            or security_manager.can_access("can_write", "Chart")
+        )
+        if can_access_chart:

Review comment:
       > Here we're assuming that if a user has access to a chart, it means that they have access to the dataset. That's why we only check the dataset when the chart is not saved.
   
   What I meant is your access control when chart id is present doesn't seem to check dataset access, then why would it be necessary when chart id is not? We may want to change the former if the answer for my next question is yes (see below) but that would be a separate PR since it'd break some current workflows.
   
   > That's true but we also need to consider a call to the API directly.
   
   The only information leaked would be the chart configuration, maybe some axis label names and metrics/columns used, which is different than accessing the dataset itself. Do we consider these sensitive--for those with global read access to charts?




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/config.py
##########
@@ -577,6 +577,15 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
     "REFRESH_TIMEOUT_ON_RETRIEVAL": True,
 }
 
+# Cache for chart form data
+CHART_FORM_DATA_CACHE_CONFIG: CacheConfig = {
+    "CACHE_TYPE": "filesystem",

Review comment:
       Hi @ktmud. These are all great questions that also appeared while we were discussing this feature internally. This is a great opportunity to post the conclusions of those discussions 😄
   
   > 1. We already have a short URL generator that produces a numeric ID. Will this replace it?
   
   We considered using this generator but the problem was its numerical characteristics. It allows a user to guess potential IDs and it's not ideal for the type of information that could be stored. The idea is to replace the short URL generator with this new approach while maintaining backward compatibility. This will be handled by another PR that is already in development.
   
   > 2. Since the key is after a chart id, does this mean when users create a new chart, we'd have to create a new chart object first, too? IIRC, currently we don't do that.
   
   We won't need to create a new chart object first. This part in the PR's description talks about it:
   
   > All the endpoints accept an optional query parameter called dataset_id that is used for the cases when a chart is not saved yet but we want to preserve the state. In this case, the chart ID shall be set to 0:
   >
   > `POST api/v1/chart/0/form_data?dataset_id=<id>`
   
   In this case, the primary resource is the dataset and all its security rules are applied.
   
   > 3. We already have a [KeyValue](https://github.com/apache/superset/blob/d2d4f8eb447c40a76e619d4cd6dec5ba21a9ea27/superset/models/core.py#L84-L90) model that is more persistent than `Flask-Caching`. Is there a reason why we are not reusing it? It feels to me both dashboard filter states and explore chart states should be persistent since they will produce sharable URLs. We may need a mechanism to periodically delete old records to reduce database size, but that's better than cache server failure causing a URL to go stale at an unpredictable time.
   
   That was in fact our first approach. We discarded this solution because:
   - The numerical nature of the IDs
   - The lack of management properties associated with the entries prevents the maintainability of the records.
   - This feature is behind a feature flag and is disabled by default. Changing its state constitutes a breaking change.
   - We would need to develop the management system (we even did that during the POC). This logic is already handled by Flask-Caching.
   - We wanted to provide administrators with the possibility of choosing which persistence mechanism is best suited for their use cases. Some will use Redis as the main persistence mechanism while periodically [storing the memory content on the disk](https://redis.io/topics/persistence). This can ensure performance and persistence at the same time. Others will use the file system to store this type of information and so on.
   




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/key_value/commands/update.py
##########
@@ -16,30 +16,25 @@
 # under the License.
 import logging
 from abc import ABC, abstractmethod
-from typing import Optional
 
-from flask_appbuilder.models.sqla import Model
-from flask_appbuilder.security.sqla.models import User
 from sqlalchemy.exc import SQLAlchemyError
 
 from superset.commands.base import BaseCommand
 from superset.key_value.commands.exceptions import KeyValueUpdateFailedError
+from superset.key_value.commands.parameters import CommandParameters
 
 logger = logging.getLogger(__name__)
 
 
 class UpdateKeyValueCommand(BaseCommand, ABC):
     def __init__(
-        self, actor: User, resource_id: int, key: str, value: str,
+        self, cmd_params: CommandParameters,
     ):
-        self._actor = actor
-        self._resource_id = resource_id
-        self._key = key
-        self._value = value
+        self._parameters = cmd_params

Review comment:
       Could we have the same variable name here? Either `self._cmd_params = cmd_params` or rename in the sig to get `self._parameters = parameters`

##########
File path: superset/charts/form_data/commands/get.py
##########
@@ -0,0 +1,43 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from flask import current_app as app
+
+from superset.charts.form_data.utils import check_access
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.commands.get import GetKeyValueCommand
+from superset.key_value.commands.parameters import CommandParameters
+from superset.key_value.utils import cache_key
+
+
+class GetFormDataCommand(GetKeyValueCommand):
+    def get(self, cmd_params: CommandParameters) -> Optional[str]:
+        resource_id = cmd_params["resource_id"]
+        key = cmd_params["key"]
+        config = app.config["CHART_FORM_DATA_CACHE_CONFIG"]

Review comment:
       nit: Should we move this to a class or object property so we don't have to check this every time on the get? Feels like this should be referenced only once.

##########
File path: tests/integration_tests/charts/form_data/api_tests.py
##########
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+
+import pytest
+from flask_appbuilder.security.sqla.models import User
+from sqlalchemy.orm import Session
+
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.utils import cache_key
+from superset.models.slice import Slice
+from tests.integration_tests.base_tests import login
+from tests.integration_tests.fixtures.world_bank_dashboard import (
+    load_world_bank_dashboard_with_slices,
+    load_world_bank_data,
+)
+from tests.integration_tests.test_app import app
+
+key = "test-key"
+value = "test"
+
+
+@pytest.fixture
+def client():
+    with app.test_client() as client:
+        with app.app_context():
+            yield client
+
+
+@pytest.fixture
+def chart_id(load_world_bank_dashboard_with_slices) -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        chart = session.query(Slice).filter_by(slice_name="World's Population").one()
+        return chart.id
+
+
+@pytest.fixture
+def admin_id() -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        admin = session.query(User).filter_by(username="admin").one()
+        return admin.id

Review comment:
       Same here

##########
File path: superset/key_value/commands/parameters.py
##########
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Dict
+
+from flask_appbuilder.security.sqla.models import User
+from typing_extensions import TypedDict
+
+
+class CommandParameters(TypedDict, total=False):
+    actor: User
+    resource_id: int
+    key: str
+    value: str
+    query_params: Dict[str, str]

Review comment:
       As we don't need to serialize/deserialize these to/from JSON, could we rather use a `@dataclass` here? https://docs.python.org/3/library/dataclasses.html This will make accessing properties more pythonic; `cmd_params.actor` vs `cmd_params["actor"]`.

##########
File path: tests/integration_tests/charts/form_data/api_tests.py
##########
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+
+import pytest
+from flask_appbuilder.security.sqla.models import User
+from sqlalchemy.orm import Session
+
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.utils import cache_key
+from superset.models.slice import Slice
+from tests.integration_tests.base_tests import login
+from tests.integration_tests.fixtures.world_bank_dashboard import (
+    load_world_bank_dashboard_with_slices,
+    load_world_bank_data,
+)
+from tests.integration_tests.test_app import app
+
+key = "test-key"
+value = "test"
+
+
+@pytest.fixture
+def client():
+    with app.test_client() as client:
+        with app.app_context():
+            yield client
+
+
+@pytest.fixture
+def chart_id(load_world_bank_dashboard_with_slices) -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        chart = session.query(Slice).filter_by(slice_name="World's Population").one()
+        return chart.id

Review comment:
       Don' we need to make sure the world bank data is available by adding the decorator here?
   ```
   @pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
   @pytest.fixture
   def chart_id(load_world_bank_dashboard_with_slices) -> int:
       ...
   ```
   




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/__init__.py
##########
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.

Review comment:
       Yes. https://stackoverflow.com/questions/37139786/is-init-py-not-required-for-packages-in-python-3-3




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3d3658d) into [master](https://codecov.io/gh/apache/superset/commit/eff4d387de1501d21b4bd51e3a77541b425e79cc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eff4d38) will **decrease** coverage by `0.05%`.
   > The diff coverage is `91.48%`.
   
   > :exclamation: Current head 3d3658d differs from pull request most recent head a5da396. Consider uploading reports for the commit a5da396 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.07%   67.02%   -0.06%     
   ==========================================
     Files        1609     1617       +8     
     Lines       64899    65163     +264     
     Branches     6866     6866              
   ==========================================
   + Hits        43533    43677     +144     
   - Misses      19500    19620     +120     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `82.30% <ø> (+0.11%)` | :arrow_up: |
   | postgres | `82.35% <ø> (+0.11%)` | :arrow_up: |
   | presto | `?` | |
   | python | `82.44% <ø> (-0.25%)` | :arrow_down: |
   | sqlite | `82.04% <ø> (+0.11%)` | :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/17882?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntend/packages/superset-ui-core/src/color/index.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvY29sb3IvaW5kZXgudHM=) | `100.00% <ø> (ø)` | |
   | [...s/legacy-plugin-chart-country-map/src/countries.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LWNvdW50cnktbWFwL3NyYy9jb3VudHJpZXMudHM=) | `100.00% <ø> (ø)` | |
   | [.../plugins/legacy-preset-chart-nvd3/src/Bar/index.js](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL0Jhci9pbmRleC5qcw==) | `66.66% <ø> (ø)` | |
   | [...gins/legacy-preset-chart-nvd3/src/DistBar/index.js](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL0Rpc3RCYXIvaW5kZXguanM=) | `66.66% <ø> (ø)` | |
   | [...ins/legacy-preset-chart-nvd3/src/DualLine/index.js](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL0R1YWxMaW5lL2luZGV4Lmpz) | `66.66% <ø> (ø)` | |
   | [...plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL1JlYWN0TlZEMy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...ashboard/components/gridComponents/ChartHolder.jsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0SG9sZGVyLmpzeA==) | `58.82% <0.00%> (ø)` | |
   | [...mponents/nativeFilters/FiltersConfigModal/state.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyc0NvbmZpZ01vZGFsL3N0YXRlLnRz) | `73.33% <ø> (ø)` | |
   | [...rontend/src/dashboard/containers/DashboardPage.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZFBhZ2UudHN4) | `25.24% <ø> (ø)` | |
   | ... and [84 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [eff4d38...a5da396](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bb15449) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **increase** coverage by `0.07%`.
   > The diff coverage is `97.92%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.18%   +0.07%     
   ==========================================
     Files        1612     1620       +8     
     Lines       64999    65372     +373     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43918     +302     
   - Misses      19513    19584      +71     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.21% <50.51%> (-0.11%)` | :arrow_down: |
   | mysql | `82.21% <97.92%> (-0.01%)` | :arrow_down: |
   | postgres | `82.25% <97.92%> (-0.03%)` | :arrow_down: |
   | presto | `53.05% <50.51%> (-0.11%)` | :arrow_down: |
   | python | `82.69% <97.92%> (-0.03%)` | :arrow_down: |
   | sqlite | `81.95% <97.92%> (+<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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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% <100.00%> (+0.10%)` | :arrow_up: |
   | ... and [48 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...bb15449](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bb15449) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **increase** coverage by `0.03%`.
   > The diff coverage is `97.92%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.14%   +0.03%     
   ==========================================
     Files        1612     1620       +8     
     Lines       64999    65372     +373     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43892     +276     
   - Misses      19513    19610      +97     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.21% <50.51%> (-0.11%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `82.25% <97.92%> (-0.03%)` | :arrow_down: |
   | presto | `53.05% <50.51%> (-0.11%)` | :arrow_down: |
   | python | `82.60% <97.92%> (-0.11%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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% <100.00%> (+0.10%)` | :arrow_up: |
   | ... and [55 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...bb15449](https://codecov.io/gh/apache/superset/pull/17882?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] dpgaspar commented on a change in pull request #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/api.py
##########
@@ -0,0 +1,246 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import Type
+
+from flask import Response
+from flask_appbuilder.api import expose, protect, safe
+
+from superset.charts.form_data.commands.create import CreateFormDataCommand
+from superset.charts.form_data.commands.delete import DeleteFormDataCommand
+from superset.charts.form_data.commands.get import GetFormDataCommand
+from superset.charts.form_data.commands.update import UpdateFormDataCommand
+from superset.extensions import event_logger
+from superset.key_value.api import KeyValueRestApi
+
+logger = logging.getLogger(__name__)
+
+
+class ChartFormDataRestApi(KeyValueRestApi):
+    class_permission_name = "ChartFormDataRestApi"
+    resource_name = "chart"
+    openapi_spec_tag = "Chart Form Data"
+
+    def get_create_command(self) -> Type[CreateFormDataCommand]:
+        return CreateFormDataCommand
+
+    def get_update_command(self) -> Type[UpdateFormDataCommand]:
+        return UpdateFormDataCommand
+
+    def get_get_command(self) -> Type[GetFormDataCommand]:
+        return GetFormDataCommand
+
+    def get_delete_command(self) -> Type[DeleteFormDataCommand]:
+        return DeleteFormDataCommand
+
+    @expose("/<int:pk>/form_data", methods=["POST"])
+    @protect()
+    @safe
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post",
+        log_to_statsd=False,
+    )
+    def post(self, pk: int) -> Response:
+        """Stores a new value.
+        ---
+        post:
+          description: >-
+            Stores a new value.
+          parameters:
+          - in: path
+            schema:
+              type: integer
+            name: pk
+          - in: query
+            schema:
+              type: integer
+            name: dataset
+            required: false
+          requestBody:
+            required: true
+            content:
+              application/json:
+                schema:
+                    type: object

Review comment:
       remove the `type: object` and fix indentation

##########
File path: superset/charts/form_data/commands/delete.py
##########
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from superset.charts.form_data.utils import check_access
+from superset.extensions import cache_manager
+from superset.key_value.commands.delete import DeleteKeyValueCommand
+from superset.key_value.commands.entry import Entry
+from superset.key_value.commands.exceptions import KeyValueAccessDeniedError
+from superset.key_value.commands.parameters import CommandParameters
+from superset.key_value.utils import cache_key
+
+
+class DeleteFormDataCommand(DeleteKeyValueCommand):
+    def delete(self, cmd_params: CommandParameters) -> bool:
+        resource_id = cmd_params["resource_id"]
+        actor = cmd_params["actor"]
+        key = cmd_params["key"]
+        check_access(cmd_params)
+        entry: Entry = cache_manager.chart_form_data_cache.get(
+            cache_key(resource_id, key)
+        )
+        if entry:
+            if entry["owner"] != actor.get_user_id():
+                raise KeyValueAccessDeniedError()

Review comment:
       would be great to have a test case to cover this path

##########
File path: superset/key_value/api.py
##########
@@ -48,65 +58,113 @@ class KeyValueRestApi(BaseApi, ABC):
     allow_browser_login = True
 
     def add_apispec_components(self, api_spec: APISpec) -> None:
-        api_spec.components.schema(
-            KeyValuePostSchema.__name__, schema=KeyValuePostSchema,
-        )
-        api_spec.components.schema(
-            KeyValuePutSchema.__name__, schema=KeyValuePutSchema,
-        )
+        try:
+            api_spec.components.schema(

Review comment:
       can we instead use `openapi_spec_component_schemas` for this?

##########
File path: superset/charts/form_data/api.py
##########
@@ -0,0 +1,246 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import Type
+
+from flask import Response
+from flask_appbuilder.api import expose, protect, safe
+
+from superset.charts.form_data.commands.create import CreateFormDataCommand
+from superset.charts.form_data.commands.delete import DeleteFormDataCommand
+from superset.charts.form_data.commands.get import GetFormDataCommand
+from superset.charts.form_data.commands.update import UpdateFormDataCommand
+from superset.extensions import event_logger
+from superset.key_value.api import KeyValueRestApi
+
+logger = logging.getLogger(__name__)
+
+
+class ChartFormDataRestApi(KeyValueRestApi):
+    class_permission_name = "ChartFormDataRestApi"
+    resource_name = "chart"
+    openapi_spec_tag = "Chart Form Data"
+
+    def get_create_command(self) -> Type[CreateFormDataCommand]:
+        return CreateFormDataCommand
+
+    def get_update_command(self) -> Type[UpdateFormDataCommand]:
+        return UpdateFormDataCommand
+
+    def get_get_command(self) -> Type[GetFormDataCommand]:
+        return GetFormDataCommand
+
+    def get_delete_command(self) -> Type[DeleteFormDataCommand]:
+        return DeleteFormDataCommand
+
+    @expose("/<int:pk>/form_data", methods=["POST"])
+    @protect()
+    @safe
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post",
+        log_to_statsd=False,
+    )
+    def post(self, pk: int) -> Response:
+        """Stores a new value.
+        ---
+        post:
+          description: >-
+            Stores a new value.
+          parameters:
+          - in: path
+            schema:
+              type: integer
+            name: pk
+          - in: query
+            schema:
+              type: integer
+            name: dataset
+            required: false
+          requestBody:
+            required: true
+            content:
+              application/json:
+                schema:
+                    type: object
+                    $ref: '#/components/schemas/KeyValuePostSchema'
+          responses:
+            201:
+              description: The value was stored successfully.
+              content:
+                application/json:
+                  schema:
+                    type: object
+                    properties:
+                      key:
+                        type: string
+                        description: The key to retrieve the value.
+            400:
+              $ref: '#/components/responses/400'
+            401:
+              $ref: '#/components/responses/401'
+            422:
+              $ref: '#/components/responses/422'
+            500:
+              $ref: '#/components/responses/500'
+        """
+        return super().post(pk)
+
+    @expose("/<int:pk>/form_data/<string:key>/", methods=["PUT"])
+    @protect()
+    @safe
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.put",
+        log_to_statsd=False,
+    )
+    def put(self, pk: int, key: str) -> Response:
+        """Updates an existing value.
+        ---
+        put:
+          description: >-
+            Updates an existing value.
+          parameters:
+          - in: path
+            schema:
+              type: integer
+            name: pk
+          - in: path
+            schema:
+              type: string
+            name: key
+          requestBody:
+            required: true
+            content:
+              application/json:
+                schema:
+                    type: object

Review comment:
       same 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] michael-s-molina commented on a change in pull request #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: tests/integration_tests/charts/form_data/api_tests.py
##########
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+
+import pytest
+from flask_appbuilder.security.sqla.models import User
+from sqlalchemy.orm import Session
+
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.utils import cache_key
+from superset.models.slice import Slice
+from tests.integration_tests.base_tests import login
+from tests.integration_tests.fixtures.world_bank_dashboard import (
+    load_world_bank_dashboard_with_slices,
+    load_world_bank_data,
+)
+from tests.integration_tests.test_app import app
+
+key = "test-key"
+value = "test"
+
+
+@pytest.fixture
+def client():
+    with app.test_client() as client:
+        with app.app_context():
+            yield client
+
+
+@pytest.fixture
+def chart_id(load_world_bank_dashboard_with_slices) -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        chart = session.query(Slice).filter_by(slice_name="World's Population").one()
+        return chart.id

Review comment:
       It's not required. https://docs.pytest.org/en/6.2.x/fixture.html#requesting-fixtures




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/key_value/commands/update.py
##########
@@ -16,30 +16,25 @@
 # under the License.
 import logging
 from abc import ABC, abstractmethod
-from typing import Optional
 
-from flask_appbuilder.models.sqla import Model
-from flask_appbuilder.security.sqla.models import User
 from sqlalchemy.exc import SQLAlchemyError
 
 from superset.commands.base import BaseCommand
 from superset.key_value.commands.exceptions import KeyValueUpdateFailedError
+from superset.key_value.commands.parameters import CommandParameters
 
 logger = logging.getLogger(__name__)
 
 
 class UpdateKeyValueCommand(BaseCommand, ABC):
     def __init__(
-        self, actor: User, resource_id: int, key: str, value: str,
+        self, cmd_params: CommandParameters,
     ):
-        self._actor = actor
-        self._resource_id = resource_id
-        self._key = key
-        self._value = value
+        self._parameters = cmd_params

Review comment:
       Could we have the same variable name here? Either `self._cmd_params = cmd_params` or rename in the sig to get `self._parameters = parameters`

##########
File path: superset/charts/form_data/commands/get.py
##########
@@ -0,0 +1,43 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from flask import current_app as app
+
+from superset.charts.form_data.utils import check_access
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.commands.get import GetKeyValueCommand
+from superset.key_value.commands.parameters import CommandParameters
+from superset.key_value.utils import cache_key
+
+
+class GetFormDataCommand(GetKeyValueCommand):
+    def get(self, cmd_params: CommandParameters) -> Optional[str]:
+        resource_id = cmd_params["resource_id"]
+        key = cmd_params["key"]
+        config = app.config["CHART_FORM_DATA_CACHE_CONFIG"]

Review comment:
       nit: Should we move this to a class or object property so we don't have to check this every time on the get? Feels like this should be referenced only once.

##########
File path: tests/integration_tests/charts/form_data/api_tests.py
##########
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+
+import pytest
+from flask_appbuilder.security.sqla.models import User
+from sqlalchemy.orm import Session
+
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.utils import cache_key
+from superset.models.slice import Slice
+from tests.integration_tests.base_tests import login
+from tests.integration_tests.fixtures.world_bank_dashboard import (
+    load_world_bank_dashboard_with_slices,
+    load_world_bank_data,
+)
+from tests.integration_tests.test_app import app
+
+key = "test-key"
+value = "test"
+
+
+@pytest.fixture
+def client():
+    with app.test_client() as client:
+        with app.app_context():
+            yield client
+
+
+@pytest.fixture
+def chart_id(load_world_bank_dashboard_with_slices) -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        chart = session.query(Slice).filter_by(slice_name="World's Population").one()
+        return chart.id
+
+
+@pytest.fixture
+def admin_id() -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        admin = session.query(User).filter_by(username="admin").one()
+        return admin.id

Review comment:
       Same here

##########
File path: superset/key_value/commands/parameters.py
##########
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Dict
+
+from flask_appbuilder.security.sqla.models import User
+from typing_extensions import TypedDict
+
+
+class CommandParameters(TypedDict, total=False):
+    actor: User
+    resource_id: int
+    key: str
+    value: str
+    query_params: Dict[str, str]

Review comment:
       As we don't need to serialize/deserialize these to/from JSON, could we rather use a `@dataclass` here? https://docs.python.org/3/library/dataclasses.html This will make accessing properties more pythonic; `cmd_params.actor` vs `cmd_params["actor"]`.

##########
File path: tests/integration_tests/charts/form_data/api_tests.py
##########
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+
+import pytest
+from flask_appbuilder.security.sqla.models import User
+from sqlalchemy.orm import Session
+
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.utils import cache_key
+from superset.models.slice import Slice
+from tests.integration_tests.base_tests import login
+from tests.integration_tests.fixtures.world_bank_dashboard import (
+    load_world_bank_dashboard_with_slices,
+    load_world_bank_data,
+)
+from tests.integration_tests.test_app import app
+
+key = "test-key"
+value = "test"
+
+
+@pytest.fixture
+def client():
+    with app.test_client() as client:
+        with app.app_context():
+            yield client
+
+
+@pytest.fixture
+def chart_id(load_world_bank_dashboard_with_slices) -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        chart = session.query(Slice).filter_by(slice_name="World's Population").one()
+        return chart.id

Review comment:
       Don' we need to make sure the world bank data is available by adding the decorator here?
   ```
   @pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
   @pytest.fixture
   def chart_id(load_world_bank_dashboard_with_slices) -> int:
       ...
   ```
   




-- 
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] zhaoyongjie edited a comment on pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
zhaoyongjie edited a comment on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1011038742


   > > I can create the same cache of form_data and not any limitation. Is it by design?
   > 
   > @zhaoyongjie Yes. It's by design. This is especially useful when a user shares a URL with someone. We save the same content over a different key so that any modification made by a user does not affect the other one.
   
   The problem is that the same user session and the same query payload. It will generate the different cache keys. In the other word,  ~~EVERY HTTP request~~ will generate a new **record** or **entity** in cache system. It will quickly consume the cache system.
   
   ---------
   Additional information:
   Every HTTP POST request with the same cache entity(like form_data) will generate a new **record** in cache system even though same user and chart.
   
   
   


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a1745b1) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.80%`.
   > The diff coverage is `83.09%`.
   
   > :exclamation: Current head a1745b1 differs from pull request most recent head 3cc1fa9. Consider uploading reports for the commit 3cc1fa9 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.29%   -0.81%     
   ==========================================
     Files        1612     1577      -35     
     Lines       64999    61947    -3052     
     Branches     6872     6242     -630     
   ==========================================
   - Hits        43616    41070    -2546     
   + Misses      19513    19279     -234     
   + Partials     1870     1598     -272     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `82.22% <85.59%> (+<0.01%)` | :arrow_up: |
   | postgres | `82.26% <85.59%> (-0.01%)` | :arrow_down: |
   | presto | `?` | |
   | python | `82.35% <85.59%> (-0.37%)` | :arrow_down: |
   | sqlite | `81.96% <85.59%> (+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/17882?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...-chart-controls/src/sections/advancedAnalytics.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3NlY3Rpb25zL2FkdmFuY2VkQW5hbHl0aWNzLnRzeA==) | `33.33% <ø> (ø)` | |
   | [...superset-ui-core/src/query/types/PostProcessing.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvcXVlcnkvdHlwZXMvUG9zdFByb2Nlc3NpbmcudHM=) | `100.00% <ø> (ø)` | |
   | [...ackages/superset-ui-core/src/utils/featureFlags.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvdXRpbHMvZmVhdHVyZUZsYWdzLnRz) | `100.00% <ø> (ø)` | |
   | [...s/legacy-plugin-chart-country-map/src/countries.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LWNvdW50cnktbWFwL3NyYy9jb3VudHJpZXMudHM=) | `100.00% <ø> (ø)` | |
   | [...legacy-plugin-chart-partition/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXBhcnRpdGlvbi9zcmMvY29udHJvbFBhbmVsLnRzeA==) | `25.00% <ø> (ø)` | |
   | [...gins/legacy-plugin-chart-rose/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXJvc2Uvc3JjL2NvbnRyb2xQYW5lbC50c3g=) | `50.00% <ø> (ø)` | |
   | [...gins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL05WRDNDb250cm9scy50c3g=) | `95.83% <ø> (ø)` | |
   | [...ugins/plugin-chart-echarts/src/Timeseries/types.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy90eXBlcy50cw==) | `100.00% <ø> (ø)` | |
   | [...frontend/src/SqlLab/components/ResultSet/index.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC9pbmRleC50c3g=) | `50.73% <0.00%> (-3.11%)` | :arrow_down: |
   | [...c/SqlLab/components/TemplateParamsEditor/index.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RlbXBsYXRlUGFyYW1zRWRpdG9yL2luZGV4LnRzeA==) | `75.00% <ø> (-9.00%)` | :arrow_down: |
   | ... and [581 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...3cc1fa9](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4e047ad) into [master](https://codecov.io/gh/apache/superset/commit/eff4d387de1501d21b4bd51e3a77541b425e79cc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eff4d38) will **increase** coverage by `0.08%`.
   > The diff coverage is `93.43%`.
   
   > :exclamation: Current head 4e047ad differs from pull request most recent head a5da396. Consider uploading reports for the commit a5da396 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.07%   67.16%   +0.08%     
   ==========================================
     Files        1609     1616       +7     
     Lines       64899    65083     +184     
     Branches     6866     6866              
   ==========================================
   + Hits        43533    43710     +177     
   - Misses      19500    19507       +7     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.29% <51.82%> (+<0.01%)` | :arrow_up: |
   | mysql | `82.27% <93.43%> (+0.08%)` | :arrow_up: |
   | postgres | `82.33% <93.43%> (+0.08%)` | :arrow_up: |
   | presto | `53.13% <51.82%> (+<0.01%)` | :arrow_up: |
   | python | `82.77% <93.43%> (+0.08%)` | :arrow_up: |
   | sqlite | `82.01% <93.43%> (+0.08%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `89.47% <89.47%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `90.90% <91.66%> (+4.24%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.23% <95.23%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+12.11%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [14 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [eff4d38...a5da396](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fca7ace) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.38%`.
   > The diff coverage is `98.28%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.71%   -0.39%     
   ==========================================
     Files        1612     1627      +15     
     Lines       64999    65428     +429     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43653      +37     
   - Misses      19513    19905     +392     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.15% <50.34%> (-1.17%)` | :arrow_down: |
   | mysql | `81.17% <98.28%> (-1.05%)` | :arrow_down: |
   | postgres | `81.22% <98.28%> (-1.05%)` | :arrow_down: |
   | presto | `52.00% <50.34%> (-1.16%)` | :arrow_down: |
   | python | `81.66% <98.28%> (-1.05%)` | :arrow_down: |
   | sqlite | `80.91% <98.28%> (-1.04%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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% <100.00%> (+0.10%)` | :arrow_up: |
   | [superset/dashboards/filter\_state/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvYXBpLnB5) | `100.00% <100.00%> (ø)` | |
   | ... and [69 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...fca7ace](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/key_value/commands/args.py
##########
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Dict
+
+from flask_appbuilder.security.sqla.models import User
+from typing_extensions import TypedDict
+
+
+class Args(TypedDict, total=False):

Review comment:
       They are more related to command parameters than arguments for the key-value store. I renamed it to `CommandParameters` 😄 




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/key_value/commands/create.py
##########
@@ -50,7 +47,5 @@ def validate(self) -> None:
         pass
 
     @abstractmethod
-    def create(
-        self, actor: User, resource_id: int, key: str, value: str
-    ) -> Optional[bool]:
+    def create(self, args: Args,) -> Optional[bool]:

Review comment:
       Yes




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/utils.py
##########
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from superset import security_manager
+from superset.charts.commands.exceptions import (
+    ChartAccessDeniedError,
+    ChartNotFoundError,
+)
+from superset.charts.dao import ChartDAO
+from superset.datasets.commands.exceptions import (
+    DatasetAccessDeniedError,
+    DatasetNotFoundError,
+)
+from superset.datasets.dao import DatasetDAO
+from superset.key_value.commands.parameters import CommandParameters
+from superset.views.base import is_user_admin
+from superset.views.utils import is_owner
+
+
+def get_dataset_id(cmd_params: CommandParameters) -> Optional[str]:
+    query_params = cmd_params.query_params
+    if query_params:
+        return query_params.get("dataset_id")
+    return None
+
+
+def check_access(cmd_params: CommandParameters) -> Optional[bool]:
+    resource_id = cmd_params.resource_id
+    actor = cmd_params.actor
+    if resource_id == 0:
+        dataset_id = get_dataset_id(cmd_params)
+        if dataset_id:
+            dataset = DatasetDAO.find_by_id(int(dataset_id))
+            if dataset:
+                can_access_datasource = security_manager.can_access_datasource(dataset)
+                if can_access_datasource:
+                    return True
+                raise DatasetAccessDeniedError()
+        raise DatasetNotFoundError()
+    chart = ChartDAO.find_by_id(resource_id)
+    if chart:
+        can_access_chart = (
+            is_user_admin()
+            or is_owner(chart, actor)
+            or security_manager.can_access("can_write", "Chart")
+        )
+        if can_access_chart:

Review comment:
       I may have missed it, but I don't think we have RBAC for charts right now. I'm okay with blocking user access to temporary form data if they don't have access to a chart, but let's make sure users don't automatically gain access to the dataset just because they have access to chart metadata.




-- 
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 merged pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
michael-s-molina merged pull request #17882:
URL: https://github.com/apache/superset/pull/17882


   


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f72023d) into [master](https://codecov.io/gh/apache/superset/commit/f8a65f8001a5069ab53ce9295fb378abec66dc90?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f8a65f8) will **increase** coverage by `0.07%`.
   > The diff coverage is `92.54%`.
   
   > :exclamation: Current head f72023d differs from pull request most recent head 95496ad. Consider uploading reports for the commit 95496ad to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.17%   +0.07%     
   ==========================================
     Files        1609     1615       +6     
     Lines       64897    65059     +162     
     Branches     6866     6866              
   ==========================================
   + Hits        43547    43703     +156     
   - Misses      19484    19490       +6     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `81.89% <92.54%> (+0.07%)` | :arrow_up: |
   | mysql | `82.26% <92.54%> (+0.07%)` | :arrow_up: |
   | postgres | `82.32% <92.54%> (+0.07%)` | :arrow_up: |
   | presto | `82.19% <92.54%> (+0.07%)` | :arrow_up: |
   | python | `82.80% <92.54%> (+0.07%)` | :arrow_up: |
   | sqlite | `82.00% <92.54%> (+0.07%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `60.71% <60.71%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `88.23% <87.50%> (+1.56%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `88.88% <88.88%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `93.75% <93.75%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `89.65% <97.14%> (+11.34%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [14 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [f8a65f8...95496ad](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/__init__.py
##########
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.

Review comment:
       Yes. https://stackoverflow.com/questions/37139786/is-init-py-not-required-for-packages-in-python-3-3




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bb15449) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **increase** coverage by `0.05%`.
   > The diff coverage is `97.92%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.16%   +0.05%     
   ==========================================
     Files        1612     1620       +8     
     Lines       64999    65372     +373     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43905     +289     
   - Misses      19513    19597      +84     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.21% <50.51%> (-0.11%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `82.25% <97.92%> (-0.03%)` | :arrow_down: |
   | presto | `53.05% <50.51%> (-0.11%)` | :arrow_down: |
   | python | `82.65% <97.92%> (-0.07%)` | :arrow_down: |
   | sqlite | `81.95% <97.92%> (+<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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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% <100.00%> (+0.10%)` | :arrow_up: |
   | ... and [49 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...bb15449](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ec87198) into [master](https://codecov.io/gh/apache/superset/commit/ef57bd19024e2e8bac64d5475e74b7d0c215872d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ef57bd1) will **increase** coverage by `0.03%`.
   > The diff coverage is `93.43%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.09%   67.13%   +0.03%     
   ==========================================
     Files        1609     1616       +7     
     Lines       64897    65081     +184     
     Branches     6866     6866              
   ==========================================
   + Hits        43545    43694     +149     
   - Misses      19486    19521      +35     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.29% <51.82%> (-28.52%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `82.31% <93.43%> (+0.07%)` | :arrow_up: |
   | presto | `53.13% <51.82%> (-28.98%)` | :arrow_down: |
   | python | `82.71% <93.43%> (-0.02%)` | :arrow_down: |
   | sqlite | `82.01% <93.43%> (+0.08%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `89.47% <89.47%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `90.90% <91.66%> (+4.24%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.23% <95.23%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+12.11%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [25 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [ef57bd1...ec87198](https://codecov.io/gh/apache/superset/pull/17882?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 edited a comment on pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
michael-s-molina edited a comment on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1005096583


   > First pass comments. The new API design looks good, but I think we may still need some further fine tuning.
   
   Great comments @villebro. I tackled them all.


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/commands/create.py
##########
@@ -0,0 +1,37 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from superset.charts.form_data.utils import check_access
+from superset.extensions import cache_manager
+from superset.key_value.commands.args import Args
+from superset.key_value.commands.create import CreateKeyValueCommand
+from superset.key_value.commands.entry import Entry
+from superset.key_value.utils import cache_key
+
+
+class CreateFormDataCommand(CreateKeyValueCommand):
+    def create(self, args: Args,) -> Optional[bool]:

Review comment:
       nit (not sure why black doesn't handle these trailing commas on single lines correctly):
   ```suggestion
       def create(self, args: Args) -> Optional[bool]:
   ```

##########
File path: tests/integration_tests/charts/form_data/api_tests.py
##########
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+
+import pytest
+from flask_appbuilder.security.sqla.models import User
+from sqlalchemy.orm import Session
+
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.utils import cache_key
+from superset.models.slice import Slice
+from tests.integration_tests.base_tests import login
+from tests.integration_tests.fixtures.world_bank_dashboard import (
+    load_world_bank_dashboard_with_slices,
+    load_world_bank_data,
+)
+from tests.integration_tests.test_app import app
+
+key = "test-key"
+value = "test"
+
+
+@pytest.fixture
+def client():
+    with app.test_client() as client:
+        with app.app_context():
+            yield client
+
+
+@pytest.fixture
+def chart_id(load_world_bank_dashboard_with_slices) -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        chart = session.query(Slice).filter_by(slice_name="World's Population").one()
+        return chart.id
+
+
+@pytest.fixture
+def admin_id() -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        admin = session.query(User).filter_by(username="admin").one()
+        return admin.id
+
+
+@pytest.fixture(autouse=True)
+def cache(chart_id, admin_id):
+    app.config["FILTER_STATE_CACHE_CONFIG"] = {"CACHE_TYPE": "SimpleCache"}
+    cache_manager.init_app(app)
+    entry: Entry = {"owner": admin_id, "value": value}
+    cache_manager.chart_form_data_cache.set(cache_key(chart_id, key), entry)
+
+
+def test_post(client, chart_id: int):
+    login(client, "admin")
+    payload = {
+        "value": value,
+    }
+    resp = client.post(f"api/v1/chart/{chart_id}/form_data", json=payload)
+    assert resp.status_code == 201
+
+
+def test_post_bad_request(client, chart_id: int):
+    login(client, "admin")
+    payload = {
+        "value": 1234,
+    }
+    resp = client.put(f"api/v1/chart/{chart_id}/form_data/{key}/", json=payload)
+    assert resp.status_code == 400
+
+
+def test_post_access_denied(client, chart_id: int):
+    login(client, "gamma")
+    payload = {
+        "value": value,
+    }
+    resp = client.post(f"api/v1/chart/{chart_id}/form_data", json=payload)
+    assert resp.status_code == 404
+
+
+def test_put(client, chart_id: int):
+    login(client, "admin")
+    payload = {
+        "value": "new value",
+    }
+    resp = client.put(f"api/v1/chart/{chart_id}/form_data/{key}/", json=payload)
+    assert resp.status_code == 200
+
+
+def test_put_bad_request(client, chart_id: int):
+    login(client, "admin")
+    payload = {
+        "value": 1234,
+    }
+    resp = client.put(f"api/v1/chart/{chart_id}/form_data/{key}/", json=payload)
+    assert resp.status_code == 400
+
+
+def test_put_access_denied(client, chart_id: int):
+    login(client, "gamma")
+    payload = {
+        "value": "new value",
+    }
+    resp = client.put(f"api/v1/chart/{chart_id}/form_data/{key}/", json=payload)
+    assert resp.status_code == 404
+
+
+def test_put_not_owner(client, chart_id: int):
+    login(client, "gamma")
+    payload = {
+        "value": "new value",
+    }
+    resp = client.put(f"api/v1/chart/{chart_id}/form_data/{key}/", json=payload)
+    assert resp.status_code == 404
+
+
+def test_get_key_not_found(client, chart_id: int):
+    login(client, "admin")
+    resp = client.get(f"api/v1/chart/{chart_id}/form_data/unknown-key/")
+    assert resp.status_code == 404
+
+
+def test_get_chart_not_found(client):
+    login(client, "admin")
+    resp = client.get(f"api/v1/chart/{-1}/form_data/{key}/")

Review comment:
       nit:
   ```suggestion
       resp = client.get(f"api/v1/chart/-1/form_data/{key}/")
   ```

##########
File path: superset/key_value/commands/create.py
##########
@@ -50,7 +47,5 @@ def validate(self) -> None:
         pass
 
     @abstractmethod
-    def create(
-        self, actor: User, resource_id: int, key: str, value: str
-    ) -> Optional[bool]:
+    def create(self, args: Args,) -> Optional[bool]:

Review comment:
       Bycatch - shouldn't the return type here be `bool`, not `Optional[bool]`?

##########
File path: superset/key_value/commands/args.py
##########
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Dict
+
+from flask_appbuilder.security.sqla.models import User
+from typing_extensions import TypedDict
+
+
+class Args(TypedDict, total=False):

Review comment:
       Could we make the name more explicit, like `KeyValueArgs`? Also, usually `args` refers to a list of values, while `kwargs` refers to a dictionary, so maybe `Args` isn't the best name for this, as it's maybe more like an "entry", which makes it slightly ambiguous with the `Entry` class. So maybe we could make these more unambiguous and clarify their relative roles?

##########
File path: tests/integration_tests/charts/form_data/api_tests.py
##########
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+
+import pytest
+from flask_appbuilder.security.sqla.models import User
+from sqlalchemy.orm import Session
+
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.utils import cache_key
+from superset.models.slice import Slice
+from tests.integration_tests.base_tests import login
+from tests.integration_tests.fixtures.world_bank_dashboard import (
+    load_world_bank_dashboard_with_slices,
+    load_world_bank_data,
+)
+from tests.integration_tests.test_app import app
+
+key = "test-key"
+value = "test"
+
+
+@pytest.fixture
+def client():
+    with app.test_client() as client:
+        with app.app_context():
+            yield client
+
+
+@pytest.fixture
+def chart_id(load_world_bank_dashboard_with_slices) -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        chart = session.query(Slice).filter_by(slice_name="World's Population").one()
+        return chart.id
+
+
+@pytest.fixture
+def admin_id() -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        admin = session.query(User).filter_by(username="admin").one()
+        return admin.id
+
+
+@pytest.fixture(autouse=True)
+def cache(chart_id, admin_id):
+    app.config["FILTER_STATE_CACHE_CONFIG"] = {"CACHE_TYPE": "SimpleCache"}

Review comment:
       Shouldn't this be `
   ```suggestion
       app.config["CHART_FORM_DATA_CACHE_CONFIG"] = {"CACHE_TYPE": "SimpleCache"}
   ```

##########
File path: superset/key_value/commands/get.py
##########
@@ -20,26 +20,24 @@
 
 from flask import current_app as app
 from flask_appbuilder.models.sqla import Model
-from flask_appbuilder.security.sqla.models import User
 from sqlalchemy.exc import SQLAlchemyError
 
 from superset.commands.base import BaseCommand
+from superset.key_value.commands.args import Args
 from superset.key_value.commands.exceptions import KeyValueGetFailedError
 
 logger = logging.getLogger(__name__)
 
 
 class GetKeyValueCommand(BaseCommand, ABC):
-    def __init__(self, actor: User, resource_id: int, key: str):
-        self._actor = actor
-        self._resource_id = resource_id
-        self._key = key
+    def __init__(self, args: Args):
+        self._args = args
 
     def run(self) -> Model:
         try:
             config = app.config["FILTER_STATE_CACHE_CONFIG"]
-            refresh_timeout = config.get("REFRESH_TIMEOUT_ON_RETRIEVAL")
-            return self.get(self._resource_id, self._key, refresh_timeout)
+            self._args["refresh_timeout"] = config.get("REFRESH_TIMEOUT_ON_RETRIEVAL")
+            return self.get(self._args)

Review comment:
       Bycatch - we probably can't be referencing `app.config["FILTER_STATE_CACHE_CONFIG"]` on line 38 here. Maybe we need to pass the cache config key to `self._args` as it will be different for each kv implementation?




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4e047ad) into [master](https://codecov.io/gh/apache/superset/commit/eff4d387de1501d21b4bd51e3a77541b425e79cc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eff4d38) will **increase** coverage by `0.08%`.
   > The diff coverage is `93.43%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.07%   67.16%   +0.08%     
   ==========================================
     Files        1609     1616       +7     
     Lines       64899    65083     +184     
     Branches     6866     6866              
   ==========================================
   + Hits        43533    43710     +177     
   - Misses      19500    19507       +7     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.29% <51.82%> (+<0.01%)` | :arrow_up: |
   | mysql | `82.27% <93.43%> (+0.08%)` | :arrow_up: |
   | postgres | `82.33% <93.43%> (+0.08%)` | :arrow_up: |
   | presto | `53.13% <51.82%> (+<0.01%)` | :arrow_up: |
   | python | `82.77% <93.43%> (+0.08%)` | :arrow_up: |
   | sqlite | `82.01% <93.43%> (+0.08%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `89.47% <89.47%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `90.90% <91.66%> (+4.24%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.23% <95.23%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+12.11%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [14 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [eff4d38...4e047ad](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fca7ace) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.40%`.
   > The diff coverage is `98.28%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.69%   -0.41%     
   ==========================================
     Files        1612     1627      +15     
     Lines       64999    65428     +429     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43637      +21     
   - Misses      19513    19921     +408     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.15% <50.34%> (-1.17%)` | :arrow_down: |
   | mysql | `81.17% <98.28%> (-1.05%)` | :arrow_down: |
   | postgres | `81.21% <98.28%> (-1.07%)` | :arrow_down: |
   | presto | `52.00% <50.34%> (-1.16%)` | :arrow_down: |
   | python | `81.61% <98.28%> (-1.10%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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% <100.00%> (+0.10%)` | :arrow_up: |
   | [superset/dashboards/filter\_state/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvYXBpLnB5) | `100.00% <100.00%> (ø)` | |
   | ... and [78 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...fca7ace](https://codecov.io/gh/apache/superset/pull/17882?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 pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1017854997


   Thank you reviewers for your great contributions. I will continue the work on the client-side now, where further adjustments can be made.


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bb15449) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **increase** coverage by `0.08%`.
   > The diff coverage is `97.92%`.
   
   > :exclamation: Current head bb15449 differs from pull request most recent head fca7ace. Consider uploading reports for the commit fca7ace to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.18%   +0.08%     
   ==========================================
     Files        1612     1620       +8     
     Lines       64999    65372     +373     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43922     +306     
   - Misses      19513    19580      +67     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.21% <50.51%> (-0.11%)` | :arrow_down: |
   | mysql | `82.21% <97.92%> (-0.01%)` | :arrow_down: |
   | postgres | `82.26% <97.92%> (-0.01%)` | :arrow_down: |
   | presto | `53.05% <50.51%> (-0.11%)` | :arrow_down: |
   | python | `82.70% <97.92%> (-0.01%)` | :arrow_down: |
   | sqlite | `81.95% <97.92%> (+<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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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% <100.00%> (+0.10%)` | :arrow_up: |
   | ... and [45 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...fca7ace](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ec87198) into [master](https://codecov.io/gh/apache/superset/commit/ef57bd19024e2e8bac64d5475e74b7d0c215872d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ef57bd1) will **increase** coverage by `0.04%`.
   > The diff coverage is `93.43%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.09%   67.14%   +0.04%     
   ==========================================
     Files        1609     1616       +7     
     Lines       64897    65081     +184     
     Branches     6866     6866              
   ==========================================
   + Hits        43545    43698     +153     
   - Misses      19486    19517      +31     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.29% <51.82%> (-28.52%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `82.33% <93.43%> (+0.08%)` | :arrow_up: |
   | presto | `53.13% <51.82%> (-28.98%)` | :arrow_down: |
   | python | `82.73% <93.43%> (+<0.01%)` | :arrow_up: |
   | sqlite | `82.01% <93.43%> (+0.08%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `89.47% <89.47%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `90.90% <91.66%> (+4.24%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.23% <95.23%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+12.11%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [21 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [ef57bd1...ec87198](https://codecov.io/gh/apache/superset/pull/17882?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 pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1005096583


   Great comments @villebro. I tackled them all.


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/key_value/api.py
##########
@@ -48,65 +58,113 @@ class KeyValueRestApi(BaseApi, ABC):
     allow_browser_login = True
 
     def add_apispec_components(self, api_spec: APISpec) -> None:
-        api_spec.components.schema(
-            KeyValuePostSchema.__name__, schema=KeyValuePostSchema,
-        )
-        api_spec.components.schema(
-            KeyValuePutSchema.__name__, schema=KeyValuePutSchema,
-        )
+        try:
+            api_spec.components.schema(

Review comment:
       We can't because `openapi_spec_component_schemas` is defined in `BaseSupersetModelRestApi` and this endpoint does not have a database model. It inherits directly from `BaseApi`.




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/config.py
##########
@@ -577,6 +577,15 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
     "REFRESH_TIMEOUT_ON_RETRIEVAL": True,
 }
 
+# Cache for chart form data
+CHART_FORM_DATA_CACHE_CONFIG: CacheConfig = {
+    "CACHE_TYPE": "filesystem",

Review comment:
       According to the [doc](https://flask-caching.readthedocs.io/en/latest/#filesystemcache), the cache type name `filesystem` is deprecated since 1.9.1. Superset is using 1.10.1.
   
   




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0892cd0) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **increase** coverage by `0.04%`.
   > The diff coverage is `97.22%`.
   
   > :exclamation: Current head 0892cd0 differs from pull request most recent head 3cc1fa9. Consider uploading reports for the commit 3cc1fa9 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.15%   +0.04%     
   ==========================================
     Files        1612     1619       +7     
     Lines       64999    65264     +265     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43826     +210     
   - Misses      19513    19568      +55     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.27% <50.34%> (-0.05%)` | :arrow_down: |
   | mysql | `82.19% <97.22%> (-0.03%)` | :arrow_down: |
   | postgres | `82.24% <97.22%> (-0.03%)` | :arrow_down: |
   | presto | `53.11% <50.34%> (-0.05%)` | :arrow_down: |
   | python | `82.68% <97.22%> (-0.04%)` | :arrow_down: |
   | sqlite | `81.93% <97.22%> (-0.03%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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.69% <100.00%> (+0.05%)` | :arrow_up: |
   | ... and [21 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...3cc1fa9](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/utils.py
##########
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from superset import security_manager
+from superset.charts.commands.exceptions import (
+    ChartAccessDeniedError,
+    ChartNotFoundError,
+)
+from superset.charts.dao import ChartDAO
+from superset.datasets.commands.exceptions import (
+    DatasetAccessDeniedError,
+    DatasetNotFoundError,
+)
+from superset.datasets.dao import DatasetDAO
+from superset.key_value.commands.parameters import CommandParameters
+from superset.views.base import is_user_admin
+from superset.views.utils import is_owner
+
+
+def get_dataset_id(cmd_params: CommandParameters) -> Optional[str]:
+    query_params = cmd_params.query_params
+    if query_params:
+        return query_params.get("dataset_id")
+    return None
+
+
+def check_access(cmd_params: CommandParameters) -> Optional[bool]:
+    resource_id = cmd_params.resource_id
+    actor = cmd_params.actor
+    if resource_id == 0:
+        dataset_id = get_dataset_id(cmd_params)
+        if dataset_id:
+            dataset = DatasetDAO.find_by_id(int(dataset_id))
+            if dataset:
+                can_access_datasource = security_manager.can_access_datasource(dataset)
+                if can_access_datasource:
+                    return True
+                raise DatasetAccessDeniedError()
+        raise DatasetNotFoundError()
+    chart = ChartDAO.find_by_id(resource_id)
+    if chart:
+        can_access_chart = (
+            is_user_admin()
+            or is_owner(chart, actor)
+            or security_manager.can_access("can_write", "Chart")
+        )
+        if can_access_chart:

Review comment:
       > if the user has access to the chart it means they can see the content that is coming from the dataset, so if a user has access to a chart it means they also have access to the underlying dataset
   
   This is not true. A user can select any dataset to be the datasource of their chart. We cannot automatically assign dataset access to anyone who was added as the owner (or reader, if that role exists) of a chart. These two has to be separate.




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/utils.py
##########
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from superset import security_manager
+from superset.charts.commands.exceptions import (
+    ChartAccessDeniedError,
+    ChartNotFoundError,
+)
+from superset.charts.dao import ChartDAO
+from superset.datasets.commands.exceptions import (
+    DatasetAccessDeniedError,
+    DatasetNotFoundError,
+)
+from superset.datasets.dao import DatasetDAO
+from superset.key_value.commands.parameters import CommandParameters
+from superset.views.base import is_user_admin
+from superset.views.utils import is_owner
+
+
+def get_dataset_id(cmd_params: CommandParameters) -> Optional[str]:
+    query_params = cmd_params.query_params
+    if query_params:
+        return query_params.get("dataset_id")
+    return None
+
+
+def check_access(cmd_params: CommandParameters) -> Optional[bool]:
+    resource_id = cmd_params.resource_id
+    actor = cmd_params.actor
+    if resource_id == 0:
+        dataset_id = get_dataset_id(cmd_params)
+        if dataset_id:
+            dataset = DatasetDAO.find_by_id(int(dataset_id))
+            if dataset:
+                can_access_datasource = security_manager.can_access_datasource(dataset)
+                if can_access_datasource:
+                    return True
+                raise DatasetAccessDeniedError()
+        raise DatasetNotFoundError()
+    chart = ChartDAO.find_by_id(resource_id)
+    if chart:
+        can_access_chart = (
+            is_user_admin()
+            or is_owner(chart, actor)
+            or security_manager.can_access("can_write", "Chart")
+        )
+        if can_access_chart:

Review comment:
       I may have missed it, but I don't think we have RBAC for charts right now. I'm okay with blocking user access to temporary form data if they don't have access to a chart, but IMO users shouldn't automatically gain access to the dataset just because they have access to chart metadata. Knowing what columns or possible values may be in the dataset is very different than viewing the actual data in the dataset.




-- 
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] zhaoyongjie removed a comment on pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
zhaoyongjie removed a comment on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1011054335


   > > > > I can create the same cache of form_data and not any limitation. Is it by design?
   > > > 
   > > > 
   > > > @zhaoyongjie Yes. It's by design. This is especially useful when a user shares a URL with someone. We save the same content over a different key so that any modification made by a user does not affect the other one.
   > > 
   > > 
   > > The problem is that the same user session and the same query payload. It will generate the different cache keys. In the other word, **EVERY** HTTP request will generate a new **record** or **entity** in cache system. It will quickly consume the cache system.
   > 
   > That's not how it will work. A new key will be generated only when mounting. After that, we'll use the `PUT` method to replace the values.
   
   Let's try an experiment.
   
   1. add some logging info at here
   ```
   (superset) yongjie.zhao@:incubator-superset$ git diff
   diff --git a/superset/charts/form_data/commands/create.py b/superset/charts/form_data/commands/create.py
   index d7c2ad413..e85754751 100644
   --- a/superset/charts/form_data/commands/create.py
   +++ b/superset/charts/form_data/commands/create.py
   @@ -20,6 +20,9 @@ from superset.key_value.commands.create import CreateKeyValueCommand
    from superset.key_value.commands.entry import Entry
    from superset.key_value.commands.parameters import CommandParameters
    from superset.key_value.utils import cache_key
   +import logging
   +
   +logger = logging.getLogger(__name__)
   
   
    class CreateFormDataCommand(CreateKeyValueCommand):
   @@ -31,5 +34,6 @@ class CreateFormDataCommand(CreateKeyValueCommand):
            value = cmd_params.value
            if value:
                entry: Entry = {"owner": actor.get_user_id(), "value": value}
   +            logger.info(key)
                return cache_manager.chart_form_data_cache.set(key, entry)
            return False
   ```
   
   2. run flask app in terminal
   ```
   flask run
   ```
   
   3. we can get different cache key with `curl`
   ```
   curl -X POST -H 'Content-Type: application/json' -H 'Cookie:session=.eJwlzj0KwzAMQOG7eM5gxfqxcpmgyBIthBaSdiq9ewMd3_Dg-5Q1jzhvZXkd75jKeh9lKZRaKwzrTZqwNFLpCICpjW2g9IrKie45gKNal7FF54qREaFkXa02bbCpOdRtI2XEWYnAwYnSAVWDgdhchVoky4x4XeKdokxlf7rtcVnicdX7jONPg_L9AbBAMcM.Yd6iAg.35yP0O9awEl-V1eDXaxxsZdYrw0' http://localhost:5000/api/v1/chart/133/form_data -d '{"value":"value"}'
   ```
   
   
   4. application log output
   ```
   
   
   Loaded your LOCAL configuration at [/Users/yongjie.zhao/workspace/warehouse/superset/incubator-superset/venv/superset_config.py]
   2022-01-12 21:36:42,205:INFO:74543:superset.utils.logging_configurator:logging was configured successfully
   2022-01-12 21:36:42,212:INFO:74543:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
   2022-01-12 21:36:42,215:DEBUG:74543:flask_caching.backends.filesystemcache:set key '__wz_cache_count'
   2022-01-12 21:36:42,216:DEBUG:74543:flask_caching.backends.filesystemcache:set key '__wz_cache_count'
   
   
   2022-01-12 21:36:47,124:INFO:74543:superset.charts.form_data.commands.create:133;o-618Isk7ggwmaWPSTuxO9Df43ZLxRjX9DWzcOeDITDH1AWR-UDXjpX2tAMbZ-vn
   2022-01-12 21:36:47,124:DEBUG:74543:flask_caching.backends.filesystemcache:set key '133;o-618Isk7ggwmaWPSTuxO9Df43ZLxRjX9DWzcOeDITDH1AWR-UDXjpX2tAMbZ-vn'
   127.0.0.1 - - [12/Jan/2022 21:36:47] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   2022-01-12 21:36:47,135:INFO:74543:werkzeug:127.0.0.1 - - [12/Jan/2022 21:36:47] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   2022-01-12 21:36:48,016:INFO:74543:superset.charts.form_data.commands.create:133;KXatVxtHP9RJn9gj0L3tmosAkDBBZORisyf88EVWJ-RVHmDpVmBrETwHN1m4cvEP
   2022-01-12 21:36:48,017:DEBUG:74543:flask_caching.backends.filesystemcache:set key '133;KXatVxtHP9RJn9gj0L3tmosAkDBBZORisyf88EVWJ-RVHmDpVmBrETwHN1m4cvEP'
   127.0.0.1 - - [12/Jan/2022 21:36:48] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   2022-01-12 21:36:48,023:INFO:74543:werkzeug:127.0.0.1 - - [12/Jan/2022 21:36:48] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   2022-01-12 21:36:48,899:INFO:74543:superset.charts.form_data.commands.create:133;4EQFse5BXzop3zxlgh7kblP1fp_5GRR5gK-UT7F4ku5nywhaCJ2FAFWamz6z87ze
   2022-01-12 21:36:48,900:DEBUG:74543:flask_caching.backends.filesystemcache:set key '133;4EQFse5BXzop3zxlgh7kblP1fp_5GRR5gK-UT7F4ku5nywhaCJ2FAFWamz6z87ze'
   127.0.0.1 - - [12/Jan/2022 21:36:48] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   2022-01-12 21:36:48,906:INFO:74543:werkzeug:127.0.0.1 - - [12/Jan/2022 21:36:48] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   ```


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (de70ebd) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.87%`.
   > The diff coverage is `82.42%`.
   
   > :exclamation: Current head de70ebd differs from pull request most recent head 0892cd0. Consider uploading reports for the commit 0892cd0 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.22%   -0.88%     
   ==========================================
     Files        1612     1576      -36     
     Lines       64999    61819    -3180     
     Branches     6872     6232     -640     
   ==========================================
   - Hits        43616    40940    -2676     
   + Misses      19513    19280     -233     
   + Partials     1870     1599     -271     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.27% <47.08%> (-0.05%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `53.11% <47.08%> (-0.05%)` | :arrow_down: |
   | python | `82.30% <82.80%> (-0.42%)` | :arrow_down: |
   | sqlite | `81.93% <82.80%> (-0.03%)` | :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/17882?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...-chart-controls/src/sections/advancedAnalytics.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3NlY3Rpb25zL2FkdmFuY2VkQW5hbHl0aWNzLnRzeA==) | `33.33% <ø> (ø)` | |
   | [...legacy-plugin-chart-partition/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXBhcnRpdGlvbi9zcmMvY29udHJvbFBhbmVsLnRzeA==) | `25.00% <ø> (ø)` | |
   | [...gins/legacy-plugin-chart-rose/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXJvc2Uvc3JjL2NvbnRyb2xQYW5lbC50c3g=) | `50.00% <ø> (ø)` | |
   | [...gins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL05WRDNDb250cm9scy50c3g=) | `95.83% <ø> (ø)` | |
   | [...c/SqlLab/components/TemplateParamsEditor/index.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RlbXBsYXRlUGFyYW1zRWRpdG9yL2luZGV4LnRzeA==) | `75.00% <ø> (-9.00%)` | :arrow_down: |
   | [...rontend/src/components/Select/DeprecatedSelect.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvU2VsZWN0L0RlcHJlY2F0ZWRTZWxlY3QudHN4) | `37.33% <ø> (-8.23%)` | :arrow_down: |
   | [superset-frontend/src/components/Select/styles.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvU2VsZWN0L3N0eWxlcy50c3g=) | `67.92% <ø> (+1.82%)` | :arrow_up: |
   | [.../components/Header/HeaderActionsDropdown/index.jsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci9IZWFkZXJBY3Rpb25zRHJvcGRvd24vaW5kZXguanN4) | `71.42% <ø> (ø)` | |
   | [...et-frontend/src/explore/controlPanels/sections.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29udHJvbFBhbmVscy9zZWN0aW9ucy50c3g=) | `85.71% <ø> (-4.29%)` | :arrow_down: |
   | [superset/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | ... and [532 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...0892cd0](https://codecov.io/gh/apache/superset/pull/17882?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 pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1010891383


   > I can create the same cache of form_data and not any limitation. Is it by design?
   
   @zhaoyongjie Yes. It's by design. This is especially useful when a user shares a URL with someone. We save the same content over a different key so that any modification made by a user does not affect the other one.


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/config.py
##########
@@ -577,6 +577,15 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
     "REFRESH_TIMEOUT_ON_RETRIEVAL": True,
 }
 
+# Cache for chart form data
+CHART_FORM_DATA_CACHE_CONFIG: CacheConfig = {
+    "CACHE_TYPE": "filesystem",

Review comment:
       Hi @ktmud. These are all great questions that also appeared while we were discussing this feature internally. This is a great opportunity to post the conclusions of those discussions 😄
   
   > 1. We already have a short URL generator that produces a numeric ID. Will this replace it?
   
   We considered using this generator but the problem was its numerical characteristics. It allows a user to guess potential IDs and it's not ideal for the type of information that could be stored. The idea is to replace the short URL generator with this new approach while maintaining backward compatibility. This will be handled by another PR that is already in development.
   
   > 2. Since the key is after a chart id, does this mean when users create a new chart, we'd have to create a new chart object first, too? IIRC, currently we don't do that.
   
   We won't need to create a new chart object first. This part in the PR's description talks about it:
   
   > All the endpoints accept an optional query parameter called dataset_id that is used for the cases when a chart is not saved yet but we want to preserve the state. In this case, the chart ID shall be set to 0:
   >
   > `POST api/v1/chart/0/form_data?dataset_id=<id>`
   
   In this case, the primary resource is the dataset and all its security rules are applied.
   
   > 3. We already have a [KeyValue](https://github.com/apache/superset/blob/d2d4f8eb447c40a76e619d4cd6dec5ba21a9ea27/superset/models/core.py#L84-L90) model that is more persistent than `Flask-Caching`. Is there a reason why we are not reusing it? It feels to me both dashboard filter states and explore chart states should be persistent since they will produce sharable URLs. We may need a mechanism to periodically delete old records to reduce database size, but that's better than cache server failure causing a URL to go stale at an unpredictable time.
   
   That was in fact our first approach. We discarded this solution because:
   - The numerical nature of the IDs
   - The lack of management properties associated with the entries prevents the maintainability of the records.
   - This feature is behind a feature flag and is disabled by default. Changing its state constitutes a breaking change.
   - We would need to develop the management system (we even did that during the POC). This logic is already handled by Flask-Caching.
   - We wanted to provide administrators with the possibility of choosing which persistence mechanism is best suited for their use cases. Some will use Redis as the main persistence mechanism while periodically [storing the memory content on the disk](https://redis.io/topics/persistence). This can ensure performance and persistence at the same time. Others will use the file system to store this type of information and so on.
   
   > According to the doc, the cache type name filesystem is deprecated since 1.9.1. Superset is using 1.10.1.
   
   Oh, you're right! Thanks for pointing that out. I'll replace it with `FileSystemCache`.




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/utils.py
##########
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from superset import security_manager
+from superset.charts.commands.exceptions import (
+    ChartAccessDeniedError,
+    ChartNotFoundError,
+)
+from superset.charts.dao import ChartDAO
+from superset.datasets.commands.exceptions import (
+    DatasetAccessDeniedError,
+    DatasetNotFoundError,
+)
+from superset.datasets.dao import DatasetDAO
+from superset.key_value.commands.parameters import CommandParameters
+from superset.views.base import is_user_admin
+from superset.views.utils import is_owner
+
+
+def get_dataset_id(cmd_params: CommandParameters) -> Optional[str]:
+    query_params = cmd_params.query_params
+    if query_params:
+        return query_params.get("dataset_id")
+    return None
+
+
+def check_access(cmd_params: CommandParameters) -> Optional[bool]:
+    resource_id = cmd_params.resource_id
+    actor = cmd_params.actor
+    if resource_id == 0:
+        dataset_id = get_dataset_id(cmd_params)
+        if dataset_id:
+            dataset = DatasetDAO.find_by_id(int(dataset_id))
+            if dataset:
+                can_access_datasource = security_manager.can_access_datasource(dataset)
+                if can_access_datasource:
+                    return True
+                raise DatasetAccessDeniedError()
+        raise DatasetNotFoundError()
+    chart = ChartDAO.find_by_id(resource_id)
+    if chart:
+        can_access_chart = (
+            is_user_admin()
+            or is_owner(chart, actor)
+            or security_manager.can_access("can_write", "Chart")
+        )
+        if can_access_chart:

Review comment:
       > What I meant is your access control when chart id is present doesn't seem to check dataset access, then why would it be necessary when chart id is not?
   
   When the chart ID is present, the dataset access is indirectly checked because if the user has access to the chart it means they can see the content that is coming from the dataset, so if a user has access to a chart it means they also have access to the underlying dataset. If the chart ID is not present, it's necessary to check for dataset access so we can store dataset-related information.
   
   > The only information leaked would be the chart configuration, maybe some axis label names and metrics/columns used, which is different than accessing the dataset itself. Do we consider these sensitive--for those with global read access to charts?
   
   We can store sensitive information that directly correlates to the data such as selected filter values, emitted filters, color properties associated with values, etc. We can also store information about the underlying database like schemas, tables, columns, etc.




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/utils.py
##########
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from superset import security_manager
+from superset.charts.commands.exceptions import (
+    ChartAccessDeniedError,
+    ChartNotFoundError,
+)
+from superset.charts.dao import ChartDAO
+from superset.datasets.commands.exceptions import (
+    DatasetAccessDeniedError,
+    DatasetNotFoundError,
+)
+from superset.datasets.dao import DatasetDAO
+from superset.key_value.commands.parameters import CommandParameters
+from superset.views.base import is_user_admin
+from superset.views.utils import is_owner
+
+
+def get_dataset_id(cmd_params: CommandParameters) -> Optional[str]:
+    query_params = cmd_params.query_params
+    if query_params:
+        return query_params.get("dataset_id")
+    return None
+
+
+def check_access(cmd_params: CommandParameters) -> Optional[bool]:
+    resource_id = cmd_params.resource_id
+    actor = cmd_params.actor
+    if resource_id == 0:
+        dataset_id = get_dataset_id(cmd_params)
+        if dataset_id:
+            dataset = DatasetDAO.find_by_id(int(dataset_id))
+            if dataset:
+                can_access_datasource = security_manager.can_access_datasource(dataset)
+                if can_access_datasource:
+                    return True
+                raise DatasetAccessDeniedError()
+        raise DatasetNotFoundError()
+    chart = ChartDAO.find_by_id(resource_id)
+    if chart:
+        can_access_chart = (
+            is_user_admin()
+            or is_owner(chart, actor)
+            or security_manager.can_access("can_write", "Chart")
+        )
+        if can_access_chart:

Review comment:
       I was discussing your point internally and you were right! We have some cases where it's better to check for dataset access independently of chart access. I updated the `check_access` function accordingly and also the tests to reflect this change. Thank you for bringing this to my attention :slightly_smiling_face:




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f72023d) into [master](https://codecov.io/gh/apache/superset/commit/f8a65f8001a5069ab53ce9295fb378abec66dc90?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f8a65f8) will **increase** coverage by `0.07%`.
   > The diff coverage is `92.54%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.17%   +0.07%     
   ==========================================
     Files        1609     1615       +6     
     Lines       64897    65059     +162     
     Branches     6866     6866              
   ==========================================
   + Hits        43547    43703     +156     
   - Misses      19484    19490       +6     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `81.89% <92.54%> (+0.07%)` | :arrow_up: |
   | mysql | `82.26% <92.54%> (+0.07%)` | :arrow_up: |
   | postgres | `82.32% <92.54%> (+0.07%)` | :arrow_up: |
   | presto | `82.19% <92.54%> (+0.07%)` | :arrow_up: |
   | python | `82.80% <92.54%> (+0.07%)` | :arrow_up: |
   | sqlite | `82.00% <92.54%> (+0.07%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `60.71% <60.71%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `88.23% <87.50%> (+1.56%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `88.88% <88.88%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `93.75% <93.75%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `89.65% <97.14%> (+11.34%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [14 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [f8a65f8...f72023d](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ec87198) into [master](https://codecov.io/gh/apache/superset/commit/ef57bd19024e2e8bac64d5475e74b7d0c215872d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ef57bd1) will **increase** coverage by `0.06%`.
   > The diff coverage is `93.43%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.09%   67.16%   +0.06%     
   ==========================================
     Files        1609     1616       +7     
     Lines       64897    65081     +184     
     Branches     6866     6866              
   ==========================================
   + Hits        43545    43710     +165     
   - Misses      19486    19505      +19     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.29% <51.82%> (-28.52%)` | :arrow_down: |
   | mysql | `82.27% <93.43%> (+0.08%)` | :arrow_up: |
   | postgres | `82.33% <93.43%> (+0.08%)` | :arrow_up: |
   | presto | `53.13% <51.82%> (-28.98%)` | :arrow_down: |
   | python | `82.77% <93.43%> (+0.04%)` | :arrow_up: |
   | sqlite | `82.01% <93.43%> (+0.08%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `89.47% <89.47%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `90.90% <91.66%> (+4.24%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.23% <95.23%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+12.11%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [19 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [ef57bd1...ec87198](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ec87198) into [master](https://codecov.io/gh/apache/superset/commit/ef57bd19024e2e8bac64d5475e74b7d0c215872d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ef57bd1) will **decrease** coverage by `0.11%`.
   > The diff coverage is `93.43%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.09%   66.98%   -0.12%     
   ==========================================
     Files        1609     1616       +7     
     Lines       64897    65081     +184     
     Branches     6866     6866              
   ==========================================
   + Hits        43545    43595      +50     
   - Misses      19486    19620     +134     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.29% <51.82%> (-28.52%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `53.13% <51.82%> (-28.98%)` | :arrow_down: |
   | python | `82.38% <93.43%> (-0.35%)` | :arrow_down: |
   | sqlite | `82.01% <93.43%> (+0.08%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `89.47% <89.47%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `90.90% <91.66%> (+4.24%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.23% <95.23%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+12.11%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [38 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [ef57bd1...ec87198](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: tests/integration_tests/charts/form_data/api_tests.py
##########
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+
+import pytest
+from flask_appbuilder.security.sqla.models import User
+from sqlalchemy.orm import Session
+
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.utils import cache_key
+from superset.models.slice import Slice
+from tests.integration_tests.base_tests import login
+from tests.integration_tests.fixtures.world_bank_dashboard import (
+    load_world_bank_dashboard_with_slices,
+    load_world_bank_data,
+)
+from tests.integration_tests.test_app import app
+
+key = "test-key"
+value = "test"
+
+
+@pytest.fixture
+def client():
+    with app.test_client() as client:
+        with app.app_context():
+            yield client
+
+
+@pytest.fixture
+def chart_id(load_world_bank_dashboard_with_slices) -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        chart = session.query(Slice).filter_by(slice_name="World's Population").one()
+        return chart.id
+
+
+@pytest.fixture
+def admin_id() -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        admin = session.query(User).filter_by(username="admin").one()
+        return admin.id
+
+
+@pytest.fixture(autouse=True)
+def cache(chart_id, admin_id):
+    app.config["FILTER_STATE_CACHE_CONFIG"] = {"CACHE_TYPE": "SimpleCache"}

Review comment:
       Yes




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/utils.py
##########
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from superset import security_manager
+from superset.charts.commands.exceptions import (
+    ChartAccessDeniedError,
+    ChartNotFoundError,
+)
+from superset.charts.dao import ChartDAO
+from superset.datasets.commands.exceptions import (
+    DatasetAccessDeniedError,
+    DatasetNotFoundError,
+)
+from superset.datasets.dao import DatasetDAO
+from superset.key_value.commands.parameters import CommandParameters
+from superset.views.base import is_user_admin
+from superset.views.utils import is_owner
+
+
+def get_dataset_id(cmd_params: CommandParameters) -> Optional[str]:
+    query_params = cmd_params.query_params
+    if query_params:
+        return query_params.get("dataset_id")
+    return None
+
+
+def check_access(cmd_params: CommandParameters) -> Optional[bool]:
+    resource_id = cmd_params.resource_id
+    actor = cmd_params.actor
+    if resource_id == 0:
+        dataset_id = get_dataset_id(cmd_params)
+        if dataset_id:
+            dataset = DatasetDAO.find_by_id(int(dataset_id))
+            if dataset:
+                can_access_datasource = security_manager.can_access_datasource(dataset)
+                if can_access_datasource:
+                    return True
+                raise DatasetAccessDeniedError()
+        raise DatasetNotFoundError()
+    chart = ChartDAO.find_by_id(resource_id)
+    if chart:
+        can_access_chart = (
+            is_user_admin()
+            or is_owner(chart, actor)
+            or security_manager.can_access("can_write", "Chart")
+        )
+        if can_access_chart:

Review comment:
       > 1. I understand why numerical IDs can be problematic in some cases but I'm not sure why would we treat temporary chart states differently than we do for a chart or dashboard itself? If we should not, then in the long run, do we plan to change how chart/dashboard/dataset id are generated as well?
   
   I would advocate for changing them in the long run. Numerical IDs can facilitate [Insecure Direct Object References](https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/05-Authorization_Testing/04-Testing_for_Insecure_Direct_Object_References) and [Cross Site Scripting (XSS)](https://owasp.org/www-community/attacks/xss/) attacks and also open the door for [Business Intelligence Leaks](https://medium.com/lightrail/prevent-business-intelligence-leaks-by-using-uuids-instead-of-database-ids-on-urls-and-in-apis-17f15669fd2e).
   
   > 2. `/api/v1/chart/0/form_data?dataset_id=<id>` works but the `id == 0` check feels hacky. Why not just use a new endpoint? 
   
   We considered using different endpoints for the saved/unsaved states, but it felt like overkill for a very specific use case because a new endpoint means new docs, tests, API, security rules, etc.
   
   > You may not even need `chart_id` or `dataset_id` in the API URI anyway since you can save that information in form data (or a wrapper payload for the whole temporary Explore state). 
   
   That's true and it was one of the options on the table but we preferred the more RESTy approach with the resource identifier and the query parameter. We also didn't want to force any kind of schema to the value.
   
   > I.e., when creating the new chart, users see the URL `/explore/?dataset_id=xxx`, the client makes a POST request to `/api/v1/chart/0/form_data`, API returns a form data key, then client URL is updated to `/explore/?key=abceded`, where the key would contain all the information the client needs---starting chart id or dataset id + updated full form data.
   
   That's pretty much the current flow developed in the follow-up PR that I'm working on related to the client-side part 😉. Since the client is the owner of the value, they can control what type of information is stored, so I like your idea of also saving the chart ID and dataset ID alongside the value to keep only the key in the URL. I'll follow your suggestion in the client-side PR. The only thing is that the server shouldn’t account for this information and should continue to work with the resource identifier and query parameter.
   
   > I'm not sure we want to limit Explore state access only to those who can create charts. If users can read a chart, then they should be able to explore a chart as well.
   
   Makes sense. Will change it.
   
   > This check is also inconsistent in terms of whether dataset access is used to prevent access to an Explore state. 
   
   Here we're assuming that if a user has access to a chart, it means that they have access to the dataset. That's why we only check the dataset when the chart is not saved.
   
   > The Explore page also checks dataset access so the resource_id == 0 check seems redundant.
   
   That's true but we also need to consider a call to the API directly.




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/utils.py
##########
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from superset import security_manager
+from superset.charts.commands.exceptions import (
+    ChartAccessDeniedError,
+    ChartNotFoundError,
+)
+from superset.charts.dao import ChartDAO
+from superset.datasets.commands.exceptions import (
+    DatasetAccessDeniedError,
+    DatasetNotFoundError,
+)
+from superset.datasets.dao import DatasetDAO
+from superset.key_value.commands.parameters import CommandParameters
+from superset.views.base import is_user_admin
+from superset.views.utils import is_owner
+
+
+def get_dataset_id(cmd_params: CommandParameters) -> Optional[str]:
+    query_params = cmd_params.query_params
+    if query_params:
+        return query_params.get("dataset_id")
+    return None
+
+
+def check_access(cmd_params: CommandParameters) -> Optional[bool]:
+    resource_id = cmd_params.resource_id
+    actor = cmd_params.actor
+    if resource_id == 0:
+        dataset_id = get_dataset_id(cmd_params)
+        if dataset_id:
+            dataset = DatasetDAO.find_by_id(int(dataset_id))
+            if dataset:
+                can_access_datasource = security_manager.can_access_datasource(dataset)
+                if can_access_datasource:
+                    return True
+                raise DatasetAccessDeniedError()
+        raise DatasetNotFoundError()
+    chart = ChartDAO.find_by_id(resource_id)
+    if chart:
+        can_access_chart = (
+            is_user_admin()
+            or is_owner(chart, actor)
+            or security_manager.can_access("can_write", "Chart")
+        )
+        if can_access_chart:

Review comment:
       I may have missed it, but I don't think we have RBAC for charts right now. I'm okay with blocking user access to temporary form data if they don't have access to a chart, but IMO users shouldn't automatically gain access to the dataset just because they have access to chart metadata.




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fca7ace) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.40%`.
   > The diff coverage is `98.28%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.70%   -0.41%     
   ==========================================
     Files        1612     1627      +15     
     Lines       64999    65428     +429     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43641      +25     
   - Misses      19513    19917     +404     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.15% <50.34%> (-1.17%)` | :arrow_down: |
   | mysql | `81.17% <98.28%> (-1.05%)` | :arrow_down: |
   | postgres | `81.22% <98.28%> (-1.05%)` | :arrow_down: |
   | presto | `52.00% <50.34%> (-1.16%)` | :arrow_down: |
   | python | `81.62% <98.28%> (-1.09%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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% <100.00%> (+0.10%)` | :arrow_up: |
   | [superset/dashboards/filter\_state/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvYXBpLnB5) | `100.00% <100.00%> (ø)` | |
   | ... and [75 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...fca7ace](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fca7ace) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.44%`.
   > The diff coverage is `98.28%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.65%   -0.45%     
   ==========================================
     Files        1612     1627      +15     
     Lines       64999    65428     +429     
     Branches     6872     6872              
   ==========================================
   - Hits        43616    43612       -4     
   - Misses      19513    19946     +433     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.15% <50.34%> (-1.17%)` | :arrow_down: |
   | mysql | `81.17% <98.28%> (-1.05%)` | :arrow_down: |
   | postgres | `?` | |
   | presto | `52.00% <50.34%> (-1.16%)` | :arrow_down: |
   | python | `81.53% <98.28%> (-1.19%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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% <100.00%> (+0.10%)` | :arrow_up: |
   | [superset/dashboards/filter\_state/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvYXBpLnB5) | `100.00% <100.00%> (ø)` | |
   | ... and [81 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...fca7ace](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f72023d) into [master](https://codecov.io/gh/apache/superset/commit/f8a65f8001a5069ab53ce9295fb378abec66dc90?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f8a65f8) will **increase** coverage by `0.00%`.
   > The diff coverage is `92.54%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882    +/-   ##
   ========================================
     Coverage   67.10%   67.10%            
   ========================================
     Files        1609     1615     +6     
     Lines       64897    65059   +162     
     Branches     6866     6866            
   ========================================
   + Hits        43547    43659   +112     
   - Misses      19484    19534    +50     
     Partials     1866     1866            
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `81.89% <92.54%> (+0.07%)` | :arrow_up: |
   | mysql | `82.26% <92.54%> (+0.07%)` | :arrow_up: |
   | postgres | `82.32% <92.54%> (+0.07%)` | :arrow_up: |
   | presto | `?` | |
   | python | `82.66% <92.54%> (-0.08%)` | :arrow_down: |
   | sqlite | `82.00% <92.54%> (+0.07%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `60.71% <60.71%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `88.23% <87.50%> (+1.56%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `88.88% <88.88%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `93.75% <93.75%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `89.65% <97.14%> (+11.34%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [17 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [f8a65f8...f72023d](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f72023d) into [master](https://codecov.io/gh/apache/superset/commit/f8a65f8001a5069ab53ce9295fb378abec66dc90?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f8a65f8) will **decrease** coverage by `0.11%`.
   > The diff coverage is `92.54%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.98%   -0.12%     
   ==========================================
     Files        1609     1615       +6     
     Lines       64897    65059     +162     
     Branches     6866     6866              
   ==========================================
   + Hits        43547    43582      +35     
   - Misses      19484    19611     +127     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `82.26% <92.54%> (+0.07%)` | :arrow_up: |
   | postgres | `82.32% <92.54%> (+0.07%)` | :arrow_up: |
   | presto | `?` | |
   | python | `82.40% <92.54%> (-0.33%)` | :arrow_down: |
   | sqlite | `82.00% <92.54%> (+0.07%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `60.71% <60.71%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `88.23% <87.50%> (+1.56%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `88.88% <88.88%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `93.75% <93.75%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `89.65% <97.14%> (+11.34%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [22 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [f8a65f8...f72023d](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (845ccfd) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.09%`.
   > The diff coverage is `93.61%`.
   
   > :exclamation: Current head 845ccfd differs from pull request most recent head 07e06e5. Consider uploading reports for the commit 07e06e5 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   67.00%   -0.10%     
   ==========================================
     Files        1612     1619       +7     
     Lines       64999    65189     +190     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43683      +67     
   - Misses      19513    19636     +123     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.32% <51.61%> (+<0.01%)` | :arrow_up: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `53.16% <51.61%> (+<0.01%)` | :arrow_up: |
   | python | `82.41% <93.90%> (-0.30%)` | :arrow_down: |
   | sqlite | `82.04% <93.90%> (+0.08%)` | :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/17882?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...-chart-controls/src/sections/advancedAnalytics.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3NlY3Rpb25zL2FkdmFuY2VkQW5hbHl0aWNzLnRzeA==) | `33.33% <ø> (ø)` | |
   | [...legacy-plugin-chart-partition/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXBhcnRpdGlvbi9zcmMvY29udHJvbFBhbmVsLnRzeA==) | `25.00% <ø> (ø)` | |
   | [...gins/legacy-plugin-chart-rose/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXJvc2Uvc3JjL2NvbnRyb2xQYW5lbC50c3g=) | `50.00% <ø> (ø)` | |
   | [...gins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL05WRDNDb250cm9scy50c3g=) | `95.83% <ø> (ø)` | |
   | [...et-frontend/src/explore/controlPanels/sections.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29udHJvbFBhbmVscy9zZWN0aW9ucy50c3g=) | `90.00% <ø> (ø)` | |
   | [superset/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [...lugins/plugin-chart-table/src/utils/formatValue.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtdGFibGUvc3JjL3V0aWxzL2Zvcm1hdFZhbHVlLnRz) | `56.25% <66.66%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | ... and [42 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...07e06e5](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0892cd0) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.12%`.
   > The diff coverage is `97.22%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.97%   -0.13%     
   ==========================================
     Files        1612     1619       +7     
     Lines       64999    65264     +265     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43711      +95     
   - Misses      19513    19683     +170     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.27% <50.34%> (-0.05%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `53.11% <50.34%> (-0.05%)` | :arrow_down: |
   | python | `82.30% <97.22%> (-0.42%)` | :arrow_down: |
   | sqlite | `81.93% <97.22%> (-0.03%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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.69% <100.00%> (+0.05%)` | :arrow_up: |
   | ... and [41 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...0892cd0](https://codecov.io/gh/apache/superset/pull/17882?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] zhaoyongjie commented on pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1011054335


   > > > > I can create the same cache of form_data and not any limitation. Is it by design?
   > > > 
   > > > 
   > > > @zhaoyongjie Yes. It's by design. This is especially useful when a user shares a URL with someone. We save the same content over a different key so that any modification made by a user does not affect the other one.
   > > 
   > > 
   > > The problem is that the same user session and the same query payload. It will generate the different cache keys. In the other word, **EVERY** HTTP request will generate a new **record** or **entity** in cache system. It will quickly consume the cache system.
   > 
   > That's not how it will work. A new key will be generated only when mounting. After that, we'll use the `PUT` method to replace the values.
   
   Let's try an experiment.
   
   1. add some logging info at here
   ```
   (superset) yongjie.zhao@:incubator-superset$ git diff
   diff --git a/superset/charts/form_data/commands/create.py b/superset/charts/form_data/commands/create.py
   index d7c2ad413..e85754751 100644
   --- a/superset/charts/form_data/commands/create.py
   +++ b/superset/charts/form_data/commands/create.py
   @@ -20,6 +20,9 @@ from superset.key_value.commands.create import CreateKeyValueCommand
    from superset.key_value.commands.entry import Entry
    from superset.key_value.commands.parameters import CommandParameters
    from superset.key_value.utils import cache_key
   +import logging
   +
   +logger = logging.getLogger(__name__)
   
   
    class CreateFormDataCommand(CreateKeyValueCommand):
   @@ -31,5 +34,6 @@ class CreateFormDataCommand(CreateKeyValueCommand):
            value = cmd_params.value
            if value:
                entry: Entry = {"owner": actor.get_user_id(), "value": value}
   +            logger.info(key)
                return cache_manager.chart_form_data_cache.set(key, entry)
            return False
   ```
   
   2. run flask app in terminal
   ```
   flask run
   ```
   
   3. we can get different cache key with `curl`
   ```
   curl -X POST -H 'Content-Type: application/json' -H 'Cookie:session=.eJwlzj0KwzAMQOG7eM5gxfqxcpmgyBIthBaSdiq9ewMd3_Dg-5Q1jzhvZXkd75jKeh9lKZRaKwzrTZqwNFLpCICpjW2g9IrKie45gKNal7FF54qREaFkXa02bbCpOdRtI2XEWYnAwYnSAVWDgdhchVoky4x4XeKdokxlf7rtcVnicdX7jONPg_L9AbBAMcM.Yd6iAg.35yP0O9awEl-V1eDXaxxsZdYrw0' http://localhost:5000/api/v1/chart/133/form_data -d '{"value":"value"}'
   ```
   
   
   4. application log output
   ```
   
   
   Loaded your LOCAL configuration at [/Users/yongjie.zhao/workspace/warehouse/superset/incubator-superset/venv/superset_config.py]
   2022-01-12 21:36:42,205:INFO:74543:superset.utils.logging_configurator:logging was configured successfully
   2022-01-12 21:36:42,212:INFO:74543:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
   2022-01-12 21:36:42,215:DEBUG:74543:flask_caching.backends.filesystemcache:set key '__wz_cache_count'
   2022-01-12 21:36:42,216:DEBUG:74543:flask_caching.backends.filesystemcache:set key '__wz_cache_count'
   
   
   2022-01-12 21:36:47,124:INFO:74543:superset.charts.form_data.commands.create:133;o-618Isk7ggwmaWPSTuxO9Df43ZLxRjX9DWzcOeDITDH1AWR-UDXjpX2tAMbZ-vn
   2022-01-12 21:36:47,124:DEBUG:74543:flask_caching.backends.filesystemcache:set key '133;o-618Isk7ggwmaWPSTuxO9Df43ZLxRjX9DWzcOeDITDH1AWR-UDXjpX2tAMbZ-vn'
   127.0.0.1 - - [12/Jan/2022 21:36:47] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   2022-01-12 21:36:47,135:INFO:74543:werkzeug:127.0.0.1 - - [12/Jan/2022 21:36:47] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   2022-01-12 21:36:48,016:INFO:74543:superset.charts.form_data.commands.create:133;KXatVxtHP9RJn9gj0L3tmosAkDBBZORisyf88EVWJ-RVHmDpVmBrETwHN1m4cvEP
   2022-01-12 21:36:48,017:DEBUG:74543:flask_caching.backends.filesystemcache:set key '133;KXatVxtHP9RJn9gj0L3tmosAkDBBZORisyf88EVWJ-RVHmDpVmBrETwHN1m4cvEP'
   127.0.0.1 - - [12/Jan/2022 21:36:48] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   2022-01-12 21:36:48,023:INFO:74543:werkzeug:127.0.0.1 - - [12/Jan/2022 21:36:48] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   2022-01-12 21:36:48,899:INFO:74543:superset.charts.form_data.commands.create:133;4EQFse5BXzop3zxlgh7kblP1fp_5GRR5gK-UT7F4ku5nywhaCJ2FAFWamz6z87ze
   2022-01-12 21:36:48,900:DEBUG:74543:flask_caching.backends.filesystemcache:set key '133;4EQFse5BXzop3zxlgh7kblP1fp_5GRR5gK-UT7F4ku5nywhaCJ2FAFWamz6z87ze'
   127.0.0.1 - - [12/Jan/2022 21:36:48] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   2022-01-12 21:36:48,906:INFO:74543:werkzeug:127.0.0.1 - - [12/Jan/2022 21:36:48] "POST /api/v1/chart/133/form_data HTTP/1.1" 201 -
   ```


-- 
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] zhaoyongjie edited a comment on pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
zhaoyongjie edited a comment on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1011038742


   > > I can create the same cache of form_data and not any limitation. Is it by design?
   > 
   > @zhaoyongjie Yes. It's by design. This is especially useful when a user shares a URL with someone. We save the same content over a different key so that any modification made by a user does not affect the other one.
   
   The problem is that the same user session and the same query payload. It will generate the different cache keys. In the other word,  ~~EVERY HTTP request~~ will generate a new **record** or **entity** in cache system. It will quickly consume the cache system.
   
   ---------
   Additional information:
   Every POST HTTP request with the same cache entity(like form_data) will generate a new **record** in cache system even though same user and chart.
   
   
   


-- 
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] zhaoyongjie edited a comment on pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
zhaoyongjie edited a comment on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1011038742


   > > I can create the same cache of form_data and not any limitation. Is it by design?
   > 
   > @zhaoyongjie Yes. It's by design. This is especially useful when a user shares a URL with someone. We save the same content over a different key so that any modification made by a user does not affect the other one.
   
   The problem is that the same user session and the same query payload. It will generate the different cache keys. In the other word, **EVERY** HTTP request will generate a new **record** or **entity** in cache system. It will quickly consume the cache system.
   
   ---------
   Additional information:
   Every POST HTTP request with the same cache entity will generate a new **record** in cache system.
   
   
   


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/key_value/commands/get.py
##########
@@ -20,26 +20,24 @@
 
 from flask import current_app as app
 from flask_appbuilder.models.sqla import Model
-from flask_appbuilder.security.sqla.models import User
 from sqlalchemy.exc import SQLAlchemyError
 
 from superset.commands.base import BaseCommand
+from superset.key_value.commands.args import Args
 from superset.key_value.commands.exceptions import KeyValueGetFailedError
 
 logger = logging.getLogger(__name__)
 
 
 class GetKeyValueCommand(BaseCommand, ABC):
-    def __init__(self, actor: User, resource_id: int, key: str):
-        self._actor = actor
-        self._resource_id = resource_id
-        self._key = key
+    def __init__(self, args: Args):
+        self._args = args
 
     def run(self) -> Model:
         try:
             config = app.config["FILTER_STATE_CACHE_CONFIG"]
-            refresh_timeout = config.get("REFRESH_TIMEOUT_ON_RETRIEVAL")
-            return self.get(self._resource_id, self._key, refresh_timeout)
+            self._args["refresh_timeout"] = config.get("REFRESH_TIMEOUT_ON_RETRIEVAL")
+            return self.get(self._args)

Review comment:
       Oh, you're right! I moved the logic to the implementations themselves.




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4e047ad) into [master](https://codecov.io/gh/apache/superset/commit/eff4d387de1501d21b4bd51e3a77541b425e79cc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eff4d38) will **increase** coverage by `0.06%`.
   > The diff coverage is `93.43%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.07%   67.14%   +0.06%     
   ==========================================
     Files        1609     1616       +7     
     Lines       64899    65083     +184     
     Branches     6866     6866              
   ==========================================
   + Hits        43533    43698     +165     
   - Misses      19500    19519      +19     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.29% <51.82%> (+<0.01%)` | :arrow_up: |
   | mysql | `?` | |
   | postgres | `82.33% <93.43%> (+0.08%)` | :arrow_up: |
   | presto | `53.13% <51.82%> (+<0.01%)` | :arrow_up: |
   | python | `82.73% <93.43%> (+0.04%)` | :arrow_up: |
   | sqlite | `82.01% <93.43%> (+0.08%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `89.47% <89.47%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `90.90% <91.66%> (+4.24%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.23% <95.23%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+12.11%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [17 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [eff4d38...4e047ad](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ec87198) into [master](https://codecov.io/gh/apache/superset/commit/48d5dc12fc9283ca6a84b24643f91320b2c676f6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (48d5dc1) will **increase** coverage by `0.08%`.
   > The diff coverage is `93.43%`.
   
   > :exclamation: Current head ec87198 differs from pull request most recent head 4e047ad. Consider uploading reports for the commit 4e047ad to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.07%   67.16%   +0.08%     
   ==========================================
     Files        1609     1616       +7     
     Lines       64899    65081     +182     
     Branches     6866     6866              
   ==========================================
   + Hits        43533    43710     +177     
   - Misses      19500    19505       +5     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.29% <51.82%> (+<0.01%)` | :arrow_up: |
   | mysql | `82.27% <93.43%> (+0.08%)` | :arrow_up: |
   | postgres | `82.33% <93.43%> (+0.08%)` | :arrow_up: |
   | presto | `53.13% <51.82%> (+<0.01%)` | :arrow_up: |
   | python | `82.77% <93.43%> (+0.08%)` | :arrow_up: |
   | sqlite | `82.01% <93.43%> (+0.08%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `89.47% <89.47%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `90.90% <91.66%> (+4.24%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.23% <95.23%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+12.11%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [15 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [eff4d38...4e047ad](https://codecov.io/gh/apache/superset/pull/17882?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] rusackas commented on a change in pull request #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/__init__.py
##########
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.

Review comment:
       Is this (essentially empty) file needed?




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/commands/delete.py
##########
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from superset.charts.form_data.utils import check_access
+from superset.extensions import cache_manager
+from superset.key_value.commands.delete import DeleteKeyValueCommand
+from superset.key_value.commands.entry import Entry
+from superset.key_value.commands.exceptions import KeyValueAccessDeniedError
+from superset.key_value.commands.parameters import CommandParameters
+from superset.key_value.utils import cache_key
+
+
+class DeleteFormDataCommand(DeleteKeyValueCommand):
+    def delete(self, cmd_params: CommandParameters) -> bool:
+        resource_id = cmd_params["resource_id"]
+        actor = cmd_params["actor"]
+        key = cmd_params["key"]
+        check_access(cmd_params)
+        entry: Entry = cache_manager.chart_form_data_cache.get(
+            cache_key(resource_id, key)
+        )
+        if entry:
+            if entry["owner"] != actor.get_user_id():
+                raise KeyValueAccessDeniedError()

Review comment:
       We have `test_delete_not_owner` for this but the implementation was wrong. I fixed.




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3d3658d) into [master](https://codecov.io/gh/apache/superset/commit/eff4d387de1501d21b4bd51e3a77541b425e79cc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eff4d38) will **decrease** coverage by `0.05%`.
   > The diff coverage is `91.48%`.
   
   > :exclamation: Current head 3d3658d differs from pull request most recent head a5da396. Consider uploading reports for the commit a5da396 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.07%   67.02%   -0.06%     
   ==========================================
     Files        1609     1617       +8     
     Lines       64899    65163     +264     
     Branches     6866     6866              
   ==========================================
   + Hits        43533    43673     +140     
   - Misses      19500    19624     +124     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `82.30% <ø> (+0.11%)` | :arrow_up: |
   | postgres | `82.34% <ø> (+0.09%)` | :arrow_up: |
   | presto | `?` | |
   | python | `82.42% <ø> (-0.26%)` | :arrow_down: |
   | sqlite | `82.04% <ø> (+0.11%)` | :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/17882?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntend/packages/superset-ui-core/src/color/index.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvY29sb3IvaW5kZXgudHM=) | `100.00% <ø> (ø)` | |
   | [...s/legacy-plugin-chart-country-map/src/countries.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LWNvdW50cnktbWFwL3NyYy9jb3VudHJpZXMudHM=) | `100.00% <ø> (ø)` | |
   | [.../plugins/legacy-preset-chart-nvd3/src/Bar/index.js](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL0Jhci9pbmRleC5qcw==) | `66.66% <ø> (ø)` | |
   | [...gins/legacy-preset-chart-nvd3/src/DistBar/index.js](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL0Rpc3RCYXIvaW5kZXguanM=) | `66.66% <ø> (ø)` | |
   | [...ins/legacy-preset-chart-nvd3/src/DualLine/index.js](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL0R1YWxMaW5lL2luZGV4Lmpz) | `66.66% <ø> (ø)` | |
   | [...plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL1JlYWN0TlZEMy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...ashboard/components/gridComponents/ChartHolder.jsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0SG9sZGVyLmpzeA==) | `58.82% <0.00%> (ø)` | |
   | [...mponents/nativeFilters/FiltersConfigModal/state.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyc0NvbmZpZ01vZGFsL3N0YXRlLnRz) | `73.33% <ø> (ø)` | |
   | [...rontend/src/dashboard/containers/DashboardPage.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZFBhZ2UudHN4) | `25.24% <ø> (ø)` | |
   | ... and [88 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [eff4d38...a5da396](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (de70ebd) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.87%`.
   > The diff coverage is `82.42%`.
   
   > :exclamation: Current head de70ebd differs from pull request most recent head 014d841. Consider uploading reports for the commit 014d841 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.22%   -0.88%     
   ==========================================
     Files        1612     1576      -36     
     Lines       64999    61819    -3180     
     Branches     6872     6232     -640     
   ==========================================
   - Hits        43616    40940    -2676     
   + Misses      19513    19280     -233     
   + Partials     1870     1599     -271     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.27% <47.08%> (-0.05%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `53.11% <47.08%> (-0.05%)` | :arrow_down: |
   | python | `82.30% <82.80%> (-0.42%)` | :arrow_down: |
   | sqlite | `81.93% <82.80%> (-0.03%)` | :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/17882?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...-chart-controls/src/sections/advancedAnalytics.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3NlY3Rpb25zL2FkdmFuY2VkQW5hbHl0aWNzLnRzeA==) | `33.33% <ø> (ø)` | |
   | [...legacy-plugin-chart-partition/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXBhcnRpdGlvbi9zcmMvY29udHJvbFBhbmVsLnRzeA==) | `25.00% <ø> (ø)` | |
   | [...gins/legacy-plugin-chart-rose/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXJvc2Uvc3JjL2NvbnRyb2xQYW5lbC50c3g=) | `50.00% <ø> (ø)` | |
   | [...gins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL05WRDNDb250cm9scy50c3g=) | `95.83% <ø> (ø)` | |
   | [...c/SqlLab/components/TemplateParamsEditor/index.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RlbXBsYXRlUGFyYW1zRWRpdG9yL2luZGV4LnRzeA==) | `75.00% <ø> (-9.00%)` | :arrow_down: |
   | [...rontend/src/components/Select/DeprecatedSelect.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvU2VsZWN0L0RlcHJlY2F0ZWRTZWxlY3QudHN4) | `37.33% <ø> (-8.23%)` | :arrow_down: |
   | [superset-frontend/src/components/Select/styles.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvU2VsZWN0L3N0eWxlcy50c3g=) | `67.92% <ø> (+1.82%)` | :arrow_up: |
   | [.../components/Header/HeaderActionsDropdown/index.jsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci9IZWFkZXJBY3Rpb25zRHJvcGRvd24vaW5kZXguanN4) | `71.42% <ø> (ø)` | |
   | [...et-frontend/src/explore/controlPanels/sections.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29udHJvbFBhbmVscy9zZWN0aW9ucy50c3g=) | `85.71% <ø> (-4.29%)` | :arrow_down: |
   | [superset/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | ... and [532 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...014d841](https://codecov.io/gh/apache/superset/pull/17882?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] zhaoyongjie commented on pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1010770758


   I can create the same cache of form_data and not any limitation. Is it by design?
   
   ```
   (superset) yongjie.zhao@:incubator-superset$ curl -X POST -H 'Content-Type: application/json' -H 'Cookie:session=.eJwlzj0KwzAMQOG7eM5gxfqxcpmgyBIthBaSdiq9ewMd3_Dg-5Q1jzhvZXkd75jKeh9lKZRaKwzrTZqwNFLpCICpjW2g9IrKie45gKNal7FF54qREaFkXa02bbCpOdRtI2XEWYnAwYnSAVWDgdhchVoky4x4XeKdokxlf7rtcVnicdX7jONPg_L9AbBAMcM.Yd6Lqg.ledswymBNn4TYu5P1RFZa2aBHdM' http://localhost:8088/api/v1/chart/136/form_data -d '{"value":"value"}'
   {
     "key": "Aizj7D6fCBON66EM27y7CKr949npDgJtUVuc2P2oED1HL685P_JhSF-RflTSCL1K"
   }
   (superset) yongjie.zhao@:incubator-superset$
   (superset) yongjie.zhao@:incubator-superset$ curl -X POST -H 'Content-Type: application/json' -H 'Cookie:session=.eJwlzj0KwzAMQOG7eM5gxfqxcpmgyBIthBaSdiq9ewMd3_Dg-5Q1jzhvZXkd75jKeh9lKZRaKwzrTZqwNFLpCICpjW2g9IrKie45gKNal7FF54qREaFkXa02bbCpOdRtI2XEWYnAwYnSAVWDgdhchVoky4x4XeKdokxlf7rtcVnicdX7jONPg_L9AbBAMcM.Yd6Lqg.ledswymBNn4TYu5P1RFZa2aBHdM' http://localhost:8088/api/v1/chart/136/form_data -d '{"value":"value"}'
   {
     "key": "ldjp_mdBTpUTS52eIyJfFbdXhUWZitBhFoKXghukr24Ba51PaLg5nRsiESSvE9mT"
   }
   (superset) yongjie.zhao@:incubator-superset$
   (superset) yongjie.zhao@:incubator-superset$ curl -X POST -H 'Content-Type: application/json' -H 'Cookie:session=.eJwlzj0KwzAMQOG7eM5gxfqxcpmgyBIthBaSdiq9ewMd3_Dg-5Q1jzhvZXkd75jKeh9lKZRaKwzrTZqwNFLpCICpjW2g9IrKie45gKNal7FF54qREaFkXa02bbCpOdRtI2XEWYnAwYnSAVWDgdhchVoky4x4XeKdokxlf7rtcVnicdX7jONPg_L9AbBAMcM.Yd6Lqg.ledswymBNn4TYu5P1RFZa2aBHdM' http://localhost:8088/api/v1/chart/136/form_data -d '{"value":"value"}'
   {
     "key": "KQhGwEI7GR2CmjFfDo5jBAKoydaN5RdOXbEUwf43VVhT6HX5I_xjr-arDj8gljAc"
   }
   (superset) yongjie.zhao@:incubator-superset$
   (superset) yongjie.zhao@:incubator-superset$ curl -H 'Cookie:session=.eJwlzj0KwzAMQOG7eM5gxfqxcpmgyBIthBaSdiq9ewMd3_Dg-5Q1jzhvZXkd75jKeh9lKZRaKwzrTZqwNFLpCICpjW2g9IrKie45gKNal7FF54qREaFkXa02bbCpOdRtI2XEWYnAwYnSAVWDgdhchVoky4x4XeKdokxlf7rtcVnicdX7jONPg_L9AbBAMcM.Yd6Lqg.ledswymBNn4TYu5P1RFZa2aBHdM' http://localhost:8088/api/v1/chart/136/form_data/Aizj7D6fCBON66EM27y7CKr949npDgJtUVuc2P2oED1HL685P_JhSF-RflTSCL1K
   {
     "value": "value"
   }
   (superset) yongjie.zhao@:incubator-superset$
   (superset) yongjie.zhao@:incubator-superset$ curl -H 'Cookie:session=.eJwlzj0KwzAMQOG7eM5gxfqxcpmgyBIthBaSdiq9ewMd3_Dg-5Q1jzhvZXkd75jKeh9lKZRaKwzrTZqwNFLpCICpjW2g9IrKie45gKNal7FF54qREaFkXa02bbCpOdRtI2XEWYnAwYnSAVWDgdhchVoky4x4XeKdokxlf7rtcVnicdX7jONPg_L9AbBAMcM.Yd6Lqg.ledswymBNn4TYu5P1RFZa2aBHdM' http://localhost:8088/api/v1/chart/136/form_data/ldjp_mdBTpUTS52eIyJfFbdXhUWZitBhFoKXghukr24Ba51PaLg5nRsiESSvE9mT
   {
     "value": "value"
   }
   (superset) yongjie.zhao@:incubator-superset$
   (superset) yongjie.zhao@:incubator-superset$ curl -H 'Cookie:session=.eJwlzj0KwzAMQOG7eM5gxfqxcpmgyBIthBaSdiq9ewMd3_Dg-5Q1jzhvZXkd75jKeh9lKZRaKwzrTZqwNFLpCICpjW2g9IrKie45gKNal7FF54qREaFkXa02bbCpOdRtI2XEWYnAwYnSAVWDgdhchVoky4x4XeKdokxlf7rtcVnicdX7jONPg_L9AbBAMcM.Yd6Lqg.ledswymBNn4TYu5P1RFZa2aBHdM' http://localhost:8088/api/v1/chart/136/form_data/KQhGwEI7GR2CmjFfDo5jBAKoydaN5RdOXbEUwf43VVhT6HX5I_xjr-arDj8gljAc
   {
     "value": "value"
   }
   ```


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bb15449) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **increase** coverage by `0.08%`.
   > The diff coverage is `97.92%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.18%   +0.08%     
   ==========================================
     Files        1612     1620       +8     
     Lines       64999    65372     +373     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43922     +306     
   - Misses      19513    19580      +67     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.21% <50.51%> (-0.11%)` | :arrow_down: |
   | mysql | `82.21% <97.92%> (-0.01%)` | :arrow_down: |
   | postgres | `82.26% <97.92%> (-0.01%)` | :arrow_down: |
   | presto | `53.05% <50.51%> (-0.11%)` | :arrow_down: |
   | python | `82.70% <97.92%> (-0.01%)` | :arrow_down: |
   | sqlite | `81.95% <97.92%> (+<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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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% <100.00%> (+0.10%)` | :arrow_up: |
   | ... and [45 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...bb15449](https://codecov.io/gh/apache/superset/pull/17882?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] dpgaspar commented on a change in pull request #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/api.py
##########
@@ -0,0 +1,246 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import Type
+
+from flask import Response
+from flask_appbuilder.api import expose, protect, safe
+
+from superset.charts.form_data.commands.create import CreateFormDataCommand
+from superset.charts.form_data.commands.delete import DeleteFormDataCommand
+from superset.charts.form_data.commands.get import GetFormDataCommand
+from superset.charts.form_data.commands.update import UpdateFormDataCommand
+from superset.extensions import event_logger
+from superset.key_value.api import KeyValueRestApi
+
+logger = logging.getLogger(__name__)
+
+
+class ChartFormDataRestApi(KeyValueRestApi):
+    class_permission_name = "ChartFormDataRestApi"
+    resource_name = "chart"
+    openapi_spec_tag = "Chart Form Data"
+
+    def get_create_command(self) -> Type[CreateFormDataCommand]:
+        return CreateFormDataCommand
+
+    def get_update_command(self) -> Type[UpdateFormDataCommand]:
+        return UpdateFormDataCommand
+
+    def get_get_command(self) -> Type[GetFormDataCommand]:
+        return GetFormDataCommand
+
+    def get_delete_command(self) -> Type[DeleteFormDataCommand]:
+        return DeleteFormDataCommand
+
+    @expose("/<int:pk>/form_data", methods=["POST"])
+    @protect()
+    @safe
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post",
+        log_to_statsd=False,
+    )
+    def post(self, pk: int) -> Response:
+        """Stores a new value.
+        ---
+        post:
+          description: >-
+            Stores a new value.
+          parameters:
+          - in: path
+            schema:
+              type: integer
+            name: pk
+          - in: query
+            schema:
+              type: integer
+            name: dataset
+            required: false
+          requestBody:
+            required: true
+            content:
+              application/json:
+                schema:
+                    type: object

Review comment:
       remove the `type: object` and fix indentation

##########
File path: superset/charts/form_data/commands/delete.py
##########
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from superset.charts.form_data.utils import check_access
+from superset.extensions import cache_manager
+from superset.key_value.commands.delete import DeleteKeyValueCommand
+from superset.key_value.commands.entry import Entry
+from superset.key_value.commands.exceptions import KeyValueAccessDeniedError
+from superset.key_value.commands.parameters import CommandParameters
+from superset.key_value.utils import cache_key
+
+
+class DeleteFormDataCommand(DeleteKeyValueCommand):
+    def delete(self, cmd_params: CommandParameters) -> bool:
+        resource_id = cmd_params["resource_id"]
+        actor = cmd_params["actor"]
+        key = cmd_params["key"]
+        check_access(cmd_params)
+        entry: Entry = cache_manager.chart_form_data_cache.get(
+            cache_key(resource_id, key)
+        )
+        if entry:
+            if entry["owner"] != actor.get_user_id():
+                raise KeyValueAccessDeniedError()

Review comment:
       would be great to have a test case to cover this path

##########
File path: superset/key_value/api.py
##########
@@ -48,65 +58,113 @@ class KeyValueRestApi(BaseApi, ABC):
     allow_browser_login = True
 
     def add_apispec_components(self, api_spec: APISpec) -> None:
-        api_spec.components.schema(
-            KeyValuePostSchema.__name__, schema=KeyValuePostSchema,
-        )
-        api_spec.components.schema(
-            KeyValuePutSchema.__name__, schema=KeyValuePutSchema,
-        )
+        try:
+            api_spec.components.schema(

Review comment:
       can we instead use `openapi_spec_component_schemas` for this?

##########
File path: superset/charts/form_data/api.py
##########
@@ -0,0 +1,246 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import Type
+
+from flask import Response
+from flask_appbuilder.api import expose, protect, safe
+
+from superset.charts.form_data.commands.create import CreateFormDataCommand
+from superset.charts.form_data.commands.delete import DeleteFormDataCommand
+from superset.charts.form_data.commands.get import GetFormDataCommand
+from superset.charts.form_data.commands.update import UpdateFormDataCommand
+from superset.extensions import event_logger
+from superset.key_value.api import KeyValueRestApi
+
+logger = logging.getLogger(__name__)
+
+
+class ChartFormDataRestApi(KeyValueRestApi):
+    class_permission_name = "ChartFormDataRestApi"
+    resource_name = "chart"
+    openapi_spec_tag = "Chart Form Data"
+
+    def get_create_command(self) -> Type[CreateFormDataCommand]:
+        return CreateFormDataCommand
+
+    def get_update_command(self) -> Type[UpdateFormDataCommand]:
+        return UpdateFormDataCommand
+
+    def get_get_command(self) -> Type[GetFormDataCommand]:
+        return GetFormDataCommand
+
+    def get_delete_command(self) -> Type[DeleteFormDataCommand]:
+        return DeleteFormDataCommand
+
+    @expose("/<int:pk>/form_data", methods=["POST"])
+    @protect()
+    @safe
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post",
+        log_to_statsd=False,
+    )
+    def post(self, pk: int) -> Response:
+        """Stores a new value.
+        ---
+        post:
+          description: >-
+            Stores a new value.
+          parameters:
+          - in: path
+            schema:
+              type: integer
+            name: pk
+          - in: query
+            schema:
+              type: integer
+            name: dataset
+            required: false
+          requestBody:
+            required: true
+            content:
+              application/json:
+                schema:
+                    type: object
+                    $ref: '#/components/schemas/KeyValuePostSchema'
+          responses:
+            201:
+              description: The value was stored successfully.
+              content:
+                application/json:
+                  schema:
+                    type: object
+                    properties:
+                      key:
+                        type: string
+                        description: The key to retrieve the value.
+            400:
+              $ref: '#/components/responses/400'
+            401:
+              $ref: '#/components/responses/401'
+            422:
+              $ref: '#/components/responses/422'
+            500:
+              $ref: '#/components/responses/500'
+        """
+        return super().post(pk)
+
+    @expose("/<int:pk>/form_data/<string:key>/", methods=["PUT"])
+    @protect()
+    @safe
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.put",
+        log_to_statsd=False,
+    )
+    def put(self, pk: int, key: str) -> Response:
+        """Updates an existing value.
+        ---
+        put:
+          description: >-
+            Updates an existing value.
+          parameters:
+          - in: path
+            schema:
+              type: integer
+            name: pk
+          - in: path
+            schema:
+              type: string
+            name: key
+          requestBody:
+            required: true
+            content:
+              application/json:
+                schema:
+                    type: object

Review comment:
       same 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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3d3658d) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.07%`.
   > The diff coverage is `93.63%`.
   
   > :exclamation: Current head 3d3658d differs from pull request most recent head 07e06e5. Consider uploading reports for the commit 07e06e5 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   67.02%   -0.08%     
   ==========================================
     Files        1612     1617       +5     
     Lines       64999    65163     +164     
     Branches     6872     6866       -6     
   ==========================================
   + Hits        43616    43677      +61     
   - Misses      19513    19620     +107     
   + Partials     1870     1866       -4     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `82.30% <93.63%> (+0.08%)` | :arrow_up: |
   | postgres | `82.35% <93.63%> (+0.08%)` | :arrow_up: |
   | presto | `?` | |
   | python | `82.44% <93.63%> (-0.28%)` | :arrow_down: |
   | sqlite | `82.04% <93.63%> (+0.08%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `91.66% <92.85%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [74 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...07e06e5](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: tests/integration_tests/charts/form_data/api_tests.py
##########
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+
+import pytest
+from flask_appbuilder.security.sqla.models import User
+from sqlalchemy.orm import Session
+
+from superset.extensions import cache_manager
+from superset.key_value.commands.entry import Entry
+from superset.key_value.utils import cache_key
+from superset.models.slice import Slice
+from tests.integration_tests.base_tests import login
+from tests.integration_tests.fixtures.world_bank_dashboard import (
+    load_world_bank_dashboard_with_slices,
+    load_world_bank_data,
+)
+from tests.integration_tests.test_app import app
+
+key = "test-key"
+value = "test"
+
+
+@pytest.fixture
+def client():
+    with app.test_client() as client:
+        with app.app_context():
+            yield client
+
+
+@pytest.fixture
+def chart_id(load_world_bank_dashboard_with_slices) -> int:
+    with app.app_context() as ctx:
+        session: Session = ctx.app.appbuilder.get_session
+        chart = session.query(Slice).filter_by(slice_name="World's Population").one()
+        return chart.id

Review comment:
       Thanks, learned something new! 👍 




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f72023d) into [master](https://codecov.io/gh/apache/superset/commit/f8a65f8001a5069ab53ce9295fb378abec66dc90?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f8a65f8) will **decrease** coverage by `0.11%`.
   > The diff coverage is `92.54%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.98%   -0.12%     
   ==========================================
     Files        1609     1615       +6     
     Lines       64897    65059     +162     
     Branches     6866     6866              
   ==========================================
   + Hits        43547    43582      +35     
   - Misses      19484    19611     +127     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `82.26% <92.54%> (+0.07%)` | :arrow_up: |
   | postgres | `82.32% <92.54%> (+0.07%)` | :arrow_up: |
   | presto | `?` | |
   | python | `82.40% <92.54%> (-0.33%)` | :arrow_down: |
   | sqlite | `82.00% <92.54%> (+0.07%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `60.71% <60.71%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `88.23% <87.50%> (+1.56%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `88.88% <88.88%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `93.75% <93.75%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `89.65% <97.14%> (+11.34%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [22 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [f8a65f8...f72023d](https://codecov.io/gh/apache/superset/pull/17882?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] zhaoyongjie commented on pull request #17882: feat: Adds a key-value endpoint to store charts form data

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on pull request #17882:
URL: https://github.com/apache/superset/pull/17882#issuecomment-1011038742


   > > I can create the same cache of form_data and not any limitation. Is it by design?
   > 
   > @zhaoyongjie Yes. It's by design. This is especially useful when a user shares a URL with someone. We save the same content over a different key so that any modification made by a user does not affect the other one.
   
   The problem is that the same user session and the same query payload. It will generate the different cache keys. In the other word, **EVERY** HTTP request will generate a new **record** or **entity** in cache system. It will quickly consume the cache system.
   
   


-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4e047ad) into [master](https://codecov.io/gh/apache/superset/commit/eff4d387de1501d21b4bd51e3a77541b425e79cc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eff4d38) will **increase** coverage by `0.08%`.
   > The diff coverage is `93.43%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   66.90%   66.98%   +0.08%     
   ==========================================
     Files        1609     1616       +7     
     Lines       64899    65083     +184     
     Branches     6866     6866              
   ==========================================
   + Hits        43418    43595     +177     
   - Misses      19615    19622       +7     
     Partials     1866     1866              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.29% <51.82%> (+<0.01%)` | :arrow_up: |
   | presto | `53.13% <51.82%> (+<0.01%)` | :arrow_up: |
   | python | `82.38% <93.43%> (+0.08%)` | :arrow_up: |
   | sqlite | `82.01% <93.43%> (+0.08%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `89.47% <89.47%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/dashboards/filter\_state/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJfc3RhdGUvY29tbWFuZHMvZ2V0LnB5) | `90.90% <91.66%> (+4.24%)` | :arrow_up: |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.23% <95.23%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+12.11%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `100.00% <100.00%> (ø)` | |
   | ... and [14 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [eff4d38...4e047ad](https://codecov.io/gh/apache/superset/pull/17882?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] rusackas commented on a change in pull request #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/__init__.py
##########
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.

Review comment:
       Is this file needed?




-- 
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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0892cd0) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **increase** coverage by `0.04%`.
   > The diff coverage is `97.22%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.15%   +0.04%     
   ==========================================
     Files        1612     1619       +7     
     Lines       64999    65264     +265     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43826     +210     
   - Misses      19513    19568      +55     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.27% <50.34%> (-0.05%)` | :arrow_down: |
   | mysql | `82.19% <97.22%> (-0.03%)` | :arrow_down: |
   | postgres | `82.24% <97.22%> (-0.03%)` | :arrow_down: |
   | presto | `53.11% <50.34%> (-0.05%)` | :arrow_down: |
   | python | `82.68% <97.22%> (-0.04%)` | :arrow_down: |
   | sqlite | `81.93% <97.22%> (-0.03%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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.69% <100.00%> (+0.05%)` | :arrow_up: |
   | ... and [21 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...0892cd0](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0892cd0) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **increase** coverage by `0.04%`.
   > The diff coverage is `97.22%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   + Coverage   67.10%   67.14%   +0.04%     
   ==========================================
     Files        1612     1619       +7     
     Lines       64999    65264     +265     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43822     +206     
   - Misses      19513    19572      +59     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.27% <50.34%> (-0.05%)` | :arrow_down: |
   | mysql | `82.19% <97.22%> (-0.03%)` | :arrow_down: |
   | postgres | `82.23% <97.22%> (-0.04%)` | :arrow_down: |
   | presto | `53.11% <50.34%> (-0.05%)` | :arrow_down: |
   | python | `82.67% <97.22%> (-0.05%)` | :arrow_down: |
   | sqlite | `81.93% <97.22%> (-0.03%)` | :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/17882?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/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/form\_data/commands/delete.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9kZWxldGUucHk=) | `94.73% <94.73%> (ø)` | |
   | [superset/charts/form\_data/commands/get.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9nZXQucHk=) | `95.65% <95.65%> (ø)` | |
   | [superset/key\_value/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2FwaS5weQ==) | `90.42% <97.29%> (+10.90%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <100.00%> (+0.37%)` | :arrow_up: |
   | [superset/charts/form\_data/api.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9hcGkucHk=) | `100.00% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/17882/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.69% <100.00%> (+0.05%)` | :arrow_up: |
   | ... and [25 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...0892cd0](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (845ccfd) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.09%`.
   > The diff coverage is `93.61%`.
   
   > :exclamation: Current head 845ccfd differs from pull request most recent head 014d841. Consider uploading reports for the commit 014d841 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   67.00%   -0.10%     
   ==========================================
     Files        1612     1619       +7     
     Lines       64999    65189     +190     
     Branches     6872     6872              
   ==========================================
   + Hits        43616    43683      +67     
   - Misses      19513    19636     +123     
     Partials     1870     1870              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `53.32% <51.61%> (+<0.01%)` | :arrow_up: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `53.16% <51.61%> (+<0.01%)` | :arrow_up: |
   | python | `82.41% <93.90%> (-0.30%)` | :arrow_down: |
   | sqlite | `82.04% <93.90%> (+0.08%)` | :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/17882?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...-chart-controls/src/sections/advancedAnalytics.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3NlY3Rpb25zL2FkdmFuY2VkQW5hbHl0aWNzLnRzeA==) | `33.33% <ø> (ø)` | |
   | [...legacy-plugin-chart-partition/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXBhcnRpdGlvbi9zcmMvY29udHJvbFBhbmVsLnRzeA==) | `25.00% <ø> (ø)` | |
   | [...gins/legacy-plugin-chart-rose/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXJvc2Uvc3JjL2NvbnRyb2xQYW5lbC50c3g=) | `50.00% <ø> (ø)` | |
   | [...gins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL05WRDNDb250cm9scy50c3g=) | `95.83% <ø> (ø)` | |
   | [...et-frontend/src/explore/controlPanels/sections.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29udHJvbFBhbmVscy9zZWN0aW9ucy50c3g=) | `90.00% <ø> (ø)` | |
   | [superset/key\_value/commands/entry.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2VudHJ5LnB5) | `100.00% <ø> (ø)` | |
   | [superset/charts/form\_data/utils.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS91dGlscy5weQ==) | `64.51% <64.51%> (ø)` | |
   | [...lugins/plugin-chart-table/src/utils/formatValue.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtdGFibGUvc3JjL3V0aWxzL2Zvcm1hdFZhbHVlLnRz) | `56.25% <66.66%> (ø)` | |
   | [superset/charts/form\_data/commands/update.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy91cGRhdGUucHk=) | `90.90% <90.90%> (ø)` | |
   | [superset/charts/form\_data/commands/create.py](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQvY2hhcnRzL2Zvcm1fZGF0YS9jb21tYW5kcy9jcmVhdGUucHk=) | `94.11% <94.11%> (ø)` | |
   | ... and [42 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...014d841](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17882?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 [#17882](https://codecov.io/gh/apache/superset/pull/17882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a1745b1) into [master](https://codecov.io/gh/apache/superset/commit/3a9bd12e3d294450e703ed87937e8e2c6308216e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a9bd12) will **decrease** coverage by `0.80%`.
   > The diff coverage is `83.09%`.
   
   > :exclamation: Current head a1745b1 differs from pull request most recent head bb15449. Consider uploading reports for the commit bb15449 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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   #17882      +/-   ##
   ==========================================
   - Coverage   67.10%   66.29%   -0.81%     
   ==========================================
     Files        1612     1577      -35     
     Lines       64999    61947    -3052     
     Branches     6872     6242     -630     
   ==========================================
   - Hits        43616    41070    -2546     
   + Misses      19513    19279     -234     
   + Partials     1870     1598     -272     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `82.22% <85.59%> (+<0.01%)` | :arrow_up: |
   | postgres | `82.26% <85.59%> (-0.01%)` | :arrow_down: |
   | presto | `?` | |
   | python | `82.35% <85.59%> (-0.37%)` | :arrow_down: |
   | sqlite | `81.96% <85.59%> (+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/17882?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...-chart-controls/src/sections/advancedAnalytics.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3NlY3Rpb25zL2FkdmFuY2VkQW5hbHl0aWNzLnRzeA==) | `33.33% <ø> (ø)` | |
   | [...superset-ui-core/src/query/types/PostProcessing.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvcXVlcnkvdHlwZXMvUG9zdFByb2Nlc3NpbmcudHM=) | `100.00% <ø> (ø)` | |
   | [...ackages/superset-ui-core/src/utils/featureFlags.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvdXRpbHMvZmVhdHVyZUZsYWdzLnRz) | `100.00% <ø> (ø)` | |
   | [...s/legacy-plugin-chart-country-map/src/countries.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LWNvdW50cnktbWFwL3NyYy9jb3VudHJpZXMudHM=) | `100.00% <ø> (ø)` | |
   | [...legacy-plugin-chart-partition/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXBhcnRpdGlvbi9zcmMvY29udHJvbFBhbmVsLnRzeA==) | `25.00% <ø> (ø)` | |
   | [...gins/legacy-plugin-chart-rose/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXJvc2Uvc3JjL2NvbnRyb2xQYW5lbC50c3g=) | `50.00% <ø> (ø)` | |
   | [...gins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL05WRDNDb250cm9scy50c3g=) | `95.83% <ø> (ø)` | |
   | [...ugins/plugin-chart-echarts/src/Timeseries/types.ts](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy90eXBlcy50cw==) | `100.00% <ø> (ø)` | |
   | [...frontend/src/SqlLab/components/ResultSet/index.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC9pbmRleC50c3g=) | `50.73% <0.00%> (-3.11%)` | :arrow_down: |
   | [...c/SqlLab/components/TemplateParamsEditor/index.tsx](https://codecov.io/gh/apache/superset/pull/17882/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RlbXBsYXRlUGFyYW1zRWRpdG9yL2luZGV4LnRzeA==) | `75.00% <ø> (-9.00%)` | :arrow_down: |
   | ... and [581 more](https://codecov.io/gh/apache/superset/pull/17882/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/17882?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/17882?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 [3a9bd12...bb15449](https://codecov.io/gh/apache/superset/pull/17882?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 #17882: feat: Adds a key-value endpoint to store charts form data

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



##########
File path: superset/charts/form_data/utils.py
##########
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Optional
+
+from superset import security_manager
+from superset.charts.commands.exceptions import (
+    ChartAccessDeniedError,
+    ChartNotFoundError,
+)
+from superset.charts.dao import ChartDAO
+from superset.datasets.commands.exceptions import (
+    DatasetAccessDeniedError,
+    DatasetNotFoundError,
+)
+from superset.datasets.dao import DatasetDAO
+from superset.key_value.commands.parameters import CommandParameters
+from superset.views.base import is_user_admin
+from superset.views.utils import is_owner
+
+
+def get_dataset_id(cmd_params: CommandParameters) -> Optional[str]:
+    query_params = cmd_params.query_params
+    if query_params:
+        return query_params.get("dataset_id")
+    return None
+
+
+def check_access(cmd_params: CommandParameters) -> Optional[bool]:
+    resource_id = cmd_params.resource_id
+    actor = cmd_params.actor
+    if resource_id == 0:
+        dataset_id = get_dataset_id(cmd_params)
+        if dataset_id:
+            dataset = DatasetDAO.find_by_id(int(dataset_id))
+            if dataset:
+                can_access_datasource = security_manager.can_access_datasource(dataset)
+                if can_access_datasource:
+                    return True
+                raise DatasetAccessDeniedError()
+        raise DatasetNotFoundError()
+    chart = ChartDAO.find_by_id(resource_id)
+    if chart:
+        can_access_chart = (
+            is_user_admin()
+            or is_owner(chart, actor)
+            or security_manager.can_access("can_write", "Chart")
+        )
+        if can_access_chart:

Review comment:
       I'm not sure we want to limit Explore state access only to those who can create charts. If users can read a chart, then they should be able to explore a chart as well.
   
   This check is also inconsistent in terms of whether dataset access is used to prevent access to an Explore state. The Explore page also checks dataset access so the `resource_id == 0` check seems redundant.




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