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/06/24 06:37:52 UTC

[GitHub] [incubator-superset] villebro opened a new pull request #10148: fix: refine shouldUseLegacyApi and add tests

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


   ### SUMMARY
   The bug that #10147 fixes exposed a shortcoming in the `souldUseLegacyApi` function in `exploreUtils`. This fixes the bug and adds unit tests to catch all possible cases I could think of.
   
   ### 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:
   - [ ] 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] rusackas commented on a change in pull request #10148: fix: refine shouldUseLegacyApi and add tests

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



##########
File path: superset-frontend/spec/javascripts/explore/utils_spec.jsx
##########
@@ -202,4 +204,45 @@ describe('exploreUtils', () => {
       expect(v1RequestPayload).hasOwnProperty('queries');
     });
   });
+
+  describe('shouldUseLegacyApi', () => {
+    beforeAll(() => {
+      getChartMetadataRegistry()
+        .registerValue('my_legacy_viz', { useLegacyApi: true })
+        .registerValue('my_v1_viz', { useLegacyApi: false });
+    });
+
+    afterAll(() => {
+      getChartMetadataRegistry().remove('my_legacy_viz').remove('my_v1_viz');
+    });
+
+    it('return true for legacy viz', () => {

Review comment:
       NIT, but maybe "returns" for these so it('reads like a sentence')




----------------------------------------------------------------
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 commented on pull request #10148: fix: refine shouldUseLegacyApi and add tests

Posted by GitBox <gi...@apache.org>.
villebro commented on pull request #10148:
URL: https://github.com/apache/incubator-superset/pull/10148#issuecomment-648922748


   @rusackas thanks for nittery, comments addressed!


----------------------------------------------------------------
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] rusackas commented on a change in pull request #10148: fix: refine shouldUseLegacyApi and add tests

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



##########
File path: superset-frontend/spec/javascripts/explore/utils_spec.jsx
##########
@@ -202,4 +204,45 @@ describe('exploreUtils', () => {
       expect(v1RequestPayload).hasOwnProperty('queries');
     });
   });
+
+  describe('shouldUseLegacyApi', () => {
+    beforeAll(() => {
+      getChartMetadataRegistry()
+        .registerValue('my_legacy_viz', { useLegacyApi: true })
+        .registerValue('my_v1_viz', { useLegacyApi: false });
+    });
+
+    afterAll(() => {
+      getChartMetadataRegistry().remove('my_legacy_viz').remove('my_v1_viz');
+    });
+
+    it('return true for legacy viz', () => {

Review comment:
       NIT, but maybe "returns" for these so `it('reads like a sentence')`




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