Skip to content

Commit fcb8f83

Browse files
Copilotpesc101
andcommitted
Address code review feedback: remove unused function and fix type assertion
Co-authored-by: pesc101 <53601317+pesc101@users.noreply.github.com>
1 parent 997a36a commit fcb8f83

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

frontend/src/components/chat/FundusRecordCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ const FundusRecordCard: React.FC<FundusRecordCardProps> = ({ muragId }) => {
185185
const fieldPositions = new Map(
186186
collection.fields
187187
.filter(f => f.position !== null)
188-
.map(f => [f.label_en, f.position!])
188+
.map(f => [f.label_en, f.position as number])
189189
);
190190

191191
// Sort details by position

src/fundus_murag/scripts/generate_murag_data.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -440,26 +440,6 @@ def _resolve_image_paths(records_df: pd.DataFrame, record_pix_dir: Path, worker_
440440
return records_df
441441

442442

443-
def _filter_record_details(row, collections_df: pd.DataFrame) -> dict[str, str]:
444-
"""
445-
Filter record details to only include fields that are visible for the collection.
446-
Fields are visible if they have a label defined in the collection's field configuration.
447-
"""
448-
collection_name = row["collection_name"]
449-
collection = collections_df[collections_df.collection_name == collection_name].iloc[0]
450-
visible_field_names = {field["name"] for field in collection.fields}
451-
452-
# Extract all detail fields from the row
453-
all_details = {
454-
k.replace("details_", ""): v for k, v in row.items() if k.startswith("details_") and v is not None and v != ""
455-
}
456-
457-
# Filter to only include visible fields
458-
filtered_details = {k: v for k, v in all_details.items() if k in visible_field_names}
459-
460-
return filtered_details
461-
462-
463443
def _get_record_title(row, collections_df: pd.DataFrame) -> str:
464444
collection_name = row["collection_name"]
465445
collection = collections_df[collections_df.collection_name == collection_name].iloc[0]

0 commit comments

Comments
 (0)