From ed1ba0b1e4157e2392c10ade5c19cf61bb882d37 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Thu, 7 Mar 2024 09:51:35 -0500 Subject: [PATCH] fix: Mark JsPartitionedTable.getTable as nullable (#5050) - JsPartitionedTable.getTable returns `null` if the key is not found, as the table may not exist yet. --- .../io/deephaven/web/client/api/JsPartitionedTable.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java b/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java index 650cb3f5a7f..63298207f72 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java @@ -27,6 +27,7 @@ import io.deephaven.web.shared.data.RangeSet; import jsinterop.annotations.JsIgnore; import jsinterop.annotations.JsMethod; +import jsinterop.annotations.JsNullable; import jsinterop.annotations.JsProperty; import jsinterop.annotations.JsType; import jsinterop.base.Js; @@ -160,12 +161,12 @@ private void handleKeys(Event update) { } /** - * Fetch the table with the given key. + * Fetch the table with the given key. If the key does not exist, returns `null`. * * @param key The key to fetch. An array of values for each key column, in the same order as the key columns are. - * @return Promise of dh.Table + * @return Promise of dh.Table, or `null` if the key does not exist. */ - public Promise getTable(Object key) { + public Promise<@JsNullable JsTable> getTable(Object key) { // Wrap non-arrays in an array so we are consistent with how we track keys if (!JsArray.isArray(key)) { key = JsArray.of(key);