File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -411,13 +411,6 @@ def _build_query(
411411 embeddings_table = self .get_sa_table (table )
412412 metadata_table = self .timdex_dataset .metadata .get_sa_table ("records" )
413413
414- # create SQL statement with join to metadata.records
415- join_condition = and_ (
416- embeddings_table .c .timdex_record_id == metadata_table .c .timdex_record_id ,
417- embeddings_table .c .run_id == metadata_table .c .run_id ,
418- embeddings_table .c .run_record_offset == metadata_table .c .run_record_offset ,
419- )
420-
421414 # select specific columns or default to all from embeddings + metadata
422415 if columns :
423416 embeddings_cols = []
@@ -441,7 +434,12 @@ def _build_query(
441434 ]
442435 stmt = select (* embeddings_cols , * metadata_cols )
443436
444- # build join
437+ # create SQL statement with join to metadata.records
438+ join_condition = and_ (
439+ embeddings_table .c .timdex_record_id == metadata_table .c .timdex_record_id ,
440+ embeddings_table .c .run_id == metadata_table .c .run_id ,
441+ embeddings_table .c .run_record_offset == metadata_table .c .run_record_offset ,
442+ )
445443 stmt = stmt .select_from (embeddings_table .join (metadata_table , join_condition ))
446444
447445 # split filters between embeddings and metadata tables
You can’t perform that action at this time.
0 commit comments