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 2020/07/13 08:47:16 UTC

[GitHub] [incubator-superset] villebro opened a new pull request #10299: Villebro/schema case insensitive

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


   ### SUMMARY
   Introduce case insensitive validation of filter operators in chart data schemas. custom validators are moved to `utils/schema.py` as they will likely be relevant in other nedpoints, too.
   
   Currently the cases of filter operators are inconsistent: some are all uppercase, others all lowercase. I considered unifying those, but it would have introduced risk of regression, so will save that for a separate PR after 0.37.0 has shipped.
   
   ### BEFORE
   ![image](https://user-images.githubusercontent.com/33317356/87283575-19189480-c4fe-11ea-993a-d3a58562d32c.png)
   ### AFTER
   <!--- Skip this if not applicable -->
   ![image](https://user-images.githubusercontent.com/33317356/87283443-f8e8d580-c4fd-11ea-9891-7d009bca778d.png)
   
   ### TEST PLAN
   CI + new tests
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue: closes #10296 
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] 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.

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] [incubator-superset] villebro merged pull request #10299: fix(chart-data-api): case insensitive evaluation of filter op

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


   


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

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] [incubator-superset] dpgaspar commented on a change in pull request #10299: fix(chart-data-api): case insensitive evaluation of filter op

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



##########
File path: superset/utils/schema.py
##########
@@ -0,0 +1,55 @@
+# 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 Any, Union
+
+from marshmallow import validate, ValidationError
+
+from superset.exceptions import SupersetException
+from superset.utils import core as utils
+
+
+class OneOfCaseInsensitive(validate.OneOf):
+    """
+    Marshmallow validator that's based on the built-in `OneOf`, but performs
+    validation case insensitively.
+    """
+
+    def __call__(self, value: Any) -> str:
+        try:
+            print(value)

Review comment:
       print here is probably a debug left over




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

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] [incubator-superset] codecov-commenter commented on pull request #10299: fix(chart-data-api): case insensitive evaluation of filter op

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #10299:
URL: https://github.com/apache/incubator-superset/pull/10299#issuecomment-657536877


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=h1) Report
   > Merging [#10299](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/93753cf2f8a4164a3631320eba088844630dc57c&el=desc) will **increase** coverage by `0.02%`.
   > The diff coverage is `95.45%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/10299/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #10299      +/-   ##
   ==========================================
   + Coverage   70.42%   70.45%   +0.02%     
   ==========================================
     Files         599      600       +1     
     Lines       32067    32102      +35     
     Branches     3244     3244              
   ==========================================
   + Hits        22583    22617      +34     
   + Misses       9380     9378       -2     
   - Partials      104      107       +3     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | #cypress | `54.86% <ø> (-0.61%)` | :arrow_down: |
   | #javascript | `59.57% <ø> (ø)` | |
   | #python | `69.75% <95.45%> (+0.25%)` | :arrow_up: |
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/utils/schema.py](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvc2NoZW1hLnB5) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/schemas.py](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY2hhcnRzL3NjaGVtYXMucHk=) | `100.00% <100.00%> (ø)` | |
   | [...et-frontend/src/SqlLab/reducers/getInitialState.js](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9nZXRJbml0aWFsU3RhdGUuanM=) | `33.33% <0.00%> (-16.67%)` | :arrow_down: |
   | [...perset-frontend/src/messageToasts/actions/index.js](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL21lc3NhZ2VUb2FzdHMvYWN0aW9ucy9pbmRleC5qcw==) | `91.66% <0.00%> (-8.34%)` | :arrow_down: |
   | [...rontend/src/SqlLab/components/TabbedSqlEditors.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmJlZFNxbEVkaXRvcnMuanN4) | `77.27% <0.00%> (-5.20%)` | :arrow_down: |
   | [...rontend/src/SqlLab/components/SqlEditorLeftBar.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvckxlZnRCYXIuanN4) | `44.00% <0.00%> (-4.00%)` | :arrow_down: |
   | [...et-frontend/src/messageToasts/components/Toast.tsx](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL21lc3NhZ2VUb2FzdHMvY29tcG9uZW50cy9Ub2FzdC50c3g=) | `96.87% <0.00%> (-3.13%)` | :arrow_down: |
   | [...end/src/SqlLab/components/TemplateParamsEditor.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RlbXBsYXRlUGFyYW1zRWRpdG9yLmpzeA==) | `88.57% <0.00%> (-2.86%)` | :arrow_down: |
   | [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `60.25% <0.00%> (-2.36%)` | :arrow_down: |
   | [superset-frontend/src/SqlLab/reducers/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9zcWxMYWIuanM=) | `37.75% <0.00%> (-1.66%)` | :arrow_down: |
   | ... and [20 more](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=footer). Last update [93753cf...0db52ef](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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

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] [incubator-superset] codecov-commenter edited a comment on pull request #10299: fix(chart-data-api): case insensitive evaluation of filter op

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #10299:
URL: https://github.com/apache/incubator-superset/pull/10299#issuecomment-657536877


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=h1) Report
   > Merging [#10299](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/93753cf2f8a4164a3631320eba088844630dc57c&el=desc) will **increase** coverage by `0.20%`.
   > The diff coverage is `95.45%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/10299/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #10299      +/-   ##
   ==========================================
   + Coverage   70.42%   70.63%   +0.20%     
   ==========================================
     Files         599      600       +1     
     Lines       32067    32102      +35     
     Branches     3244     3244              
   ==========================================
   + Hits        22583    22675      +92     
   + Misses       9380     9325      -55     
   + Partials      104      102       -2     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | #cypress | `55.62% <ø> (+0.14%)` | :arrow_up: |
   | #javascript | `59.57% <ø> (ø)` | |
   | #python | `69.75% <95.45%> (+0.25%)` | :arrow_up: |
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/utils/schema.py](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvc2NoZW1hLnB5) | `94.11% <94.11%> (ø)` | |
   | [superset/charts/schemas.py](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY2hhcnRzL3NjaGVtYXMucHk=) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/messageToasts/actions/index.js](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL21lc3NhZ2VUb2FzdHMvYWN0aW9ucy9pbmRleC5qcw==) | `91.66% <0.00%> (-8.34%)` | :arrow_down: |
   | [...et-frontend/src/messageToasts/components/Toast.tsx](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL21lc3NhZ2VUb2FzdHMvY29tcG9uZW50cy9Ub2FzdC50c3g=) | `96.87% <0.00%> (-3.13%)` | :arrow_down: |
   | [superset/errors.py](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXJyb3JzLnB5) | `100.00% <0.00%> (ø)` | |
   | [superset/viz\_sip38.py](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6X3NpcDM4LnB5) | `0.00% <0.00%> (ø)` | |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.31% <0.00%> (+<0.01%)` | :arrow_up: |
   | [superset/charts/api.py](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY2hhcnRzL2FwaS5weQ==) | `73.27% <0.00%> (+0.11%)` | :arrow_up: |
   | ... and [15 more](https://codecov.io/gh/apache/incubator-superset/pull/10299/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=footer). Last update [93753cf...0db52ef](https://codecov.io/gh/apache/incubator-superset/pull/10299?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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

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