Skip to content

Commit

Permalink
Replaced google sheet references with CSV references
Browse files Browse the repository at this point in the history
  • Loading branch information
rishsriv committed Feb 24, 2024
1 parent 3214e97 commit 49dd0a2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion defog/admin_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

def update_db_schema(self, path_to_csv):
"""
Update the DB schema via a CSV, rather than by via a Google Sheet
Update the DB schema via a CSV
"""
schema_df = pd.read_csv(path_to_csv).fillna("")
schema = {}
Expand Down
6 changes: 3 additions & 3 deletions defog/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Available commands:
init\t\t\tSetup defog credentials and your database connection
gen <table1> <table2>\tSpecify tables to generate schema for
update <url>\t\tupdate schema (google sheets url) to defog
update <csv>\t\tupdate schema (path to CSV) to defog
query\t\t\tRun a query
deploy <gcp|aws>\t\tDeploy a defog server as a cloud function
quota\t\t\tCheck your API quota limits
Expand Down Expand Up @@ -224,7 +224,7 @@ def init():
print(f"\033[1m{pwd}/{filename}\033[0m\n")

print(
"You can give us more context about your schema by editing the CSV above. Refer to our cookbook on how to do this here: https://defog.notion.site/Cookbook-for-schema-definitions-1650a6855ea447fdb0be75d39975571b#2ba1d37e243e4da3b8f17590b4a3e4e3.\n\nOnce you're done, you can just hit enter to upload the data in the spreadsheet to Defog. If you would like to exit instead, just enter `exit`."
"You can give us more context about your schema by editing the CSV above. Refer to our cookbook on how to do this here: https://defog.notion.site/Cookbook-for-schema-definitions-1650a6855ea447fdb0be75d39975571b#2ba1d37e243e4da3b8f17590b4a3e4e3.\n\nOnce you're done, you can just hit enter to upload the data in the CSV to Defog. If you would like to exit instead, just enter `exit`."
)
upload_option = prompt().strip()
if upload_option == "exit":
Expand Down Expand Up @@ -368,7 +368,7 @@ def query():
)

print(
f"If you continue to get these errors, please consider updating the metadata in your schema by editing the google sheet generated and running `defog update <url>`, or by updating your glossary.\n"
f"If you continue to get these errors, please consider updating the metadata in your schema by editing the google CSV generated and running `defog update <path/to/csv>`, or by updating your glossary.\n"
)
else:
print(
Expand Down
4 changes: 2 additions & 2 deletions defog/generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def generate_postgres_schema(
scan: bool = True,
return_tables_only: bool = False,
) -> str:
# when upload is True, we send the schema to the defog servers and generate a Google Sheet
# when upload is True, we send the schema to the defog servers and generate a CSV
# when its false, we return the schema as a dict
try:
import psycopg2
Expand Down Expand Up @@ -121,7 +121,7 @@ def generate_redshift_schema(
scan: bool = True,
return_tables_only: bool = False,
) -> str:
# when upload is True, we send the schema to the defog servers and generate a Google Sheet
# when upload is True, we send the schema to the defog servers and generate a CSV
# when its false, we return the schema as a dict
try:
import psycopg2
Expand Down
2 changes: 1 addition & 1 deletion defog/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def get_feedback(api_key: str, db_type: str, user_question: str, sql_generated:
"Thank you for the feedback! We retrain our models every week, and you should see much better performance on these kinds of queries in another week.\n"
)
print(
f"If you continue to get these errors, please consider updating the metadata in your schema by editing the google sheet generated and running `defog update <url>`, or by updating your glossary.\n"
f"If you continue to get these errors, please consider updating the metadata in your schema by editing the CSV generated and running `defog update <url>`, or by updating your glossary.\n"
)
except Exception as e:
write_logs(f"Error in get_feedback:\n{e}")
Expand Down

0 comments on commit 49dd0a2

Please sign in to comment.