mirror of
https://github.com/apache/superset.git
synced 2026-05-12 11:25:56 +00:00
feat(charts): Enable async buildQuery support for complex chart logic (#34383)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
0964a8bb7a
commit
a1c39d4906
@@ -191,8 +191,8 @@ describe('exploreUtils', () => {
|
||||
});
|
||||
|
||||
describe('buildV1ChartDataPayload', () => {
|
||||
it('generate valid request payload despite no registered buildQuery', () => {
|
||||
const v1RequestPayload = buildV1ChartDataPayload({
|
||||
it('generate valid request payload despite no registered buildQuery', async () => {
|
||||
const v1RequestPayload = await buildV1ChartDataPayload({
|
||||
formData: { ...formData, viz_type: 'my_custom_viz' },
|
||||
});
|
||||
expect(v1RequestPayload.hasOwnProperty('queries')).toBeTruthy();
|
||||
|
||||
@@ -207,7 +207,7 @@ export const getQuerySettings = formData => {
|
||||
];
|
||||
};
|
||||
|
||||
export const buildV1ChartDataPayload = ({
|
||||
export const buildV1ChartDataPayload = async ({
|
||||
formData,
|
||||
force,
|
||||
resultFormat,
|
||||
@@ -242,7 +242,7 @@ export const buildV1ChartDataPayload = ({
|
||||
export const getLegacyEndpointType = ({ resultType, resultFormat }) =>
|
||||
resultFormat === 'csv' ? resultFormat : resultType;
|
||||
|
||||
export const exportChart = ({
|
||||
export const exportChart = async ({
|
||||
formData,
|
||||
resultFormat = 'json',
|
||||
resultType = 'full',
|
||||
@@ -262,7 +262,7 @@ export const exportChart = ({
|
||||
payload = formData;
|
||||
} else {
|
||||
url = ensureAppRoot('/api/v1/chart/data');
|
||||
payload = buildV1ChartDataPayload({
|
||||
payload = await buildV1ChartDataPayload({
|
||||
formData,
|
||||
force,
|
||||
resultFormat,
|
||||
|
||||
Reference in New Issue
Block a user