diff --git a/defog/admin_methods.py b/defog/admin_methods.py index 1fe9d71..de36f53 100644 --- a/defog/admin_methods.py +++ b/defog/admin_methods.py @@ -32,6 +32,7 @@ def update_db_schema(self, path_to_csv, dev=False, temp=False): "dev": dev, "temp": temp, }, + verify=False, ) resp = r.json() return resp @@ -58,7 +59,7 @@ def update_glossary( } if customized_glossary: data["customized_glossary"] = customized_glossary - r = requests.post(f"{self.base_url}/update_glossary", json=data) + r = requests.post(f"{self.base_url}/update_glossary", json=data, verify=False) resp = r.json() return resp @@ -73,7 +74,7 @@ def delete_glossary(self, user_type=None, dev=False): } if user_type: data["key"] = user_type - r = requests.post(f"{self.base_url}/delete_glossary", json=data) + r = requests.post(f"{self.base_url}/delete_glossary", json=data, verify=False) if r.status_code == 200: print("Glossary deleted successfully.") else: @@ -88,6 +89,7 @@ def get_glossary(self, mode="general", dev=False): r = requests.post( f"{self.base_url}/get_metadata", json={"api_key": self.api_key, "dev": dev}, + verify=False, ) resp = r.json() if mode == "general": @@ -103,6 +105,7 @@ def get_metadata(self, format="markdown", export_path=None, dev=False): r = requests.post( f"{self.base_url}/get_metadata", json={"api_key": self.api_key, "dev": dev}, + verify=False, ) resp = r.json() items = [] @@ -131,8 +134,7 @@ def get_feedback(self, n_rows: int = 50, start_from: int = 0): Gets the feedback on the defog servers. """ r = requests.post( - f"{self.base_url}/get_feedback", - json={"api_key": self.api_key}, + f"{self.base_url}/get_feedback", json={"api_key": self.api_key}, verify=False ) resp = r.json() df = pd.DataFrame(resp["data"], columns=resp["columns"]) @@ -149,8 +151,7 @@ def get_quota(self) -> Optional[Dict]: """ api_key = self.api_key response = requests.post( - f"{self.base_url}/check_api_usage", - json={"api_key": api_key}, + f"{self.base_url}/check_api_usage", json={"api_key": api_key}, verify=False ) # get status code and return None if not 200 if response.status_code != 200: @@ -187,6 +188,7 @@ def update_golden_queries( "scrub": scrub, "dev": dev, }, + verify=False, ) resp = r.json() print( @@ -220,6 +222,7 @@ def delete_golden_queries( r = requests.post( f"{self.base_url}/delete_golden_queries", json={"api_key": self.api_key, "all": True, "dev": dev}, + verify=False, ) resp = r.json() print("All golden queries have now been deleted.") @@ -235,6 +238,7 @@ def delete_golden_queries( "api_key": self.api_key, "golden_queries": golden_queries, }, + verify=False, ) resp = r.json() return resp @@ -252,6 +256,7 @@ def get_golden_queries( "api_key": self.api_key, "dev": dev, }, + verify=False, ) resp = r.json() golden_queries = resp["golden_queries"] diff --git a/defog/cli.py b/defog/cli.py index c2d2fcc..e5ff169 100644 --- a/defog/cli.py +++ b/defog/cli.py @@ -368,6 +368,7 @@ def vet_metadata(): "column_name": column_name, "column_description": column_description, }, + verify=False, ) resp = r.json() new_column_description = resp["column_description"] diff --git a/defog/generate_schema.py b/defog/generate_schema.py index 17f355a..89f7ae5 100644 --- a/defog/generate_schema.py +++ b/defog/generate_schema.py @@ -100,6 +100,7 @@ def generate_postgres_schema( "api_key": self.api_key, "schemas": table_columns, }, + verify=False, ) resp = r.json() if "csv" in resp: @@ -193,6 +194,7 @@ def generate_redshift_schema( "foreign_keys": [], "indexes": [], }, + verify=False, ) resp = r.json() if "csv" in resp: @@ -268,6 +270,7 @@ def generate_mysql_schema( "foreign_keys": [], "indexes": [], }, + verify=False, ) resp = r.json() if "csv" in resp: @@ -342,6 +345,7 @@ def generate_databricks_schema( "foreign_keys": [], "indexes": [], }, + verify=False, ) resp = r.json() if "csv" in resp: @@ -435,6 +439,7 @@ def generate_snowflake_schema( "foreign_keys": [], "indexes": [], }, + verify=False, ) resp = r.json() if "csv" in resp: @@ -508,6 +513,7 @@ def generate_bigquery_schema( "foreign_keys": [], "indexes": [], }, + verify=False, ) resp = r.json() if "csv" in resp: @@ -589,6 +595,7 @@ def generate_sqlserver_schema( "foreign_keys": [], "indexes": [], }, + verify=False, ) resp = r.json() if "csv" in resp: diff --git a/defog/health_methods.py b/defog/health_methods.py index f044e5a..e30d015 100644 --- a/defog/health_methods.py +++ b/defog/health_methods.py @@ -9,6 +9,7 @@ def check_golden_queries_coverage(self, dev: bool = False): r = requests.post( f"{self.base_url}/get_golden_queries_coverage", json={"api_key": self.api_key, "dev": dev}, + verify=False, ) resp = r.json() return resp @@ -24,6 +25,7 @@ def check_md_valid(self, dev: bool = False): r = requests.post( f"{self.base_url}/check_md_valid", json={"api_key": self.api_key, "db_type": self.db_type, "dev": dev}, + verify=False, ) resp = r.json() return resp @@ -38,6 +40,7 @@ def check_gold_queries_valid(self, dev: bool = False): r = requests.post( f"{self.base_url}/check_gold_queries_valid", json={"api_key": self.api_key, "db_type": self.db_type, "dev": dev}, + verify=False, ) resp = r.json() return resp @@ -50,6 +53,7 @@ def check_glossary_valid(self, dev: bool = False): r = requests.post( f"{self.base_url}/check_glossary_valid", json={"api_key": self.api_key, "dev": dev}, + verify=False, ) resp = r.json() return resp @@ -62,6 +66,7 @@ def check_glossary_consistency(self, dev: bool = False): r = requests.post( f"{self.base_url}/check_glossary_consistency", json={"api_key": self.api_key, "dev": dev}, + verify=False, ) resp = r.json() return resp diff --git a/defog/query.py b/defog/query.py index ef0af81..8cdb5a8 100644 --- a/defog/query.py +++ b/defog/query.py @@ -339,6 +339,7 @@ def execute_query( "temp": temp, }, timeout=1, + verify=False, ) except: pass @@ -364,6 +365,7 @@ def execute_query( r = requests.post( f"{base_url}/retry_query_after_error", json=retry, + verify=False, ) response = r.json() new_query = response["new_query"] diff --git a/defog/util.py b/defog/util.py index d9c3c2e..7555059 100644 --- a/defog/util.py +++ b/defog/util.py @@ -273,6 +273,7 @@ def get_feedback( f"{base_url}/feedback", json=data, timeout=1, + verify=False, ) if feedback == "y": print("Thank you for the feedback!") @@ -289,6 +290,7 @@ def get_feedback( response = requests.post( f"{base_url}/reflect_on_error", json=data, + verify=False, ) if response.status_code == 200: @@ -309,6 +311,7 @@ def get_feedback( md_resp = requests.post( f"{base_url}/get_metadata", json={"api_key": api_key}, + verify=False, ) md_resp_dict = md_resp.json() glossary_current = md_resp_dict.get("glossary", "") @@ -319,12 +322,14 @@ def get_feedback( "api_key": api_key, "glossary": glossary_updated, }, + verify=False, ) print("Glossary updated successfully.\n") elif add_to_glossary != "n": md_resp = requests.post( f"{base_url}/get_metadata", json={"api_key": api_key}, + verify=False, ) md_resp_dict = md_resp.json() glossary_current = md_resp_dict.get("glossary", "") @@ -335,6 +340,7 @@ def get_feedback( "api_key": api_key, "glossary": glossary_updated, }, + verify=False, ) print("Glossary updated successfully.\n") else: @@ -350,6 +356,7 @@ def get_feedback( r = requests.post( f"{base_url}/get_metadata", json={"api_key": api_key}, + verify=False, ) resp = r.json() md = resp.get("table_metadata", {}) @@ -392,6 +399,7 @@ def get_feedback( "table_metadata": new_column_description, "db_type": db_type, }, + verify=False, ) print("Metadata updated successfully.\n") else: @@ -423,6 +431,7 @@ def get_feedback( "golden_queries": reference_queries_to_add, "scrub": True, }, + verify=False, ) if r.status_code == 200: print(