(block: CodeBlock | SqlBlock)
| 4 | import { escapePythonString } from './python-utils' |
| 5 | |
| 6 | export 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 | } |
no test coverage detected