Skip to content

Commit

Permalink
Using warning instead of raise exception to allow datasets without a …
Browse files Browse the repository at this point in the history
…custom transform to be processed as pd.DataFrame.
  • Loading branch information
Beatriz Saldana committed Sep 30, 2024
1 parent d2b1ba0 commit e73210a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/agoradatatools/process.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import typing
import warnings
from typing import Union

import synapseclient
Expand Down Expand Up @@ -138,8 +139,13 @@ def process_dataset(
filename=dataset_name + "." + dataset_obj[dataset_name]["final_format"],
)
else:
raise ADTDataProcessingError(
f"Data processing failed for {dataset_name}. Data is of type {type(df)}. Supported data types are: dict, list, pd.DataFrame."
warnings.warn(
f"{dataset_name} data is of type {type(df)}. Supported data types are: dict, list, pd.DataFrame. Will process as pd.DataFrame."
)
json_path = load.df_to_json(
df=df,
staging_path=staging_path,
filename=dataset_name + "." + dataset_obj[dataset_name]["final_format"],
)

gx_enabled = dataset_obj[dataset_name].get("gx_enabled", False)
Expand Down

0 comments on commit e73210a

Please sign in to comment.