@@ -442,29 +442,29 @@ def _rename_columns_labels_duplicates(self, structure: list) -> None:
442
442
q .label = f"{ q .label } ({ duplicates_count [q .label ]} )"
443
443
444
444
def _obtain_url (self , row , column ):
445
- """Aux Function to obtain url of an attached file.
446
- Replaces the ' ' (spaces) by '_' from the attached files"""
445
+ """Aux Function to obtain url of an attached file.
446
+ Replaces the ' ' (spaces) by '_' from the attached files"""
447
447
448
- df = pd .json_normalize (row ["_attachments" ])
449
- if "filename" in df .columns :
450
- df ["filename_ok" ] = df ["filename" ].apply (
451
- lambda x : x .split ("/" )[- 1 ].replace (" " , "_" )
452
- )
448
+ df = pd .json_normalize (row ["_attachments" ])
449
+ if "filename" in df .columns :
450
+ df ["filename_ok" ] = df ["filename" ].apply (
451
+ lambda x : x .split ("/" )[- 1 ].replace (" " , "_" )
452
+ )
453
453
454
- if pd .isna (row [column ]):
455
- name = None
456
- else :
457
- name = row [column ].replace (" " , "_" )
454
+ if pd .isna (row [column ]):
455
+ name = None
456
+ else :
457
+ name = row [column ].replace (" " , "_" )
458
458
459
- if name is not None :
460
- matching_rows = df .loc [df ["filename_ok" ] == name ]
461
- if not matching_rows .empty :
462
- url = matching_rows ["download_url" ].iloc [0 ]
463
- else :
464
- url = np .nan
459
+ if name is not None :
460
+ matching_rows = df .loc [df ["filename_ok" ] == name ]
461
+ if not matching_rows .empty :
462
+ url = matching_rows ["download_url" ].iloc [0 ]
465
463
else :
466
464
url = np .nan
467
- return url
465
+ else :
466
+ url = np .nan
467
+ return url
468
468
469
469
def _split_gps_coords (self ) -> None :
470
470
"""Split the columns of type 'geopoint' into 4 new columns
0 commit comments