From 1755cbbe0579aac8b2b5de4eeb8100f775605b5b Mon Sep 17 00:00:00 2001 From: mohammadrezapourreza Date: Thu, 4 Apr 2024 09:40:52 -0400 Subject: [PATCH 1/2] DH-5337/updating the golden sqls colleciton name --- dataherald/context_store/__init__.py | 2 +- dataherald/scripts/delete_and_populate_golden_records.py | 2 +- dataherald/scripts/migrate_v001_to_v002.py | 2 +- dataherald/scripts/migrate_v006_to_v100.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dataherald/context_store/__init__.py b/dataherald/context_store/__init__.py index 2ae52dbc..19d85a03 100644 --- a/dataherald/context_store/__init__.py +++ b/dataherald/context_store/__init__.py @@ -18,7 +18,7 @@ def __init__(self, system: System): self.system = system self.db = self.system.instance(DB) self.golden_sql_collection = os.environ.get( - "GOLDEN_SQL_COLLECTION", "dataherald-staging" + "GOLDEN_SQL_COLLECTION", "ai-stage" ) self.vector_store = self.system.instance(VectorStore) diff --git a/dataherald/scripts/delete_and_populate_golden_records.py b/dataherald/scripts/delete_and_populate_golden_records.py index cc6bad8e..a1578097 100644 --- a/dataherald/scripts/delete_and_populate_golden_records.py +++ b/dataherald/scripts/delete_and_populate_golden_records.py @@ -12,7 +12,7 @@ system.start() storage = system.instance(DB) golden_sql_collection = os.environ.get( - "GOLDEN_SQL_COLLECTION", "dataherald-staging" + "GOLDEN_SQL_COLLECTION", "ai-stage" ) golden_sqls = storage.find_all("golden_sqls") diff --git a/dataherald/scripts/migrate_v001_to_v002.py b/dataherald/scripts/migrate_v001_to_v002.py index a45ce309..b6dd504b 100644 --- a/dataherald/scripts/migrate_v001_to_v002.py +++ b/dataherald/scripts/migrate_v001_to_v002.py @@ -36,7 +36,7 @@ def add_db_connection_id(collection_name: str, storage) -> None: add_db_connection_id("nl_question", storage) # Refresh vector stores golden_record_collection = os.environ.get( - "GOLDEN_SQL_COLLECTION", "dataherald-staging" + "GOLDEN_SQL_COLLECTION", "ai-stage" ) vector_store = system.instance(VectorStore) try: diff --git a/dataherald/scripts/migrate_v006_to_v100.py b/dataherald/scripts/migrate_v006_to_v100.py index 6f15e115..1e6b8ba3 100644 --- a/dataherald/scripts/migrate_v006_to_v100.py +++ b/dataherald/scripts/migrate_v006_to_v100.py @@ -31,7 +31,7 @@ def update_object_id_fields(field_name: str, collection_name: str): storage = system.instance(DB) # Refresh vector stores golden_sql_collection = os.environ.get( - "GOLDEN_RECORD_COLLECTION", "dataherald-staging" + "GOLDEN_RECORD_COLLECTION", "ai-stage" ) vector_store = system.instance(VectorStore) From 789089e1275eda42ee6e1c9e715bda774175c847 Mon Sep 17 00:00:00 2001 From: mohammadrezapourreza Date: Thu, 4 Apr 2024 09:43:01 -0400 Subject: [PATCH 2/2] DH-5337/reformat with balck --- dataherald/context_store/__init__.py | 4 +--- dataherald/scripts/delete_and_populate_golden_records.py | 4 +--- dataherald/scripts/migrate_v001_to_v002.py | 4 +--- dataherald/scripts/migrate_v006_to_v100.py | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dataherald/context_store/__init__.py b/dataherald/context_store/__init__.py index 19d85a03..e61f292d 100644 --- a/dataherald/context_store/__init__.py +++ b/dataherald/context_store/__init__.py @@ -17,9 +17,7 @@ class ContextStore(Component, ABC): def __init__(self, system: System): self.system = system self.db = self.system.instance(DB) - self.golden_sql_collection = os.environ.get( - "GOLDEN_SQL_COLLECTION", "ai-stage" - ) + self.golden_sql_collection = os.environ.get("GOLDEN_SQL_COLLECTION", "ai-stage") self.vector_store = self.system.instance(VectorStore) @abstractmethod diff --git a/dataherald/scripts/delete_and_populate_golden_records.py b/dataherald/scripts/delete_and_populate_golden_records.py index a1578097..28d65874 100644 --- a/dataherald/scripts/delete_and_populate_golden_records.py +++ b/dataherald/scripts/delete_and_populate_golden_records.py @@ -11,9 +11,7 @@ system = System(settings) system.start() storage = system.instance(DB) - golden_sql_collection = os.environ.get( - "GOLDEN_SQL_COLLECTION", "ai-stage" - ) + golden_sql_collection = os.environ.get("GOLDEN_SQL_COLLECTION", "ai-stage") golden_sqls = storage.find_all("golden_sqls") vector_store = system.instance(VectorStore) diff --git a/dataherald/scripts/migrate_v001_to_v002.py b/dataherald/scripts/migrate_v001_to_v002.py index b6dd504b..143b3c38 100644 --- a/dataherald/scripts/migrate_v001_to_v002.py +++ b/dataherald/scripts/migrate_v001_to_v002.py @@ -35,9 +35,7 @@ def add_db_connection_id(collection_name: str, storage) -> None: add_db_connection_id("golden_records", storage) add_db_connection_id("nl_question", storage) # Refresh vector stores - golden_record_collection = os.environ.get( - "GOLDEN_SQL_COLLECTION", "ai-stage" - ) + golden_record_collection = os.environ.get("GOLDEN_SQL_COLLECTION", "ai-stage") vector_store = system.instance(VectorStore) try: vector_store.delete_collection(golden_record_collection) diff --git a/dataherald/scripts/migrate_v006_to_v100.py b/dataherald/scripts/migrate_v006_to_v100.py index 1e6b8ba3..4cf330d9 100644 --- a/dataherald/scripts/migrate_v006_to_v100.py +++ b/dataherald/scripts/migrate_v006_to_v100.py @@ -30,9 +30,7 @@ def update_object_id_fields(field_name: str, collection_name: str): system.start() storage = system.instance(DB) # Refresh vector stores - golden_sql_collection = os.environ.get( - "GOLDEN_RECORD_COLLECTION", "ai-stage" - ) + golden_sql_collection = os.environ.get("GOLDEN_RECORD_COLLECTION", "ai-stage") vector_store = system.instance(VectorStore) golden_records = storage.find_all("golden_records")