Skip to content

Commit 0c74a7b

Browse files
committed
fix: DH-20379: Python scope does not work in format_columns
1 parent ed4c918 commit 0c74a7b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

py/server/deephaven/table.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,8 @@ def format_columns(self, formulas: Union[str, List[str]]) -> Table:
21942194
"""
21952195
try:
21962196
formulas = to_sequence(formulas)
2197-
return Table(j_table=self.j_table.formatColumns(formulas))
2197+
with _query_scope_ctx():
2198+
return Table(j_table=self.j_table.formatColumns(formulas))
21982199
except Exception as e:
21992200
raise DHError(e, "failed to color format columns.") from e
22002201

@@ -2214,7 +2215,8 @@ def format_column_where(self, col: str, cond: str, formula: str) -> Table:
22142215
DHError
22152216
"""
22162217
try:
2217-
return Table(j_table=self.j_table.formatColumnWhere(col, cond, formula))
2218+
with _query_scope_ctx():
2219+
return Table(j_table=self.j_table.formatColumnWhere(col, cond, formula))
22182220
except Exception as e:
22192221
raise DHError(e, "failed to color format column conditionally.") from e
22202222

@@ -2233,7 +2235,8 @@ def format_row_where(self, cond: str, formula: str) -> Table:
22332235
DHError
22342236
"""
22352237
try:
2236-
return Table(j_table=self.j_table.formatRowWhere(cond, formula))
2238+
with _query_scope_ctx():
2239+
return Table(j_table=self.j_table.formatRowWhere(cond, formula))
22372240
except Exception as e:
22382241
raise DHError(e, "failed to color format rows conditionally.") from e
22392242

0 commit comments

Comments
 (0)