Skip to content

Commit 04bafed

Browse files
committed
Fix duplicated in csv
1 parent ab16753 commit 04bafed

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

superannotate/db/projects.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2059,15 +2059,29 @@ def attach_file_urls_to_project(project, attachments, annotation_status):
20592059
else:
20602060
folder_id = get_project_root_folder_id(project)
20612061

2062+
attached = []
2063+
to_upload = []
2064+
duplicates = []
2065+
for i in df_names_urls:
2066+
temp = i[0]
2067+
i[0] = i[0].strip()
2068+
if i[0] not in attached:
2069+
attached.append(i[0])
2070+
to_upload.append(i)
2071+
else:
2072+
duplicates.append(temp)
2073+
2074+
20622075
list_of_uploaded, list_of_not_uploaded, list_of_duplicated = _attach_urls(
2063-
file_urls=df_names_urls,
2076+
file_urls=to_upload,
20642077
team_id=team_id,
20652078
folder_id=folder_id,
20662079
project_id=project_id,
20672080
annotation_status=annotation_status,
20682081
project=project,
20692082
folder_name=folder_name
20702083
)
2084+
list_of_duplicated += duplicates
20712085

20722086
return list_of_uploaded, list_of_not_uploaded, list_of_duplicated
20732087

0 commit comments

Comments
 (0)