Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

[BUG] AttributeError when calling import_pbp_data function due to undefined 'Error' in exception handling. #95

@ivy113

Description

@ivy113

Is there an existing issue for this?

  • I have searched the existing issues

Have you installed the latest development version of the package(s) in question?

  • I have installed the latest development version of the package.

If this is a data issue, have you tried clearing your nflverse cache?

This is not a data-related issue.

What version of the package do you have?

0.3.2

Describe the bug

While attempting to use the import_pbp_data function in nfl_data_py, an AttributeError is raised due to the usage of an undefined 'Error' in the exception handling code. This causes the program to fail when trying to catch an exception.

Reprex

import nfl_data_py as nfl
pbp_data = nfl.import_pbp_data(years=[2023])

Expected Behavior

nfl.import_pbp_data should return a dataframe of the data for the year specified.

nflverse_sitrep

NA

Screenshots

No response

Additional context

AttributeError Traceback (most recent call last)
File ~/miniforge3/envs/sports/lib/python3.10/site-packages/nfl_data_py/init.py:140, in import_pbp_data(years, columns, include_participation, downcast, cache, alt_path, thread_requests)
139 try:
--> 140 data = pandas.read_parquet(path, columns=columns if columns else None, engine='auto')
142 raw = pandas.DataFrame(data)
...
--> 153 except Error as e:
154 print(e)
155 print('Data not available for ' + str(year))

NameError: name 'Error' is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions