Skip to content

Commit 3b24486

Browse files
2 parents 4b347dd + ba4c6f7 commit 3b24486

File tree

17 files changed

+457
-43
lines changed

17 files changed

+457
-43
lines changed

backend/score.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,6 @@ async def get_source_list(
341341
"""
342342
try:
343343
start = time.time()
344-
# if password is not None and password != "null":
345-
# decoded_password = decode_password(password)
346-
# else:
347-
# decoded_password = None
348-
# userName = None
349-
# database = None
350-
# if " " in uri:
351-
# uri = uri.replace(" ","+")
352344
result = await asyncio.to_thread(get_source_list_from_graph,uri,userName,password,database)
353345
end = time.time()
354346
elapsed_time = end - start

backend/src/graphDB_dataAccess.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ def update_exception_db(self, file_name, exp_msg, retry_condition=None):
2929
if retry_condition is not None:
3030
retry_condition = None
3131
self.graph.query("""MERGE(d:Document {fileName :$fName}) SET d.status = $status, d.errorMessage = $error_msg, d.retry_condition = $retry_condition""",
32-
{"fName":file_name, "status":job_status, "error_msg":exp_msg, "retry_condition":retry_condition})
32+
{"fName":file_name, "status":job_status, "error_msg":exp_msg, "retry_condition":retry_condition},session_params={"database":self.graph._database})
3333
else :
3434
self.graph.query("""MERGE(d:Document {fileName :$fName}) SET d.status = $status, d.errorMessage = $error_msg""",
35-
{"fName":file_name, "status":job_status, "error_msg":exp_msg})
35+
{"fName":file_name, "status":job_status, "error_msg":exp_msg},session_params={"database":self.graph._database})
3636
except Exception as e:
3737
error_message = str(e)
3838
logging.error(f"Error in updating document node status as failed: {error_message}")
@@ -66,7 +66,7 @@ def create_source_node(self, obj_source_node:sourceNode):
6666
"entityEntityRelCount":obj_source_node.entityEntityRelCount,
6767
"communityNodeCount":obj_source_node.communityNodeCount,
6868
"communityRelCount":obj_source_node.communityRelCount
69-
})
69+
},session_params={"database":self.graph._database})
7070
except Exception as e:
7171
error_message = str(e)
7272
logging.info(f"error_message = {error_message}")
@@ -118,7 +118,7 @@ def update_source_node(self, obj_source_node:sourceNode):
118118
logging.info(f'Base Param value 1 : {param}')
119119
query = "MERGE(d:Document {fileName :$props.fileName}) SET d += $props"
120120
logging.info("Update source node properties")
121-
self.graph.query(query,param)
121+
self.graph.query(query,param,session_params={"database":self.graph._database})
122122
except Exception as e:
123123
error_message = str(e)
124124
self.update_exception_db(self,self.file_name,error_message)
@@ -139,15 +139,15 @@ def get_source_list(self):
139139
"""
140140
logging.info("Get existing files list from graph")
141141
query = "MATCH(d:Document) WHERE d.fileName IS NOT NULL RETURN d ORDER BY d.updatedAt DESC"
142-
result = self.graph.query(query)
142+
result = self.graph.query(query,session_params={"database":self.graph._database})
143143
list_of_json_objects = [entry['d'] for entry in result]
144144
return list_of_json_objects
145145

146146
def update_KNN_graph(self):
147147
"""
148148
Update the graph node with SIMILAR relationship where embedding scrore match
149149
"""
150-
index = self.graph.query("""show indexes yield * where type = 'VECTOR' and name = 'vector'""")
150+
index = self.graph.query("""show indexes yield * where type = 'VECTOR' and name = 'vector'""",session_params={"database":self.graph._database})
151151
# logging.info(f'show index vector: {index}')
152152
knn_min_score = os.environ.get('KNN_MIN_SCORE')
153153
if len(index) > 0:
@@ -158,14 +158,14 @@ def update_KNN_graph(self):
158158
WHERE node <> c and score >= $score MERGE (c)-[rel:SIMILAR]-(node) SET rel.score = score
159159
""",
160160
{"score":float(knn_min_score)}
161-
)
161+
,session_params={"database":self.graph._database})
162162
else:
163163
logging.info("Vector index does not exist, So KNN graph not update")
164164

165165
def check_account_access(self, database):
166166
try:
167167
query_dbms_componenet = "call dbms.components() yield edition"
168-
result_dbms_componenet = self.graph.query(query_dbms_componenet)
168+
result_dbms_componenet = self.graph.query(query_dbms_componenet,session_params={"database":self.graph._database})
169169

170170
if result_dbms_componenet[0]["edition"] == "enterprise":
171171
query = """
@@ -177,7 +177,7 @@ def check_account_access(self, database):
177177

178178
logging.info(f"Checking access for database: {database}")
179179

180-
result = self.graph.query(query, params={"database": database})
180+
result = self.graph.query(query, params={"database": database},session_params={"database":self.graph._database})
181181
read_access_count = result[0]["readAccessCount"] if result else 0
182182

183183
logging.info(f"Read access count: {read_access_count}")
@@ -202,7 +202,7 @@ def check_gds_version(self):
202202
gds_procedure_count = """
203203
SHOW FUNCTIONS YIELD name WHERE name STARTS WITH 'gds.version' RETURN COUNT(*) AS totalGdsProcedures
204204
"""
205-
result = self.graph.query(gds_procedure_count)
205+
result = self.graph.query(gds_procedure_count,session_params={"database":self.graph._database})
206206
total_gds_procedures = result[0]['totalGdsProcedures'] if result else 0
207207

208208
if total_gds_procedures > 0:
@@ -231,11 +231,11 @@ def connection_check_and_get_vector_dimensions(self,database):
231231
db_vector_dimension = self.graph.query("""SHOW INDEXES YIELD *
232232
WHERE type = 'VECTOR' AND name = 'vector'
233233
RETURN options.indexConfig['vector.dimensions'] AS vector_dimensions
234-
""")
234+
""",session_params={"database":self.graph._database})
235235

236236
result_chunks = self.graph.query("""match (c:Chunk) return size(c.embedding) as embeddingSize, count(*) as chunks,
237237
count(c.embedding) as hasEmbedding
238-
""")
238+
""",session_params={"database":self.graph._database})
239239

240240
embedding_model = os.getenv('EMBEDDING_MODEL')
241241
embeddings, application_dimension = load_embedding_model(embedding_model)
@@ -260,7 +260,7 @@ def execute_query(self, query, param=None,max_retries=3, delay=2):
260260
retries = 0
261261
while retries < max_retries:
262262
try:
263-
return self.graph.query(query, param)
263+
return self.graph.query(query, param,session_params={"database":self.graph._database})
264264
except TransientError as e:
265265
if "DeadlockDetected" in str(e):
266266
retries += 1
@@ -473,8 +473,8 @@ def drop_create_vector_index(self, isVectorIndexExist):
473473
embeddings, dimension = load_embedding_model(embedding_model)
474474

475475
if isVectorIndexExist == 'true':
476-
self.graph.query("""drop index vector""")
477-
# self.graph.query("""drop index vector""")
476+
self.graph.query("""drop index vector""",session_params={"database":self.graph._database})
477+
478478
self.graph.query("""CREATE VECTOR INDEX `vector` if not exists for (c:Chunk) on (c.embedding)
479479
OPTIONS {indexConfig: {
480480
`vector.dimensions`: $dimensions,
@@ -483,7 +483,7 @@ def drop_create_vector_index(self, isVectorIndexExist):
483483
""",
484484
{
485485
"dimensions" : dimension
486-
}
486+
},session_params={"database":self.graph._database}
487487
)
488488
return "Drop and Re-Create vector index succesfully"
489489

frontend/src/components/DataSources/Local/DropZone.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const DropZone: FunctionComponent = () => {
126126
if (curfile.name == file.name) {
127127
return {
128128
...curfile,
129-
uploadProgress: chunkNumber * chunkProgressIncrement,
129+
uploadProgress: Math.ceil(chunkNumber * chunkProgressIncrement),
130130
};
131131
}
132132
return curfile;
@@ -138,7 +138,7 @@ const DropZone: FunctionComponent = () => {
138138
if (curfile.name == file.name) {
139139
return {
140140
...curfile,
141-
uploadProgress: chunkNumber * chunkProgressIncrement,
141+
uploadProgress: Math.ceil(chunkNumber * chunkProgressIncrement),
142142
};
143143
}
144144
return curfile;

frontend/src/components/FileTable.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const FileTable: ForwardRefRenderFunction<ChildRef, FileTableProps> = (props, re
105105
setCopyRow(true);
106106
setTimeout(() => {
107107
setCopyRow(false);
108-
}, 5000);
108+
}, 3000);
109109
};
110110
const columns = useMemo(
111111
() => [
@@ -593,7 +593,7 @@ const FileTable: ForwardRefRenderFunction<ChildRef, FileTableProps> = (props, re
593593
handleCopy(copied);
594594
}}
595595
>
596-
<ClipboardDocumentIconSolid className={`${copyRow} ? 'cursor-wait': 'cursor`} />
596+
<ClipboardDocumentIconSolid className={`${copyRow ? 'cursor-progress!' : 'cursor'} `} />
597597
</IconButtonWithToolTip>
598598
<IconButtonWithToolTip
599599
onClick={() => {
@@ -616,7 +616,16 @@ const FileTable: ForwardRefRenderFunction<ChildRef, FileTableProps> = (props, re
616616
footer: (info) => info.column.id,
617617
}),
618618
],
619-
[filesData.length, statusFilter, filetypeFilter, llmtypeFilter, fileSourceFilter, isReadOnlyUser, colorMode]
619+
[
620+
filesData.length,
621+
statusFilter,
622+
filetypeFilter,
623+
llmtypeFilter,
624+
fileSourceFilter,
625+
isReadOnlyUser,
626+
colorMode,
627+
copyRow,
628+
]
620629
);
621630

622631
const table = useReactTable({

frontend/src/components/Graph/GraphPropertiesTable.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { GraphLabel, Typography } from '@neo4j-ndl/react';
22
import { GraphPropertiesTableProps } from '../../types';
33

44
const GraphPropertiesTable = ({ propertiesWithTypes }: GraphPropertiesTableProps): JSX.Element => {
5-
console.log('proerties', propertiesWithTypes);
65
return (
76
<div className='flex w-full flex-col break-all px-4 text-sm' data-testid='viz-details-pane-properties-table'>
87
<div className='mb-1 flex! flex-row pl-2'>

frontend/src/components/Layout/PageLayout.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const GCSModal = lazy(() => import('../DataSources/GCS/GCSModal'));
2828
const S3Modal = lazy(() => import('../DataSources/AWS/S3Modal'));
2929
const GenericModal = lazy(() => import('../WebSources/GenericSourceModal'));
3030
const ConnectionModal = lazy(() => import('../Popups/ConnectionModal/ConnectionModal'));
31-
3231
const spotlightsforunauthenticated = [
3332
{
3433
target: 'loginbutton',
@@ -92,7 +91,6 @@ const spotlightsforunauthenticated = [
9291
),
9392
},
9493
];
95-
9694
const spotlights = [
9795
{
9896
target: 'connectbutton',
@@ -147,7 +145,6 @@ const spotlights = [
147145
),
148146
},
149147
];
150-
151148
const PageLayout: React.FC = () => {
152149
const [openConnection, setOpenConnection] = useState<connectionState>({
153150
openPopUp: false,

frontend/src/utils/Utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,6 @@ export const generateGraphFromNodeAndRelVals = (
737737
): UserDefinedGraphSchema => {
738738
const schemeVal: Scheme = {};
739739
const uniqueNodesMap = new Map<string, ExtendedNode>();
740-
console.log('first rels', relVals);
741740
let nodeIdCounter = 0;
742741
nodeVals.forEach((node) => {
743742
const key = `${node.label}-${node.value}`;
@@ -792,7 +791,6 @@ export const generateGraphFromNodeAndRelVals = (
792791
type,
793792
});
794793
});
795-
console.log('new rels', transformedRelationships);
796794
return {
797795
nodes: transformedNodes,
798796
relationships: transformedRelationships,

frontend/yarn.lock

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@
336336
resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.4.2.tgz#6df6c45881fcb1c412d6688a311a98b7f59c1b52"
337337
integrity sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==
338338

339+
"@emotion/utils@^1.4.2":
340+
version "1.4.2"
341+
resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.4.2.tgz#6df6c45881fcb1c412d6688a311a98b7f59c1b52"
342+
integrity sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==
343+
339344
"@emotion/weak-memoize@^0.4.0":
340345
version "0.4.0"
341346
resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz#5e13fac887f08c44f76b0ccaf3370eb00fec9bb6"
@@ -3978,7 +3983,6 @@ gopd@^1.2.0:
39783983
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1"
39793984
integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==
39803985

3981-
39823986
graceful-fs@^4.2.4:
39833987
version "4.2.11"
39843988
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
@@ -4793,7 +4797,6 @@ levn@^0.4.1:
47934797
prelude-ls "^1.2.1"
47944798
type-check "~0.4.0"
47954799

4796-
47974800
lightningcss-darwin-arm64@1.29.1:
47984801
version "1.29.1"
47994802
resolved "https://registry.yarnpkg.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.29.1.tgz#dce17349c7b9f968f396ec240503de14e7b4870b"
@@ -5713,7 +5716,6 @@ npm-run-path@^5.1.0:
57135716
integrity sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==
57145717
dependencies:
57155718
path-key "^4.0.0"
5716-
57175719
obj-case@0.2.1:
57185720
version "0.2.1"
57195721
resolved "https://registry.yarnpkg.com/obj-case/-/obj-case-0.2.1.tgz#13a554d04e5ca32dfd9d566451fd2b0e11007f1a"
@@ -6719,10 +6721,6 @@ sonner@1.7.1:
67196721
resolved "https://registry.yarnpkg.com/sonner/-/sonner-1.7.1.tgz#737110a3e6211d8d766442076f852ddde1725205"
67206722
integrity sha512-b6LHBfH32SoVasRFECrdY8p8s7hXPDn3OHUFbZZbiB1ctLS9Gdh6rpX2dVrpQA0kiL5jcRzDDldwwLkSKk3+QQ==
67216723

6722-
source-map-js@^1.2.1:
6723-
version "1.2.1"
6724-
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46"
6725-
integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==
67266724

67276725
source-map@0.5.6:
67286726
version "0.5.6"
@@ -7145,7 +7143,6 @@ typed-array-length@^1.0.7:
71457143
possible-typed-array-names "^1.0.0"
71467144
reflect.getprototypeof "^1.0.6"
71477145

7148-
71497146
typescript@^5.7.3:
71507147
version "5.7.3"
71517148
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e"

0 commit comments

Comments
 (0)