darabos commited on
Commit
ac9f9c5
Β·
1 Parent(s): 1b0481a

Add a limit to "View table". (I met a table with 350,000 rows! πŸ’€)

Browse files
lynxkite-graph-analytics/src/lynxkite_plugins/graph_analytics/lynxkite_ops.py CHANGED
@@ -339,12 +339,12 @@ def collect(df: pd.DataFrame):
339
 
340
 
341
  @op("View tables", view="table_view")
342
- def view_tables(bundle: Bundle):
343
  v = {
344
  "dataframes": {
345
  name: {
346
  "columns": [str(c) for c in df.columns],
347
- "data": collect(df),
348
  }
349
  for name, df in bundle.dfs.items()
350
  },
 
339
 
340
 
341
  @op("View tables", view="table_view")
342
+ def view_tables(bundle: Bundle, *, limit: int = 100):
343
  v = {
344
  "dataframes": {
345
  name: {
346
  "columns": [str(c) for c in df.columns],
347
+ "data": collect(df)[:limit],
348
  }
349
  for name, df in bundle.dfs.items()
350
  },