MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / get_data_frame_rows

Function get_data_frame_rows

pythonFiles/tests/ipython/scripts.py:102–119  ·  view source on GitHub ↗
(varJson, start, end, capsys)

Source from the content-addressed store, hash-verified

100
101
102def get_data_frame_rows(varJson, start, end, capsys):
103 path = os.path.dirname(os.path.abspath(__file__))
104 syspath = os.path.abspath(
105 os.path.join(path, "../../vscode_datascience_helpers/dataframes")
106 )
107 syscode = 'import sys\nsys.path.append("{0}")'.format(syspath.replace("\\", "\\\\"))
108 importcode = "import vscodeGetDataFrameRows\nprint(vscodeGetDataFrameRows._VSCODE_getDataFrameRows({0}, {1}, {2}))".format(
109 varJson["name"], start, end
110 )
111 result = execute_code(syscode)
112 if not result.success:
113 result.raise_error()
114 result = execute_code(importcode)
115 if result.success:
116 read_out = capsys.readouterr()
117 return json.loads(read_out.out[0:-1])
118 else:
119 result.raise_error()

Callers 1

test_dataframe_rowsFunction · 0.85

Calls 5

execute_codeFunction · 0.85
joinMethod · 0.80
dirnameMethod · 0.65
formatMethod · 0.65
replaceMethod · 0.45

Tested by 1

test_dataframe_rowsFunction · 0.68