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/10/26 02:06:37 UTC

[GitHub] [superset] zhaoyongjie commented on a diff in pull request #21937: fix: BIGINT rendering regression in chartAction

zhaoyongjie commented on code in PR #21937:
URL: https://github.com/apache/superset/pull/21937#discussion_r1005139974


##########
superset-frontend/packages/superset-ui-core/test/connection/callApi/parseResponse.test.ts:
##########
@@ -137,6 +137,17 @@ describe('parseResponse()', () => {
     expect(responseRaw.bodyUsed).toBe(false);
   });
 
+  it('resolves to big number value if `parseMethod=json-bigint`', async () => {
+    const mockBigIntUrl = '/mock/get/bigInt';
+    const mockGetBigIntPayload = '{ "value": 9223372036854775807 }';
+    fetchMock.get(mockBigIntUrl, mockGetBigIntPayload);
+    const responseBigNumber = await parseResponse(
+      callApi({ url: mockBigIntUrl, method: 'GET' }),
+      'json-bigint',
+    );
+    expect(`${responseBigNumber.json.value}`).toEqual('9223372036854775807');
+  });

Review Comment:
   Do we also mock a `-2^63`  to test int64? and we also need to add a comment to point out the integer type is that singed int64.



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