From 1d8f07ead85ad6934a49559b1c79b569eb343bef Mon Sep 17 00:00:00 2001 From: Joe Flack Date: Tue, 17 Dec 2024 18:04:07 -0500 Subject: [PATCH] Bugfix: slurp docs `parents` column (#534) * Minor updates - Delete: unused import - Add: todo comments * Slurp docs parents bug - Bug fix: An issue where a | in the parents column would cause the markdown table to be rendered improperly. For all tables other than ordo, this would result in only 1 of the parents showing. For ordo, it would result in one of the parents populating into the subset column, instead of showing the actual subset. --- src/scripts/migrate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scripts/migrate.py b/src/scripts/migrate.py index 088c9786..bea56d30 100644 --- a/src/scripts/migrate.py +++ b/src/scripts/migrate.py @@ -163,6 +163,8 @@ def slurp_docs(): ontology_name = os.path.basename(path).replace(FILENAME_GLOB_PATTERN[1:], '') ontology_page_relpath = f'./migrate_{ontology_name.lower()}.md' df = pd.read_csv(path, sep='\t').fillna('') + # Fix issue where the | in the `parents` column is causing table rendering issues + df['parents'] = df['parents'].apply(lambda x: x.replace('|', ',')) # Individual pages relpath = os.path.realpath(path).replace(PROJECT_DIR + '/', '') instantiated_str: str = Template(JINJA_ONTO_PAGES).render(