diff --git a/task/summary3.py b/task/summary3.py index 1effa59..e6740a7 100644 --- a/task/summary3.py +++ b/task/summary3.py @@ -343,15 +343,15 @@ class Summary3(Task): @HandlerWrapper def handler_now(self, role_data, device_data, account_data, df, group, cdate): - - role_data['new_role_list'] = list(df['_game_role_id'].unique()) - role_data['new_role'] = len(role_data['new_role_list']) - - device_data['new_device_list'] = list(df[df['is_new_device'] == 1]['_device_id'].unique()) - device_data['new_device'] = len(device_data['new_device_list']) - - account_data['new_account_list'] = list(df[df['is_new_channel_uid'] == 1]['_channel_uid'].unique()) - account_data['new_account'] = len(account_data['new_account_list']) + if df.get('_game_role_id'): + role_data['new_role_list'] = list(df['_game_role_id'].unique()) + role_data['new_role'] = len(role_data['new_role_list']) + if df.get('is_new_device'): + device_data['new_device_list'] = list(df[df['is_new_device'] == 1]['_device_id'].unique()) + device_data['new_device'] = len(device_data['new_device_list']) + if df.get('is_new_channel_uid'): + account_data['new_account_list'] = list(df[df['is_new_channel_uid'] == 1]['_channel_uid'].unique()) + account_data['new_account'] = len(account_data['new_account_list']) @HandlerWrapper def handler_pay(self, role_data, device_data, account_data, df, group, cdate):