You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2023/06/15 23:39:07 UTC

[GitHub] [superset] justinpark opened a new pull request, #24413: fix(dashboard): native filters do not preserve bigint

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

   ### SUMMARY
   There is an overflow issue when searching for bigint records in the native filters, i.e., the value passed to the backend is a rounded form of the specified UI value.
   This hotfix handles the bigint value in a string form to preserve the value in JSON
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   After:
   
   <img width="688" alt="Screenshot 2023-06-15 at 4 26 17 PM" src="https://github.com/apache/superset/assets/1392866/f2ef3ace-e0a7-4747-8ce0-0b5bb6d04fa5">
   
   Before:
   
   <img width="592" alt="Screenshot 2023-06-15 at 4 34 39 PM" src="https://github.com/apache/superset/assets/1392866/cdf0c3ce-f1ed-4d9e-9f2c-d82852cc3993">
   
   ### TESTING INSTRUCTIONS
   
   - Specs
   - Go to dashboard and add a number field in a native filter
   - type any big number and check the request payload
   
   ### 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
   - [ ] 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] justinpark closed pull request #24413: fix(dashboard): native filters do not preserve bigint

Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark closed pull request #24413: fix(dashboard): native filters do not preserve bigint
URL: https://github.com/apache/superset/pull/24413


-- 
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 #24413: fix(dashboard): native filters do not preserve bigint

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #24413:
URL: https://github.com/apache/superset/pull/24413#issuecomment-1593882995

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#24413](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (4e0b3eb) into [master](https://app.codecov.io/gh/apache/superset/commit/892de8a232a5b40dd22bf07786cb7255ef633d44?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (892de8a) will **decrease** coverage by `0.05%`.
   > The diff coverage is `85.71%`.
   
   > :exclamation: Current head 4e0b3eb differs from pull request most recent head 260d421. Consider uploading reports for the commit 260d421 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #24413      +/-   ##
   ==========================================
   - Coverage   68.96%   68.91%   -0.05%     
   ==========================================
     Files        1904     1904              
     Lines       74092    73922     -170     
     Branches     8120     8120              
   ==========================================
   - Hits        51100    50946     -154     
   + Misses      20880    20865      -15     
   + Partials     2112     2111       -1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `55.65% <73.68%> (+<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=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...ackages/superset-ui-core/src/utils/featureFlags.ts](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvdXRpbHMvZmVhdHVyZUZsYWdzLnRz) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/SqlLab/fixtures.ts](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9maXh0dXJlcy50cw==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/pages/DatasetList/index.tsx](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3BhZ2VzL0RhdGFzZXRMaXN0L2luZGV4LnRzeA==) | `57.76% <ø> (ø)` | |
   | [...rset-frontend/src/profile/components/Favorites.tsx](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Byb2ZpbGUvY29tcG9uZW50cy9GYXZvcml0ZXMudHN4) | `80.00% <ø> (ø)` | |
   | [superset/charts/api.py](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY2hhcnRzL2FwaS5weQ==) | `87.07% <ø> (ø)` | |
   | [superset/config.py](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.97% <ø> (ø)` | |
   | [superset/connectors/sqla/models.py](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `90.37% <ø> (-0.07%)` | :arrow_down: |
   | [superset/dashboards/api.py](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9hcGkucHk=) | `92.58% <ø> (ø)` | |
   | [superset/dashboards/schemas.py](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9zY2hlbWFzLnB5) | `99.02% <ø> (-0.01%)` | :arrow_down: |
   | [superset/datasets/api.py](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZGF0YXNldHMvYXBpLnB5) | `87.95% <ø> (ø)` | |
   | ... and [12 more](https://app.codecov.io/gh/apache/superset/pull/24413?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
   
   :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=apache)
   


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

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

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


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


[GitHub] [superset] john-bodley commented on pull request #24413: fix(dashboard): native filters do not preserve bigint

Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on PR #24413:
URL: https://github.com/apache/superset/pull/24413#issuecomment-1594887890

   https://github.com/apache/superset/pull/24418  is an alternative formulation which also addresses searching/filtering of numerical 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] john-bodley commented on a diff in pull request #24413: fix(dashboard): native filters do not preserve bigint

Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on code in PR #24413:
URL: https://github.com/apache/superset/pull/24413#discussion_r1231648020


##########
superset-frontend/src/filters/components/Select/buildQuery.ts:
##########
@@ -49,12 +49,21 @@ const buildQuery: BuildQuery<PluginFilterSelectQueryFormData> = (
           coltypeMap[label] === GenericDataType.NUMERIC &&
           !Number.isNaN(Number(search))
         ) {
-          // for numeric columns we apply a >= where clause
-          extraFilters.push({
-            col: column,
-            op: '>=',
-            val: Number(search),
-          });
+          if (search === `${Number(search)}`) {
+            // for numeric columns we apply a >= where clause
+            extraFilters.push({
+              col: column,
+              op: '>=',
+              val: Number(search),

Review Comment:
   @justinpark do you know what additional value using `Number(...)` provides? [This](https://github.com/apache/superset/blob/23bb1c48a13236b47cdbff65f3de6658204e7168/superset/models/helpers.py#L1144-L1196) is how the backend handles the filtering logic which [casts](https://github.com/apache/superset/blob/23bb1c48a13236b47cdbff65f3de6658204e7168/superset/models/helpers.py#L1179) strings to numbers and thus maybe it's ok for the backend to handle both cases, i.e., we could remove lines 54–60.
   
   We could include a comment of the form,
   
   ```
   // for numeric columns the backend casts the search string to the appropriate type—preventing JavaScript overflow. Additionally we use the fairly crude(and insufficient)  >= operator as a proxy for detecting whether the search string is contained within the column given there is no trivial way of dynamically casting the the column type.



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