Skip to content

Commit e88a7f7

Browse files
committed
nit
1 parent d630729 commit e88a7f7

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

packages/compass-collection/src/modules/collection-tab.ts

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import type { AtlasAiService } from '@mongodb-js/compass-generative-ai/provider'
1212
import type { experimentationServiceLocator } from '@mongodb-js/compass-telemetry/provider';
1313
import { type Logger, mongoLogId } from '@mongodb-js/compass-logging/provider';
1414
import { type PreferencesAccess } from 'compass-preferences-model/provider';
15-
import {
16-
type MockDataSchemaRequest,
17-
type MockDataSchemaResponse,
15+
import type {
16+
MockDataSchemaRequest,
17+
MockDataSchemaResponse,
18+
MockDataSchemaRawField,
1819
} from '@mongodb-js/compass-generative-ai';
1920
import { isInternalFieldPath } from 'hadron-document';
2021
import toNS from 'mongodb-ns';
@@ -595,27 +596,12 @@ export const generateFakerMappings = (
595596
requestId: requestId,
596597
});
597598

598-
// Convert FieldInfo objects to MockDataSchemaRawField format
599-
const schema: Record<
600-
string,
601-
{ type: string; sampleValues?: unknown[]; probability?: number }
602-
> = {};
603-
for (const [fieldName, fieldInfo] of Object.entries(
604-
schemaAnalysis.processedSchema
605-
)) {
606-
schema[fieldName] = {
607-
type: fieldInfo.type,
608-
sampleValues: fieldInfo.sample_values,
609-
probability: fieldInfo.probability,
610-
};
611-
}
612-
613599
const mockDataSchemaRequest: MockDataSchemaRequest = {
614600
databaseName: database,
615601
collectionName: collection,
616-
schema: schema,
602+
schema: schemaAnalysis.processedSchema,
617603
validationRules: schemaAnalysis.schemaMetadata.validationRules,
618-
// todo
604+
// todo: set T/F depending on user setting for "Sending Sample Field Values in DE Gen AI Features"
619605
includeSampleValues: true,
620606
};
621607

0 commit comments

Comments
 (0)