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

Function createDataFrameConfig

packages/blocks/src/blocks/data-frame.ts:6–16  ·  view source on GitHub ↗
(block: CodeBlock | SqlBlock)

Source from the content-addressed store, hash-verified

4import { escapePythonString } from './python-utils'
5
6export function createDataFrameConfig(block: CodeBlock | SqlBlock): string {
7 const tableState = block.metadata?.deepnote_table_state ?? {}
8 const tableStateAsJson = JSON.stringify(tableState)
9
10 return dedent`
11 if '_dntk' in globals():
12 _dntk.dataframe_utils.configure_dataframe_formatter(${escapePythonString(tableStateAsJson)})
13 else:
14 _deepnote_current_table_attrs = ${escapePythonString(tableStateAsJson)}
15 `
16}

Callers 3

wrapSqlExecutionFunction · 0.90
data-frame.test.tsFile · 0.90

Calls 1

escapePythonStringFunction · 0.90

Tested by

no test coverage detected