refactor: add return value for logsSample (#65357)

* refactor: add return value for logsSample

* refactor: modify test for new use case
This commit is contained in:
Laura Benz 2023-03-28 15:36:47 +02:00 committed by GitHub
parent f68fd83951
commit 2c978fb0f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -197,15 +197,9 @@ describe('SupplementaryQueries utils', function () {
]);
});
});
it('Does not use a fallback for logs sample', async () => {
it('Returns undefined for logs sample', async () => {
const testProvider = await setup('no-data-providers', SupplementaryQueryType.LogsSample);
await expect(testProvider).toEmitValuesWith((received) => {
expect(received).toMatchObject([
{
state: LoadingState.NotStarted,
},
]);
});
await expect(testProvider).toBe(undefined);
});
});

View File

@ -213,6 +213,8 @@ export const getSupplementaryQueryProvider = (
),
distinct()
);
} else if (type === SupplementaryQueryType.LogsSample) {
return undefined;
} else {
// Create a fallback to results based logs volume
return getSupplementaryQueryFallback(type, explorePanelData, request.targets, datasourceInstance.name);