Skip to content

Commit

Permalink
fixed wrong parentId (#9082)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas <[email protected]>
  • Loading branch information
overmode and Lucas authored Dec 3, 2024
1 parent e2e5562 commit 5f5c6b4
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,6 @@ async function handler(
}

// Enforce that the table is a parent of itself by default.
const parentsWithTableId =
parents?.includes(tableId) && parents[0] === tableId
? parents
: [tableId, ...(parents || []).filter((p) => p !== tableId)];

const upsertRes = await coreAPI.upsertTable({
projectId: dataSource.dustAPIProjectId,
dataSourceId: dataSource.dustAPIDataSourceId,
Expand All @@ -365,7 +360,7 @@ async function handler(
timestamp: timestamp ?? null,
tags: tags || [],
// Table is a parent of itself by default.
parents: parentsWithTableId,
parents: parents || [tableId],
remoteDatabaseTableId: remoteDatabaseTableId ?? null,
remoteDatabaseSecretId: remoteDatabaseSecretId ?? null,
title,
Expand Down

0 comments on commit 5f5c6b4

Please sign in to comment.