From 9e8012d9b57d1b42f2c953a56c863100d93347d0 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Thu, 28 Mar 2024 11:46:20 -0300 Subject: [PATCH] Revert "change migration scripts" This reverts commit ab1962370c31c8ca20fbe5b528d442df5ca6ac66. --- README.md | 2 +- api/src/utils/classification/__init__.py | 0 api/src/utils/classification/input_classification.py | 0 api/src/utils/helpers/{old => }/cube_to_db.py | 0 api/src/utils/helpers/{old => }/drilldowns_to_db.py | 3 +++ api/src/utils/helpers/schema_to_json.py | 3 --- api/src/utils/helpers/{old => }/tesseract_schema.json | 0 api/src/utils/helpers/{old => }/tesseract_schema_mapping.py | 0 8 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 api/src/utils/classification/__init__.py create mode 100644 api/src/utils/classification/input_classification.py rename api/src/utils/helpers/{old => }/cube_to_db.py (100%) rename api/src/utils/helpers/{old => }/drilldowns_to_db.py (94%) rename api/src/utils/helpers/{old => }/tesseract_schema.json (100%) rename api/src/utils/helpers/{old => }/tesseract_schema_mapping.py (100%) diff --git a/README.md b/README.md index d49d12c..99bb3c7 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ In order to add one cube, the steps are: - The script then appends a column containing embeddings generated from the drilldown names using the same embedding model mentioned before. - This process needs to be repeated for each drilldown level within the cube or those required for making cuts. Time variables don't need to be loaded into the database. -### [Migration for future projects] In progress... +### [For future projects] In progress... To add all the cubes of a project automatically, they can be mapped from the tesseract schema json to the custom format needed in the app. To do this follow these steps: diff --git a/api/src/utils/classification/__init__.py b/api/src/utils/classification/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/api/src/utils/classification/input_classification.py b/api/src/utils/classification/input_classification.py new file mode 100644 index 0000000..e69de29 diff --git a/api/src/utils/helpers/old/cube_to_db.py b/api/src/utils/helpers/cube_to_db.py similarity index 100% rename from api/src/utils/helpers/old/cube_to_db.py rename to api/src/utils/helpers/cube_to_db.py diff --git a/api/src/utils/helpers/old/drilldowns_to_db.py b/api/src/utils/helpers/drilldowns_to_db.py similarity index 94% rename from api/src/utils/helpers/old/drilldowns_to_db.py rename to api/src/utils/helpers/drilldowns_to_db.py index 13a8712..6f6cf6d 100644 --- a/api/src/utils/helpers/old/drilldowns_to_db.py +++ b/api/src/utils/helpers/drilldowns_to_db.py @@ -72,5 +72,8 @@ def load_data_to_db(api_url, measure_name): api_url = input() print("Enter measure name: ") measure_name = input() +#df = pd.read_csv('/Users/alexandrabjanes/Datawheel/CODE/datausa-chat/tables.csv') +#print(df.head()) +#create_table() load_data_to_db(api_url, measure_name = measure_name) diff --git a/api/src/utils/helpers/schema_to_json.py b/api/src/utils/helpers/schema_to_json.py index b8540df..2aacb26 100644 --- a/api/src/utils/helpers/schema_to_json.py +++ b/api/src/utils/helpers/schema_to_json.py @@ -3,9 +3,6 @@ import sys def parse_xml_to_json(xml_file): - """ - Parses XML schema to custom json format. - """ tree = ET.parse(xml_file) root = tree.getroot() diff --git a/api/src/utils/helpers/old/tesseract_schema.json b/api/src/utils/helpers/tesseract_schema.json similarity index 100% rename from api/src/utils/helpers/old/tesseract_schema.json rename to api/src/utils/helpers/tesseract_schema.json diff --git a/api/src/utils/helpers/old/tesseract_schema_mapping.py b/api/src/utils/helpers/tesseract_schema_mapping.py similarity index 100% rename from api/src/utils/helpers/old/tesseract_schema_mapping.py rename to api/src/utils/helpers/tesseract_schema_mapping.py