Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rishsriv committed Jan 15, 2024
1 parent 84604da commit 0c00b8d
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions defog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,10 @@ def generate_postgres_schema(
resp = r.json()
if "csv" in resp:
csv = resp["csv"]
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv("defog_metadata.csv", index=False)
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv(
"defog_metadata.csv", index=False
)
return "defog_metadata.csv"
else:
return csv
Expand Down Expand Up @@ -430,8 +432,10 @@ def generate_redshift_schema(
resp = r.json()
if "csv" in resp:
csv = resp["csv"]
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv("defog_metadata.csv", index=False)
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv(
"defog_metadata.csv", index=False
)
return "defog_metadata.csv"
else:
return csv
Expand Down Expand Up @@ -523,8 +527,10 @@ def generate_mysql_schema(
resp = r.json()
if "csv" in resp:
csv = resp["csv"]
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv("defog_metadata.csv", index=False)
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv(
"defog_metadata.csv", index=False
)
return "defog_metadata.csv"
else:
return csv
Expand Down Expand Up @@ -595,7 +601,7 @@ def generate_databricks_schema(
resp = r.json()
if "csv" in resp:
csv = resp["csv"]
if return_format == "csv":
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv("defog_metadata.csv", index=False)
return "defog_metadata.csv"
else:
Expand Down Expand Up @@ -703,8 +709,10 @@ def generate_snowflake_schema(
resp = r.json()
if "csv" in resp:
csv = resp["csv"]
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv("defog_metadata.csv", index=False)
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv(
"defog_metadata.csv", index=False
)
return "defog_metadata.csv"
else:
return csv
Expand Down Expand Up @@ -780,8 +788,10 @@ def generate_bigquery_schema(
resp = r.json()
if "csv" in resp:
csv = resp["csv"]
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv("defog_metadata.csv", index=False)
if return_format == "csv":
pd.read_csv(StringIO(csv)).to_csv(
"defog_metadata.csv", index=False
)
return "defog_metadata.csv"
else:
return csv
Expand Down

0 comments on commit 0c00b8d

Please sign in to comment.