Skip to content

Commit 6f8c169

Browse files
kirtimanmishrazipstackmuhammad-ali-echandrasekharan-zipstack
authored
UN-2261 [FIX] Disabled broken Oracle connector from UI (#1663)
* removing oracle support in frontend * adding oracle unsupported connector to backend * adding oracle unsupported connector to backend * small change * small change * small change PR review --------- Co-authored-by: ali <[email protected]> Co-authored-by: Chandrasekharan M <[email protected]>
1 parent 987271c commit 6f8c169

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

backend/connector_processor/connector_processor.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,29 @@
2121
from unstract.connectors.exceptions import ConnectorError, FSAccessDeniedError
2222
from unstract.connectors.filesystems.ucs import UnstractCloudStorage
2323

24-
try:
25-
from unstract.connectors.queues.redis import RedisQueue
26-
except ImportError:
27-
RedisQueue = None
28-
2924
logger = logging.getLogger(__name__)
3025

3126

27+
def import_optional_connector(module_path: str, class_name: str):
28+
"""Import connector class with graceful error handling."""
29+
try:
30+
module = __import__(module_path, fromlist=[class_name])
31+
connector_class = getattr(module, class_name)
32+
logger.debug(f"Successfully imported {class_name}")
33+
return connector_class
34+
except ImportError as e:
35+
logger.debug(f"Failed to import {class_name}: {e}")
36+
return None
37+
38+
39+
# Import optional connectors
40+
RedisQueue = import_optional_connector("unstract.connectors.queues.redis", "RedisQueue")
41+
# TODO(UN-2261): Oracle temporarily excluded due to missing wallet support
42+
OracleDB = import_optional_connector(
43+
"unstract.connectors.databases.oracle_db", "OracleDB"
44+
)
45+
46+
3247
def fetch_connectors_by_key_value(
3348
key: str, value: Any, connector_mode: ConnectorMode | None = None
3449
) -> list[UnstractConnector]:
@@ -80,7 +95,7 @@ def get_all_supported_connectors(
8095
# TODO: Remove RedisQueue from the list of connectors and use separately instead
8196
# HACK: Connectors that are marked active but not supported explicitly
8297
unsupported_connectors = [
83-
connector.get_id() for connector in filter(None, [RedisQueue])
98+
connector.get_id() for connector in filter(None, [RedisQueue, OracleDB])
8499
]
85100

86101
if type == ConnectorKeys.INPUT:

frontend/src/components/connectors/connector-list-modal/ConnectorListModal.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { SearchOutlined } from "@ant-design/icons";
2-
import { Input, Row, Col, Tabs, Typography, Spin } from "antd";
2+
import { Col, Input, Row, Spin, Tabs, Typography } from "antd";
3+
import debounce from "lodash/debounce";
34
import PropTypes from "prop-types";
45
import { useEffect, useState } from "react";
5-
import debounce from "lodash/debounce";
66

77
import { ConnectorCard } from "../connector-card/ConnectorCard";
88
import "./ConnectorListModal.css";

frontend/src/components/input-output/list-of-sources/ListOfSources.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { SearchOutlined } from "@ant-design/icons";
22
import { Input, List, Segmented } from "antd";
3+
import debounce from "lodash/debounce";
34
import PropTypes from "prop-types";
45
import { useEffect, useState } from "react";
5-
import debounce from "lodash/debounce";
66

77
import { DataSourceCard } from "../data-source-card/DataSourceCard";
88
import "./ListOfSources.css";

0 commit comments

Comments
 (0)