Enhance data processing and utility functions

- Updated `process_price_change` to accept an optional `asset_id` parameter for better asset validation.
- Modified `process_data` to ensure `json_datas` is always a list and to pass `asset_id` when available.
- Added checks in `update_markets` to ensure the 'multiplier' column exists and fill NaN values with empty strings.
- Refactored multiplier application in `get_buy_sell_amount` to use `row.get()` for safer access.
This commit is contained in:
nicolasakf
2026-01-05 22:02:48 -03:00
parent a6f87c5765
commit cce9241c8d
3 changed files with 23 additions and 8 deletions
+6
View File
@@ -149,6 +149,12 @@ def update_markets():
received_df, received_params = get_sheet_df()
if len(received_df) > 0:
# Ensure multiplier column exists and fill NaN values with empty string
if 'multiplier' not in received_df.columns:
received_df['multiplier'] = ''
else:
received_df['multiplier'] = received_df['multiplier'].fillna('')
global_state.df, global_state.params = received_df.copy(), received_params