diff --git a/py/server/deephaven/csv.py b/py/server/deephaven/csv.py index 5c6dc25102d..e87a6a02669 100644 --- a/py/server/deephaven/csv.py +++ b/py/server/deephaven/csv.py @@ -75,9 +75,9 @@ def read( dht.byte: _JParsers.BYTE, dht.char: _JParsers.CHAR, dht.short: _JParsers.SHORT, - dht.int_: _JParsers.INT, + dht.int64: _JParsers.INT, dht.long: _JParsers.LONG, - dht.float_: _JParsers.FLOAT_FAST, + dht.float64: _JParsers.FLOAT_FAST, dht.double: _JParsers.DOUBLE, dht.string: _JParsers.STRING, dht.Instant: _JParsers.DATETIME, diff --git a/py/server/deephaven/dtypes.py b/py/server/deephaven/dtypes.py index aa7e752d0ad..e0308072acd 100644 --- a/py/server/deephaven/dtypes.py +++ b/py/server/deephaven/dtypes.py @@ -85,8 +85,6 @@ def __call__(self, *args, **kwargs): """Signed 64bit integer type""" int64 = long """Signed 64bit integer type""" -int_ = long -"""Signed 64bit integer type""" float32 = DType(j_name="float", qst_type=_JQstType.floatType(), is_primitive=True, np_type=np.float32) """Single-precision floating-point number type""" single = float32 @@ -95,8 +93,6 @@ def __call__(self, *args, **kwargs): """Double-precision floating-point number type""" double = float64 """Double-precision floating-point number type""" -float_ = float64 -"""Double-precision floating-point number type""" string = DType(j_name="java.lang.String", qst_type=_JQstType.stringType(), np_type=np.str_) """String type""" Character = DType(j_name="java.lang.Character") @@ -143,8 +139,6 @@ def __call__(self, *args, **kwargs): """64bit integer array type""" int64_array = long_array """64bit integer array type""" -int_array = long_array -"""64bit integer array type""" single_array = DType(j_name='[F') """Single-precision floating-point array type""" float32_array = single_array @@ -153,8 +147,6 @@ def __call__(self, *args, **kwargs): """Double-precision floating-point array type""" float64_array = double_array """Double-precision floating-point array type""" -float_array = double_array -"""Double-precision floating-point array type""" string_array = DType(j_name='[Ljava.lang.String;') """Java String array type""" boolean_array = DType(j_name='[Ljava.lang.Boolean;') diff --git a/py/server/deephaven/filters.py b/py/server/deephaven/filters.py index f132a62ef94..1d684997f91 100644 --- a/py/server/deephaven/filters.py +++ b/py/server/deephaven/filters.py @@ -6,10 +6,9 @@ from __future__ import annotations from enum import Enum -from typing import List, Union +from typing import List, Union, Sequence import jpy -import functools from deephaven import DHError from deephaven._wrapper import JObjectWrapper diff --git a/py/server/tests/test_csv.py b/py/server/tests/test_csv.py index a4ad3330f17..08a1355c18f 100644 --- a/py/server/tests/test_csv.py +++ b/py/server/tests/test_csv.py @@ -16,7 +16,7 @@ def test_read_simple(self): def test_read_header(self): col_names = ["Strings", "Longs", "Floats"] - col_types = [dtypes.string, dtypes.long, dtypes.float_] + col_types = [dtypes.string, dtypes.long, dtypes.float64] table_header = {k: v for k, v in zip(col_names, col_types)} t = read_csv('tests/data/test_csv.csv', header=table_header) t_col_names = [col.name for col in t.columns] @@ -24,7 +24,7 @@ def test_read_header(self): def test_read_error_col_type(self): col_names = ["Strings", "Longs", "Floats"] - col_types = [dtypes.string, dtypes.float_, dtypes.long] + col_types = [dtypes.string, dtypes.float64, dtypes.long] table_header = {k: v for k, v in zip(col_names, col_types)} with self.assertRaises(DHError) as cm: t = read_csv('tests/data/test_csv.csv', header=table_header) @@ -33,7 +33,7 @@ def test_read_error_col_type(self): def test_read_error_quote(self): col_names = ["Strings", "Longs", "Floats"] - col_types = [dtypes.string, dtypes.long, dtypes.float_] + col_types = [dtypes.string, dtypes.long, dtypes.float64] table_header = {k: v for k, v in zip(col_names, col_types)} with self.assertRaises(DHError) as cm: t = read_csv('tests/data/test_csv.csv', header=table_header, quote=",") @@ -48,7 +48,7 @@ def test_write(self): self.assertEqual(t_cols, [col.name for col in t.columns]) col_names = ["Strings", "Longs", "Floats"] - col_types = [dtypes.string, dtypes.long, dtypes.float_] + col_types = [dtypes.string, dtypes.long, dtypes.float64] table_header = {k: v for k, v in zip(col_names, col_types)} t = read_csv('tests/data/test_csv.csv', header=table_header) write_csv(t, "./test_write.csv", cols=col_names) diff --git a/py/server/tests/test_dtypes.py b/py/server/tests/test_dtypes.py index 72782297604..5058dda1143 100644 --- a/py/server/tests/test_dtypes.py +++ b/py/server/tests/test_dtypes.py @@ -30,10 +30,10 @@ class DTypesTestCase(BaseTestCase): def test_type_alias(self): self.assertEqual(dtypes.byte, dtypes.int8) self.assertEqual(dtypes.short, dtypes.int16) - self.assertEqual(dtypes.int_, dtypes.int64) + self.assertEqual(dtypes.int64, dtypes.int64) self.assertEqual(dtypes.long, dtypes.int64) - self.assertEqual(dtypes.float_, dtypes.double) - self.assertEqual(dtypes.float_, dtypes.float64) + self.assertEqual(dtypes.float64, dtypes.double) + self.assertEqual(dtypes.float64, dtypes.float64) self.assertEqual(dtypes.double, dtypes.float64) def test_j_type(self): @@ -41,9 +41,9 @@ def test_j_type(self): self.assertEqual(dtypes.byte.j_type, jpy.get_type("byte")) self.assertEqual(dtypes.short.j_type, jpy.get_type("short")) self.assertEqual(dtypes.char.j_type, jpy.get_type("char")) - self.assertEqual(dtypes.int_.j_type, jpy.get_type("long")) + self.assertEqual(dtypes.int64.j_type, jpy.get_type("long")) self.assertEqual(dtypes.long.j_type, jpy.get_type("long")) - self.assertEqual(dtypes.float_.j_type, jpy.get_type("double")) + self.assertEqual(dtypes.float64.j_type, jpy.get_type("double")) self.assertEqual(dtypes.double.j_type, jpy.get_type("double")) self.assertEqual(dtypes.string.j_type, jpy.get_type("java.lang.String")) self.assertEqual(dtypes.BigDecimal.j_type, jpy.get_type("java.math.BigDecimal")) @@ -65,9 +65,9 @@ def test_np_type(self): self.assertEqual(dtypes.byte.np_type, np.int8) self.assertEqual(dtypes.short.np_type, np.int16) self.assertEqual(dtypes.char.np_type, np.dtype('uint16')) - self.assertEqual(dtypes.int_.np_type, np.int64) + self.assertEqual(dtypes.int64.np_type, np.int64) self.assertEqual(dtypes.long.np_type, np.int64) - self.assertEqual(dtypes.float_.np_type, np.float64) + self.assertEqual(dtypes.float64.np_type, np.float64) self.assertEqual(dtypes.double.np_type, np.float64) self.assertEqual(dtypes.string.np_type, np.str_) self.assertEqual(dtypes.BigDecimal.np_type, np.object_) @@ -95,7 +95,7 @@ def test_callable(self): self.assertEqual(j_string.toString(), "abc") def test_array(self): - j_array = dtypes.array(dtypes.int_, range(5)) + j_array = dtypes.array(dtypes.int64, range(5)) np_array = np.frombuffer(j_array, np.int64) expected = np.array([0, 1, 2, 3, 4], dtype=np.int64) self.assertTrue(np.array_equal(np_array, expected)) @@ -136,7 +136,7 @@ def test_integer_array(self): def test_floating_array(self): - nulls = {dtypes.float_: NULL_FLOAT, dtypes.double: NULL_DOUBLE} + nulls = {dtypes.float64: NULL_FLOAT, dtypes.double: NULL_DOUBLE} np_array = np.array([float('nan'), 1.7976931348623157e+300, NULL_DOUBLE, 1.1, float('inf')], dtype=np.float64) for dt, nv in nulls.items(): diff --git a/py/server/tests/test_kafka_consumer.py b/py/server/tests/test_kafka_consumer.py index 4a354ce2633..91c2990f4e7 100644 --- a/py/server/tests/test_kafka_consumer.py +++ b/py/server/tests/test_kafka_consumer.py @@ -56,7 +56,7 @@ def test_json_spec(self): col_defs=[('Symbol', dtypes.string), ('Side', dtypes.string), ('Price', dtypes.double), - ('Qty', dtypes.int_), + ('Qty', dtypes.int64), ('Tstamp', dtypes.Instant)], mapping={ 'jsymbol': 'Symbol', @@ -70,7 +70,7 @@ def test_json_spec(self): 'Symbol': dtypes.string, 'Side': dtypes.string, 'Price': dtypes.double, - 'Qty': dtypes.int_, + 'Qty': dtypes.int64, 'Tstamp': dtypes.Instant }, mapping={ @@ -102,7 +102,7 @@ def test_json_spec(self): self.assertEqual("Price", cols[5].name) self.assertEqual(dtypes.double, cols[5].data_type) self.assertEqual("Qty", cols[6].name) - self.assertEqual(dtypes.int_, cols[6].data_type) + self.assertEqual(dtypes.int64, cols[6].data_type) self.assertEqual("Tstamp", cols[7].name) self.assertEqual(dtypes.Instant, cols[7].data_type) @@ -344,7 +344,7 @@ def test_json_spec_partitioned_table(self): [('Symbol', dtypes.string), ('Side', dtypes.string), ('Price', dtypes.double), - ('Qty', dtypes.int_), + ('Qty', dtypes.int64), ('Tstamp', dtypes.Instant)], mapping={ 'jsymbol': 'Symbol', @@ -368,7 +368,7 @@ def test_json_spec_partitioned_table(self): self.assertEqual("Price", cols[5].name) self.assertEqual(dtypes.double, cols[5].data_type) self.assertEqual("Qty", cols[6].name) - self.assertEqual(dtypes.int_, cols[6].data_type) + self.assertEqual(dtypes.int64, cols[6].data_type) self.assertEqual("Tstamp", cols[7].name) self.assertEqual(dtypes.Instant, cols[7].data_type) diff --git a/py/server/tests/test_udf_scalar_args.py b/py/server/tests/test_udf_scalar_args.py index 97615b1903c..f5fe4ac759e 100644 --- a/py/server/tests/test_udf_scalar_args.py +++ b/py/server/tests/test_udf_scalar_args.py @@ -548,7 +548,7 @@ def f2(x: float) -> Optional[int]: ... t = empty_table(1).update("X = f2(f1(ii))") - self.assertEqual(t.columns[0].data_type, dtypes.int_) + self.assertEqual(t.columns[0].data_type, dtypes.int64) with self.subTest("jpy.JType"): def f1(x: jpy.JType) -> bool: @@ -594,7 +594,7 @@ def use_c(c: Sequence) -> int: t = empty_table(3).update(["C = make_c()", "V = use_c(C)"]) self.assertIsNotNone(t) - self.assertEqual(t.columns[1].data_type, dtypes.int_) + self.assertEqual(t.columns[1].data_type, dtypes.int64) def misuse_c(c: int) -> int: return c