Skip to content

Commit

Permalink
Apply Literal to to_pandas()
Browse files Browse the repository at this point in the history
  • Loading branch information
jmao-denver committed Nov 10, 2023
1 parent 2817070 commit 80340a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions py/server/deephaven/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

""" This module supports the conversion between Deephaven tables and pandas DataFrames. """
from typing import List, Dict, Tuple
from typing import List, Dict, Tuple, Literal

import jpy
import numpy as np
Expand Down Expand Up @@ -112,8 +112,8 @@ def _column_to_series(table: Table, col_def: Column, conv_null: bool) -> pd.Seri
}


def to_pandas(table: Table, cols: List[str] = None, dtype_backend: str = None, conv_null: bool = True) -> \
pd.DataFrame:
def to_pandas(table: Table, cols: List[str] = None, dtype_backend: Literal[None, "pyarrow", "numpy_nullable"] = None,
conv_null: bool = True) -> pd.DataFrame:
"""Produces a pandas DataFrame from a table.
Note that the **entire table** is going to be cloned into memory, so the total number of entries in the table
Expand Down
2 changes: 0 additions & 2 deletions py/server/deephaven/table_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
_JFunctionGeneratedTableFactory = jpy.get_type("io.deephaven.engine.table.impl.util.FunctionGeneratedTableFactory")



def empty_table(size: int) -> Table:
"""Creates a table with rows but no columns.
Expand Down Expand Up @@ -395,7 +394,6 @@ def function_generated_table(table_generator: Callable[..., Table],
if exec_ctx is None:
raise ValueError("No execution context is available and exec_ctx was not provided! ")


def table_generator_function():
with exec_ctx:
result = table_generator(*args, **kwargs)
Expand Down

0 comments on commit 80340a4

Please sign in to comment.