diff --git a/scripts/table_updates/README.md b/scripts/table_updates/README.md index edc31753..7b0cfcb5 100644 --- a/scripts/table_updates/README.md +++ b/scripts/table_updates/README.md @@ -8,6 +8,7 @@ Installation and Setup ### Python version Make sure you have Python 3.8 installed + ### Install the required packages (sudo) pip install -r requirements.txt @@ -17,6 +18,15 @@ Please make sure you have the [.synapseConfig file](https://help.synapse.org/doc ### Service catalog instance Use a t3.2xlarge ec2 instance for large memory requirement. +Putting it all together. + +``` +# Make sure you have anaconda installed +conda create -n genie-table-update python=3.8 +conda activate genie-table-update +pip install -r requirements.txt +``` + Usage ----- ### Prepare the Synapse tables to be updated diff --git a/scripts/table_updates/update_table_schema.py b/scripts/table_updates/update_table_schema.py index 6abbd73e..421a71c0 100644 --- a/scripts/table_updates/update_table_schema.py +++ b/scripts/table_updates/update_table_schema.py @@ -57,7 +57,7 @@ def _update_table_schema(syn, form, curated_data_element, logger, dry_run): current_cols = syn.getColumns(row['id']) current_cols = pandas.DataFrame(current_cols) current_cols['table_id'] = row['id'] - current_cols_df = current_cols_df.append(current_cols) + current_cols_df = pandas.concat([current_cols_df, current_cols]) # get the table id with the least columns tbl_with_least_cols = current_cols_df['table_id'].value_counts() tbl_with_least_cols_id = tbl_with_least_cols.idxmin()