You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "sowo (via GitHub)" <gi...@apache.org> on 2024/04/24 18:02:34 UTC

[PR] Fix label map [superset]

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

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### 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


Re: [PR] fix(contextmenu): uncaught TypeError [superset]

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

   Thanks for getting the tests passing! I will ping @villebro as a more capable reviewer than myself when it comes to query context, but I suspect if we don't merge it, the reason would be for need of additional test coverage around handling of verbose maps, ad hoc metrics, ad hoc columns, and error handling.


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


Re: [PR] fix(contextmenu): uncaught TypeError [superset]

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

   /korbit-review


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


Re: [PR] fix(contextmenu): uncaught TypeError [superset]

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

   turns out there was an issue in query_context_processor. Tests are passing
   now.
   
   On Tue, Dec 10, 2024 at 10:12 PM Wolfgang Sommerer <
   ***@***.***> wrote:
   
   > as far as I can tell, all test failures complain about missing strftime.
   > (either "AttributeError: 'numpy.float64' object has no attribute
   > 'strftime'" or "AttributeError: 'str' object has no attribute 'strftime'").
   > I don't think the changes in PR are causing those.
   >
   > On Tue, Dec 10, 2024 at 10:06 PM Evan Rusackas ***@***.***>
   > wrote:
   >
   >> Thanks for the quick rebase! Looks like there are some test failures on
   >> CI, but I'm not sure if they're related to the change or not.
   >>
   >> —
   >> Reply to this email directly, view it on GitHub
   >> <https://github.com/apache/superset/pull/28203#issuecomment-2532891880>,
   >> or unsubscribe
   >> <https://github.com/notifications/unsubscribe-auth/AAVDI5L5ZIMNB7ULZLOUWQD2E5JWPAVCNFSM6AAAAABTL2O7FGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZSHA4TCOBYGA>
   >> .
   >> You are receiving this because you were mentioned.Message ID:
   >> ***@***.***>
   >>
   >
   


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


Re: [PR] fix(contextmenu): uncaught TypeError [superset]

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


##########
superset/common/query_object.py:
##########
@@ -257,7 +257,7 @@ def _move_deprecated_extra_fields(self, kwargs: dict[str, Any]) -> None:
     @property
     def metric_names(self) -> list[str]:
         """Return metrics names (labels), coerce adhoc metrics to strings."""
-        return get_metric_names(self.metrics or [])
+        return get_metric_names(self.metrics or [], self.datasource.verbose_map)

Review Comment:
   can we add a small unit test to verify that metric_names will always return properly?



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


Re: [PR] fix(contextmenu): uncaught TypeError [superset]

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

   Thanks for the quick rebase! Looks like there are some test failures on CI, but I'm not sure if they're related to the change or not. 


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


Re: [PR] fix(contextmenu): uncaught TypeError [superset]

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


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


Re: [PR] fix(contextmenu): uncaught TypeError [superset]

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


##########
superset/common/query_object.py:
##########
@@ -257,7 +257,7 @@ def _move_deprecated_extra_fields(self, kwargs: dict[str, Any]) -> None:
     @property
     def metric_names(self) -> list[str]:
         """Return metrics names (labels), coerce adhoc metrics to strings."""
-        return get_metric_names(self.metrics or [])
+        return get_metric_names(self.metrics or [], self.datasource.verbose_map)

Review Comment:
   @hughhhh I've added a unit test and some sanity checking. Not sure if the implementation of those checks (https://github.com/sowo/superset/blob/bd0015426aab9ed949259454e36572473b927c39/superset/common/query_context_processor.py#L187 and https://github.com/sowo/superset/blob/bd0015426aab9ed949259454e36572473b927c39/superset/common/query_context_processor.py#L197) is optimal or if there is a better way to handle AdhocColumns and AdhocMetrics. Please advise. 



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


Re: [PR] fix(contextmenu): uncaught TypeError [superset]

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

   Hey @sowo - sorry this seems to have slipped through the cracks, but if you're able to rebase this to resolve conflicts, I think we can get some more eyes on it and get it merged. Thanks!


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


Re: [PR] fix(contextmenu): uncaught TypeError [superset]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #28203:
URL: https://github.com/apache/superset/pull/28203#issuecomment-2092409452

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/28203?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `25.00000%` with `3 lines` in your changes are missing coverage. Please review.
   > Project coverage is 59.23%. Comparing base [(`a1983e4`)](https://app.codecov.io/gh/apache/superset/commit/a1983e468ba1a1b0fdbef9d8d5206e61be0b7141?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`da81ff2`)](https://app.codecov.io/gh/apache/superset/pull/28203?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 167 commits behind head on master.
   
   | [Files](https://app.codecov.io/gh/apache/superset/pull/28203?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/common/query\_context\_processor.py](https://app.codecov.io/gh/apache/superset/pull/28203?src=pr&el=tree&filepath=superset%2Fcommon%2Fquery_context_processor.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHRfcHJvY2Vzc29yLnB5) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/28203?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/connectors/sqla/models.py](https://app.codecov.io/gh/apache/superset/pull/28203?src=pr&el=tree&filepath=superset%2Fconnectors%2Fsqla%2Fmodels.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/28203?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #28203      +/-   ##
   ==========================================
   - Coverage   67.42%   59.23%   -8.19%     
   ==========================================
     Files        1923     1928       +5     
     Lines       75591    75928     +337     
     Branches     8443     8443              
   ==========================================
   - Hits        50967    44977    -5990     
   - Misses      22566    28893    +6327     
     Partials     2058     2058              
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/28203/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/28203/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `49.21% <0.00%> (?)` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/28203/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/28203/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `60.99% <25.00%> (-16.95%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/28203/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/28203/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.73% <25.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=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/28203?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?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


Re: [PR] fix(contextmenu): uncaught TypeError [superset]

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

   as far as I can tell, all test failures complain about missing strftime.
   (either "AttributeError: 'numpy.float64' object has no attribute
   'strftime'" or "AttributeError: 'str' object has no attribute 'strftime'").
   I don't think the changes in PR are causing those.
   
   On Tue, Dec 10, 2024 at 10:06 PM Evan Rusackas ***@***.***>
   wrote:
   
   > Thanks for the quick rebase! Looks like there are some test failures on
   > CI, but I'm not sure if they're related to the change or not.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/superset/pull/28203#issuecomment-2532891880>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAVDI5L5ZIMNB7ULZLOUWQD2E5JWPAVCNFSM6AAAAABTL2O7FGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZSHA4TCOBYGA>
   > .
   > You are receiving this because you were mentioned.Message ID:
   > ***@***.***>
   >
   


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