Skip to content

Commit

Permalink
catch
Browse files Browse the repository at this point in the history
  • Loading branch information
SermetPekin committed Apr 17, 2024
1 parent 4895375 commit 5acac65
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions evdspy/EVDSlocal/index_requests/user_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,22 @@ def is_ok(self) -> bool:
return ok


import traceback


class DataProcessor:
def __init__(self, data: Any):
self.data = data

def process_to_dataframe(self) -> pd.DataFrame:
df = json_to_df(self.data)
df = make_df_float(df)
def process_to_dataframe(self) -> Optional[pd.DataFrame]:
try:
df = json_to_df(self.data)
except Exception as e:
print(e)
traceback.print_exc()
return None
if isinstance(df, pd.DataFrame):
df = make_df_float(df)
return df

def __call__(self, *args, **kwargs) -> pd.DataFrame:
Expand Down

0 comments on commit 5acac65

Please sign in to comment.