Replaced Pandas.DataFrame.append() method which will be deprecated in future, with Pandas.DataFrame.concat()
Extend the metadata append function to check if the row already exists, before adding a row. If it exists, the row will be updated with any new metadata. check_exist is currently optional, meaning that, it is possible to append rows with duplicated unique identifiers. (Ex: If a user set check_exist to False and add rows with the same subject_id to the subjects.xlsx file twice, there will be two rows with the same subject_id.) I implemented the functionality this way considering two aspects
Since the method is generic, for some metadata files, this might be acceptable behavior.
Considering the behavior of the append method prior to the modifications I did. i.e. before I modified the append method, it was adding the row disregarding whether it exists or not.
However, we can discuss and agree upon a final approach.
Description:
Pandas.DataFrame.append()
method which will be deprecated in future, withPandas.DataFrame.concat()
check_exist
is currently optional, meaning that, it is possible to append rows with duplicated unique identifiers. (Ex: If a user setcheck_exist
to False and add rows with the samesubject_id
to thesubjects.xlsx
file twice, there will be two rows with the samesubject_id
.) I implemented the functionality this way considering two aspectsHowever, we can discuss and agree upon a final approach.
Related issue(s):
30
32
Test Environment:
Ubuntu 20.04 Python 3.9