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

[GitHub] [superset] kgabryje opened a new pull request, #21293: fix(explore): Incorrect conversion from simple bool filter to custom sql

kgabryje opened a new pull request, #21293:
URL: https://github.com/apache/superset/pull/21293

   
   ### SUMMARY
   This PR removes brackets around `true` and `false` when automatically converting boolean simple adhoc filter to a custom sql filter.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before:
   
   https://user-images.githubusercontent.com/15073128/187921621-bbc322da-7d23-4a78-b1a3-5be9c35fdad0.mov
   
   After:
   
   https://user-images.githubusercontent.com/15073128/187921686-3fbcd7bd-3db6-44bd-9d85-4ce9235e34e4.mov
   
   ### TESTING INSTRUCTIONS
   1. Add a simple adhoc filter with a boolean column
   2. Covert it to custom sql
   3. Verify that there are no brackets around `true` or `false` and that query works correctly
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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


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


[GitHub] [superset] kgabryje commented on a diff in pull request #21293: fix(explore): Incorrect conversion from simple bool filter to custom sql

Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #21293:
URL: https://github.com/apache/superset/pull/21293#discussion_r960704351


##########
superset-frontend/src/utils/common.js:
##########
@@ -66,10 +66,10 @@ export function optionLabel(opt) {
     return EMPTY_STRING;
   }
   if (opt === true) {
-    return '<true>';
+    return 'true';

Review Comment:
   Done! Though now we'll have `TRUE` instead of `true` in the labels



##########
superset-frontend/src/utils/common.test.jsx:
##########
@@ -28,9 +28,9 @@ describe('utils/common', () => {
     it('converts values as expected', () => {
       expect(optionFromValue(false)).toEqual({
         value: false,
-        label: '<false>',

Review Comment:
   👍 



-- 
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 diff in pull request #21293: fix(explore): Incorrect conversion from simple bool filter to custom sql

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #21293:
URL: https://github.com/apache/superset/pull/21293#discussion_r960651894


##########
superset-frontend/src/utils/common.js:
##########
@@ -66,10 +66,10 @@ export function optionLabel(opt) {
     return EMPTY_STRING;
   }
   if (opt === true) {
-    return '<true>';
+    return 'true';

Review Comment:
   There are `TRUE_STRING` and `FALSE_STRING` constants. Can we use them?



-- 
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 diff in pull request #21293: fix(explore): Incorrect conversion from simple bool filter to custom sql

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #21293:
URL: https://github.com/apache/superset/pull/21293#discussion_r960651894


##########
superset-frontend/src/utils/common.js:
##########
@@ -66,10 +66,10 @@ export function optionLabel(opt) {
     return EMPTY_STRING;
   }
   if (opt === true) {
-    return '<true>';
+    return 'true';

Review Comment:
   There's a `TRUE_STRING` and `FALSE_STRING` constants. Can we use them?



-- 
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 diff in pull request #21293: fix(explore): Incorrect conversion from simple bool filter to custom sql

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #21293:
URL: https://github.com/apache/superset/pull/21293#discussion_r960651894


##########
superset-frontend/src/utils/common.js:
##########
@@ -66,10 +66,10 @@ export function optionLabel(opt) {
     return EMPTY_STRING;
   }
   if (opt === true) {
-    return '<true>';
+    return 'true';

Review Comment:
   Can we use the `TRUE_STRING` and `FALSE_STRING` constants?



-- 
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 diff in pull request #21293: fix(explore): Incorrect conversion from simple bool filter to custom sql

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #21293:
URL: https://github.com/apache/superset/pull/21293#discussion_r960652668


##########
superset-frontend/src/utils/common.test.jsx:
##########
@@ -28,9 +28,9 @@ describe('utils/common', () => {
     it('converts values as expected', () => {
       expect(optionFromValue(false)).toEqual({
         value: false,
-        label: '<false>',

Review Comment:
   Can we use the constants here as well?



-- 
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 #21293: fix(explore): Incorrect conversion from simple bool filter to custom sql

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

   # [Codecov](https://codecov.io/gh/apache/superset/pull/21293?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 [#21293](https://codecov.io/gh/apache/superset/pull/21293?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ed4a614) into [master](https://codecov.io/gh/apache/superset/commit/9fd752057eb261b0e5db87636836fd30579ffce6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9fd7520) will **not change** coverage.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head ed4a614 differs from pull request most recent head 8f635e2. Consider uploading reports for the commit 8f635e2 to get more accurate results
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #21293   +/-   ##
   =======================================
     Coverage   66.42%   66.42%           
   =======================================
     Files        1784     1784           
     Lines       68237    68237           
     Branches     7263     7263           
   =======================================
     Hits        45328    45328           
     Misses      21040    21040           
     Partials     1869     1869           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `52.48% <100.00%> (ø)` | |
   
   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/21293?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-frontend/src/utils/common.js](https://codecov.io/gh/apache/superset/pull/21293/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3V0aWxzL2NvbW1vbi5qcw==) | `90.00% <100.00%> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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] kgabryje merged pull request #21293: fix(explore): Incorrect conversion from simple bool filter to custom sql

Posted by GitBox <gi...@apache.org>.
kgabryje merged PR #21293:
URL: https://github.com/apache/superset/pull/21293


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