refactor: add return value for logsSample (#65357)

* refactor: add return value for logsSample

* refactor: modify test for new use case
pull/65461/head
Laura Benz 2 years ago committed by GitHub
parent f68fd83951
commit 2c978fb0f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      public/app/features/explore/utils/supplementaryQueries.test.ts
  2. 2
      public/app/features/explore/utils/supplementaryQueries.ts

@ -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);
});
});

@ -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);

Loading…
Cancel
Save