From b82b6b9c698e654f0bf9f99675652f66f180b2e3 Mon Sep 17 00:00:00 2001 From: Hector Castejon Diaz Date: Tue, 23 Jul 2024 09:23:49 +0200 Subject: [PATCH] [Fix] Check if queries are null in tests --- .../java/com/databricks/sdk/integration/SqlIT.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/databricks-sdk-java/src/test/java/com/databricks/sdk/integration/SqlIT.java b/databricks-sdk-java/src/test/java/com/databricks/sdk/integration/SqlIT.java index 47f310cf..8d99f452 100644 --- a/databricks-sdk-java/src/test/java/com/databricks/sdk/integration/SqlIT.java +++ b/databricks-sdk-java/src/test/java/com/databricks/sdk/integration/SqlIT.java @@ -22,8 +22,10 @@ void listQueryHistoryTimeRange(WorkspaceClient w) { new ListQueryHistoryRequest() .setFilterBy(new QueryFilter().setQueryStartTimeRange(timeRange)); Iterable queries = w.queryHistory().list(request).getRes(); - for (QueryInfo query : queries) { - System.out.println(query); + if (queries != null) { + for (QueryInfo query : queries) { + System.out.println(query); + } } } @@ -33,8 +35,10 @@ void listQueryHistoryUserIds(WorkspaceClient w) { new ListQueryHistoryRequest() .setFilterBy(new QueryFilter().setUserIds(Arrays.asList(123L, 456L))); Iterable queries = w.queryHistory().list(request).getRes(); - for (QueryInfo query : queries) { - System.out.println(query); + if (queries != null) { + for (QueryInfo query : queries) { + System.out.println(query); + } } } }