( targetIncomingConnections: SerializedConnection[], executionResults: Map<string, NodeExecutionResult>, nodeMap: Map<string, SerializedNode>, )
| 205 | return sourceResult.data ?? null; |
| 206 | }; |
| 207 | const mergeTableSelectionInputs = ( |
| 208 | targetIncomingConnections: SerializedConnection[], |
| 209 | executionResults: Map<string, NodeExecutionResult>, |
| 210 | nodeMap: Map<string, SerializedNode>, |
| 211 | ) => { |
| 212 | const mergedSourceFiles: any[] = []; |
| 213 | const allTables: any[] = []; |
| 214 | for (const connection of targetIncomingConnections) { |
| 215 | const sourceData = extractConnectionData(connection, executionResults, nodeMap); |
| 216 | if (sourceData?.type !== "TableSelection") continue; |
| 217 | if (sourceData.tables) { |
| 218 | allTables.push(...sourceData.tables); |
| 219 | } |
| 220 | if (sourceData.sourceFiles) { |
| 221 | mergedSourceFiles.push(...sourceData.sourceFiles); |
| 222 | } |
| 223 | } |
| 224 | if (allTables.length === 0) { |
| 225 | return null; |
| 226 | } |
| 227 | return { |
| 228 | type: "TableSelection", |
| 229 | tables: allTables, |
| 230 | sourceFiles: mergedSourceFiles, |
| 231 | tableCount: allTables.length, |
| 232 | }; |
| 233 | }; |
| 234 | const buildInputDataForTarget = ( |
| 235 | targetNode: SerializedNode, |
| 236 | targetIncomingConnections: SerializedConnection[], |
no test coverage detected