MCPcopy Index your code
hub / github.com/deepnote/deepnote / extractImportsFromDag

Function extractImportsFromDag

packages/cli/src/utils/analysis.ts:729–737  ·  view source on GitHub ↗

* Extract top-level package names from DAG nodes. * Uses importedPackages which contains actual package names (e.g. "pandas") * rather than importedModules which contains local aliases (e.g. "pd").

(dag: BlockDependencyDag)

Source from the content-addressed store, hash-verified

727 * rather than importedModules which contains local aliases (e.g. "pd").
728 */
729function extractImportsFromDag(dag: BlockDependencyDag): string[] {
730 const imports = new Set<string>()
731 for (const node of dag.nodes) {
732 for (const pkg of node.importedPackages ?? []) {
733 imports.add(pkg)
734 }
735 }
736 return Array.from(imports).sort()
737}
738
739// ============================================================================
740// Failure Diagnosis (for auto-diagnosis feature)

Callers 1

analyzeProjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected