pybaseball icon indicating copy to clipboard operation
pybaseball copied to clipboard

repeated warning when running pybaseball.statcast()

Open johnnynienstedt opened this issue 11 months ago • 1 comments

The following warning is raised once for each day in the query:

FutureWarning: errors='ignore' is deprecated and will raise in a future version. Use to_datetime without passing errors and catch exceptions explicitly instead data_copy[column] = data_copy[column].apply(pd.to_datetime, errors='ignore', format=date_format)

johnnynienstedt avatar Jan 28 '25 08:01 johnnynienstedt

The warning is worthwhile to keep, and can be suppressed in your implementation like so:

import warnings

with warnings.catch_warnings():
    warnings.simplefilter("ignore", FutureWarning)

    df = statcast(...)

mattdennewitz avatar Feb 21 '25 16:02 mattdennewitz