guidopetri / chess-pipeline

Pulling games from the Lichess API into a PostgreSQL database for data analysis.
GNU General Public License v3.0
20 stars 2 forks source link

EloByWeekday fails when no games exist #3

Closed guidopetri closed 4 years ago

guidopetri commented 4 years ago

If no games exist, EloByWeekday fails with:

Runtime error:
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/luigi/worker.py", line 199, in run
    new_deps = self._run_get_new_deps()
  File "/home/pi/.local/lib/python3.7/site-packages/luigi/worker.py", line 141, in _run_get_new_deps
    task_gen = self.task.run()
  File "/home/pi/Git/chess-pipeline/newsletter.py", line 174, in run
    df['weekday_played'] = df['datetime_played'].dt.weekday
  File "/home/pi/.local/lib/python3.7/site-packages/pandas/core/generic.py", line 5270, in __getattr__
    return object.__getattribute__(self, name)
  File "/home/pi/.local/lib/python3.7/site-packages/pandas/core/accessor.py", line 187, in __get__
    accessor_obj = self._accessor(obj)
  File "/home/pi/.local/lib/python3.7/site-packages/pandas/core/indexes/accessors.py", line 338, in __new__
    raise AttributeError("Can only use .dt accessor with datetimelike values")
AttributeError: Can only use .dt accessor with datetimelike values
guidopetri commented 4 years ago

Tentatively closed by ba7929a.