Fix PotM renaming
This commit is contained in:
parent
ab706abf5b
commit
cd62e3807a
@ -166,14 +166,19 @@ async def calculate_batting_cards(offense_stats: pd.DataFrame, cardset: dict, se
|
|||||||
|
|
||||||
def create_batting_card(df_data):
|
def create_batting_card(df_data):
|
||||||
logging.info(df_data['player_id'])
|
logging.info(df_data['player_id'])
|
||||||
s_data = cba.stealing(
|
try:
|
||||||
chances=int(df_data['SBO']),
|
s_data = cba.stealing(
|
||||||
sb2s=int(df_data['SB2']),
|
chances=int(df_data['SBO']),
|
||||||
cs2s=int(df_data['CS2']),
|
sb2s=int(df_data['SB2']),
|
||||||
sb3s=int(df_data['SB3']),
|
cs2s=int(df_data['CS2']),
|
||||||
cs3s=int(df_data['CS3']),
|
sb3s=int(df_data['SB3']),
|
||||||
season_pct=season_pct
|
cs3s=int(df_data['CS3']),
|
||||||
)
|
season_pct=season_pct
|
||||||
|
)
|
||||||
|
except ValueError as e:
|
||||||
|
print(f'Stealing error for *{df_data.name}*: {e}')
|
||||||
|
logging.error(e)
|
||||||
|
s_data = [0, 0, False, 0]
|
||||||
batting_cards.append({
|
batting_cards.append({
|
||||||
"player_id": df_data['player_id'],
|
"player_id": df_data['player_id'],
|
||||||
"key_bbref": df_data.name,
|
"key_bbref": df_data.name,
|
||||||
@ -290,7 +295,7 @@ async def post_player_updates(
|
|||||||
}
|
}
|
||||||
params = []
|
params = []
|
||||||
|
|
||||||
if df_data['description'] != player_desc:
|
if df_data['description'] != player_desc and 'potm' not in df_data['description'].lower():
|
||||||
params = [('description', f'{player_desc}')]
|
params = [('description', f'{player_desc}')]
|
||||||
|
|
||||||
if is_liveseries:
|
if is_liveseries:
|
||||||
|
|||||||
@ -376,7 +376,7 @@ async def post_player_updates(
|
|||||||
|
|
||||||
params = []
|
params = []
|
||||||
|
|
||||||
if df_data['description'] != player_description:
|
if df_data['description'] != player_description and 'potm' not in df_data['description'].lower():
|
||||||
params = [('description', f'{player_description}')]
|
params = [('description', f'{player_description}')]
|
||||||
|
|
||||||
if is_liveseries:
|
if is_liveseries:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user