Skip to content

Commit 022bd0e

Browse files
committed
chore(data-modeling): filter out nullish values from the sample; fix logid
1 parent 17fef4a commit 022bd0e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/compass-data-modeling/src/store/analysis-process.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export function startAnalysis(
233233
cancelController.signal,
234234
(err) => {
235235
logger.log.warn(
236-
mongoLogId(1_001_000_357),
236+
mongoLogId(1_001_000_371),
237237
'DataModeling',
238238
'Failed when identifying relationship for the collection',
239239
{ ns, error: err.message }

packages/compass-data-modeling/src/store/relationships.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ export async function inferForeignToLocalRelationshipsForCollection(
171171
.flatMap((doc) => {
172172
return getValuesFromPath(doc, propPath);
173173
})
174+
.filter((doc) => {
175+
// remove missing values from the data sample
176+
return doc !== undefined && doc !== null;
177+
})
174178
// in case sample data is an array that contains a lot of values,
175179
// we limit the amount of samples to reduce the matching time
176180
.slice(0, 100);

0 commit comments

Comments
 (0)