Skip to content

Commit

Permalink
Removing unnecessary warning and explicit isinstance(df,DataFrame) in…
Browse files Browse the repository at this point in the history
… process_dataset() for converting to json
  • Loading branch information
Beatriz Saldana committed Sep 30, 2024
1 parent 31c5806 commit e663961
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/agoradatatools/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,8 @@ def process_dataset(
staging_path=staging_path,
filename=dataset_name + "." + dataset_obj[dataset_name]["final_format"],
)
elif isinstance(df, DataFrame):
json_path = load.df_to_json(
df=df,
staging_path=staging_path,
filename=dataset_name + "." + dataset_obj[dataset_name]["final_format"],
)
else:
warnings.warn(
f"{dataset_name} data is of type {type(df)}. Supported data types are: dict, list, pd.DataFrame. Will process as pd.DataFrame."
)
# If it's a type that we don't support, we will process it as a DataFrame
json_path = load.df_to_json(
df=df,
staging_path=staging_path,
Expand Down

0 comments on commit e663961

Please sign in to comment.