From fe04045aa433956772eaeaa8bcfc97b221711209 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Wed, 19 Nov 2025 21:36:43 +0800 Subject: [PATCH] Smol fix ETl (#40618) * Smol fix ETl * More fix --- .../Database/ETL/DestinationPanel/DestinationPanel.tsx | 4 ++-- apps/studio/data/storage/iceberg-namespaces-query.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/studio/components/interfaces/Database/ETL/DestinationPanel/DestinationPanel.tsx b/apps/studio/components/interfaces/Database/ETL/DestinationPanel/DestinationPanel.tsx index c37832da73a..bfc4f9cd6f1 100644 --- a/apps/studio/components/interfaces/Database/ETL/DestinationPanel/DestinationPanel.tsx +++ b/apps/studio/components/interfaces/Database/ETL/DestinationPanel/DestinationPanel.tsx @@ -6,6 +6,7 @@ import { toast } from 'sonner' import * as z from 'zod' import { useFlag, useParams } from 'common' +import { useApiKeysVisibility } from 'components/interfaces/APIKeys/hooks/useApiKeysVisibility' import { getCatalogURI } from 'components/interfaces/Storage/StorageSettings/StorageSettings.utils' import { getKeys, useAPIKeysQuery } from 'data/api-keys/api-keys-query' import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query' @@ -44,7 +45,6 @@ import { AnalyticsBucketFields, BigQueryFields } from './DestinationPanelFields' import { DestinationTypeSelection } from './DestinationTypeSelection' import { NoDestinationsAvailable } from './NoDestinationsAvailable' import { PublicationSelection } from './PublicationSelection' -import { useApiKeysVisibility } from 'components/interfaces/APIKeys/hooks/useApiKeysVisibility' const formId = 'destination-editor' @@ -109,7 +109,7 @@ export const DestinationPanel = ({ useS3AccessKeyCreateMutation() const { mutateAsync: createNamespace, isLoading: isCreatingNamespace } = - useIcebergNamespaceCreateMutation() + useIcebergNamespaceCreateMutation({ projectRef }) const { data: publications = [], diff --git a/apps/studio/data/storage/iceberg-namespaces-query.ts b/apps/studio/data/storage/iceberg-namespaces-query.ts index 494b953cbea..f770e7d3320 100644 --- a/apps/studio/data/storage/iceberg-namespaces-query.ts +++ b/apps/studio/data/storage/iceberg-namespaces-query.ts @@ -18,6 +18,7 @@ async function getNamespaces({ warehouse, tempApiKey, }: GetNamespacesVariables & { tempApiKey?: string }) { + console.log('getNamespaces', { warehouse }) try { if (!tempApiKey) throw new Error(`${errorPrefix}: API Key missing`) @@ -71,7 +72,9 @@ export const useIcebergNamespacesQuery = ( typeof projectRef !== 'undefined' && typeof tempApiKey !== 'undefined' && typeof catalogUri !== 'undefined' && - typeof warehouse !== 'undefined', + catalogUri.length > 0 && + typeof warehouse !== 'undefined' && + warehouse.length > 0, ...options, }) }