You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Always-prog (via GitHub)" <gi...@apache.org> on 2023/04/22 16:33:04 UTC

[GitHub] [superset] Always-prog opened a new pull request, #23783: fix(datasource): saving new calculated columns

Always-prog opened a new pull request, #23783:
URL: https://github.com/apache/superset/pull/23783

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   Creating a new calculated columns isn't working.
   Because the datasource is receiving a string ID from the frontend, which is resulting in invalid input.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   #### Before
   
   https://user-images.githubusercontent.com/66589759/233795894-eb6dec1e-2cbd-41fd-b8ee-1e7cc8dd4f45.mp4
   
   
   ### After
   https://user-images.githubusercontent.com/66589759/233795877-8eeb553c-e2b4-4150-8f5a-ba62cee8fc46.mp4
   
   
   ### TESTING INSTRUCTIONS
   1. Go to any datasource
   2. Add calculated column
   3. See an error
   
   ### 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
   
   CC @jfrag1 #23678


-- 
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 #23783: fix(datasource): saving new calculated columns

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #23783:
URL: https://github.com/apache/superset/pull/23783#discussion_r1175558847


##########
superset-frontend/src/components/Datasource/DatasourceModal.tsx:
##########
@@ -139,7 +139,7 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
         ),
         columns: currentDatasource?.columns?.map(
           (column: Record<string, unknown>) => ({
-            id: column.id,
+            id: typeof column.id !== 'string' ? column.id : undefined,

Review Comment:
   Since we only accept Number or undefined, maybe it'd be more clear to compare to `'number'`? Like `typeof column.id === 'number' ? column.id : undefined`



-- 
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 #23783: fix(datasource): saving new calculated columns

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

   ## [Codecov](https://codecov.io/gh/apache/superset/pull/23783?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 [#23783](https://codecov.io/gh/apache/superset/pull/23783?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e8ef3fc) into [master](https://codecov.io/gh/apache/superset/commit/4b3e507e8b22b2d25e9a79c1feb03fceaefbd464?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4b3e507) will **decrease** coverage by `11.37%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head e8ef3fc differs from pull request most recent head b6471be. Consider uploading reports for the commit b6471be to get more accurate results
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #23783       +/-   ##
   ===========================================
   - Coverage   67.87%   56.51%   -11.37%     
   ===========================================
     Files        1925     1925               
     Lines       74389    74389               
     Branches     8108     8108               
   ===========================================
   - Hits        50494    42042     -8452     
   - Misses      21818    30270     +8452     
     Partials     2077     2077               
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `52.84% <100.00%> (ø)` | |
   | python | `59.10% <100.00%> (-23.56%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `52.72% <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/23783?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...tend/src/components/Datasource/DatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/23783?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRGF0YXNvdXJjZS9EYXRhc291cmNlTW9kYWwudHN4) | `75.00% <ø> (ø)` | |
   | [superset/datasets/schemas.py](https://codecov.io/gh/apache/superset/pull/23783?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YXNldHMvc2NoZW1hcy5weQ==) | `97.48% <100.00%> (ø)` | |
   
   ... and [302 files with indirect coverage changes](https://codecov.io/gh/apache/superset/pull/23783/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :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] Always-prog commented on a diff in pull request #23783: fix(datasource): saving new calculated columns

Posted by "Always-prog (via GitHub)" <gi...@apache.org>.
Always-prog commented on code in PR #23783:
URL: https://github.com/apache/superset/pull/23783#discussion_r1175602155


##########
superset-frontend/src/components/Datasource/DatasourceModal.tsx:
##########
@@ -139,7 +139,7 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
         ),
         columns: currentDatasource?.columns?.map(
           (column: Record<string, unknown>) => ({
-            id: column.id,
+            id: typeof column.id !== 'string' ? column.id : undefined,

Review Comment:
   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] Always-prog commented on pull request #23783: fix(datasource): saving new calculated columns

Posted by "Always-prog (via GitHub)" <gi...@apache.org>.
Always-prog commented on PR #23783:
URL: https://github.com/apache/superset/pull/23783#issuecomment-1518717710

   Hello!
   Integration test cases have returned an error, but there were no errors on the source branch from where I created the PR. Could we please re-run the CI tests?
   Thanks!
   ![image](https://user-images.githubusercontent.com/66589759/233799495-9f016feb-ea88-4fb1-a595-4244ef859043.png)
   


-- 
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] eschutho merged pull request #23783: fix(datasource): saving new calculated columns

Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho merged PR #23783:
URL: https://github.com/apache/superset/pull/23783


-- 
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] Always-prog commented on a diff in pull request #23783: fix(datasource): saving new calculated columns

Posted by "Always-prog (via GitHub)" <gi...@apache.org>.
Always-prog commented on code in PR #23783:
URL: https://github.com/apache/superset/pull/23783#discussion_r1175588396


##########
superset-frontend/src/components/Datasource/DatasourceModal.tsx:
##########
@@ -139,7 +139,7 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
         ),
         columns: currentDatasource?.columns?.map(
           (column: Record<string, unknown>) => ({
-            id: column.id,
+            id: typeof column.id !== 'string' ? column.id : undefined,

Review Comment:
   I think so, let me fix it.



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

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

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


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