Skip to content

Commit

Permalink
Moved write_csv to csv.py and rebased to new main
Browse files Browse the repository at this point in the history
  • Loading branch information
jmao-denver committed Dec 1, 2021
1 parent af60344 commit 08597a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pyintegration/deephaven2/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
_JInferenceSpecs = jpy.get_type("io.deephaven.csv.InferenceSpecs")
_JTableHeader = jpy.get_type("io.deephaven.qst.table.TableHeader")
_JCharset = jpy.get_type("java.nio.charset.Charset")
_JTableTools = jpy.get_type("io.deephaven.db.tables.utils.TableTools")
_JCsvTools = jpy.get_type("io.deephaven.csv.CsvTools")


class Inference(Enum):
Expand Down Expand Up @@ -128,6 +128,6 @@ def write(table: Table, path: str, cols: List[str] = []) -> None:
DHError
"""
try:
_JTableTools.writeCsv(table.j_table, path, *cols)
_JCsvTools.writeCsv(table.j_table, False, path, *cols)
except Exception as e:
raise DHError("write csv failed.") from e
6 changes: 3 additions & 3 deletions pyintegration/deephaven2/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def size(self) -> int:
@property
def is_refreshing(self) -> bool:
""" Whether this table is refreshing. """
return self._j_table.isRefreshing()
return self.j_table.isRefreshing()

@property
def columns(self):
Expand Down Expand Up @@ -142,7 +142,7 @@ def to_string(self, num_rows: int = 10, cols: List[str] = []) -> str:
# def snapshot(self):
# """ Take a snapshot of the table. """
# try:
# return empty_table(0).snapshot(self._j_table)
# return empty_table(0).snapshot(self.j_table)
# except Exception as e:
# raise DHError("") from e
#
Expand Down Expand Up @@ -219,7 +219,7 @@ def move_columns_up(self, cols: List[str]) -> Table:
DHError
"""
try:
return Table(j_table=self.j_table.moveUpColumns(*cols))
return Table(j_table=self.j_table.moveColumnsUp(*cols))
except Exception as e:
raise DHError(e, "table move_columns_up operation failed.") from e

Expand Down
2 changes: 1 addition & 1 deletion pyintegration/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_time_table(self):
t = time_table("00:00:01", start_time="2021-11-06T13:21:00 NY")
self.assertEqual(1, len(t.columns))
self.assertTrue(t.is_refreshing)
self.assertEqual("2021-11-06T13:21:00.000000000 NY", t._j_table.getColumnSource("Timestamp").get(0).toString())
self.assertEqual("2021-11-06T13:21:00.000000000 NY", t.j_table.getColumnSource("Timestamp").get(0).toString())

def test_repr(self):
print(self.test_table)
Expand Down

0 comments on commit 08597a5

Please sign in to comment.