uberfastman / fantasy-football-metrics-weekly-report

Command line application to create weekly reports (containing stats, metrics, and rankings) for Fantasy Football leagues on the following platforms: Yahoo, ESPN, CBS, Sleeper, Fleaflicker
GNU General Public License v3.0
199 stars 49 forks source link

[Bug] Errors generating PDF Report #225

Closed brandoncruz3 closed 5 days ago

brandoncruz3 commented 1 week ago

Description of Issue

2024-10-09 14:33:53,764 - utilities.app - INFO - The Fantasy Football Metrics Weekly Report app is up to date and running v19.0.3.
Generate report for default league? (y/n) -> y
Generate report for default week? (y/n) -> y
2024-10-09 14:33:55,920 - report.builder - INFO -
Generating ESPN Fantasy Football report with settings:
    league id: 297966608
    game id: nfl
    week: selected/default
    start_week: default=1
    save_data: False
    refresh_web_data: False
    playoff_prob_sims: None
    break_ties: False
    dq_ce: False
    offline: False
    test: False
on Oct 09, 2024...
2024-10-09 14:33:55,923 - report.builder - INFO - Retrieving fantasy football data from ESPN API...
2024-10-09 14:34:19,448 - report.builder - INFO - ...retrieved all fantasy football data from ESPN API in 0:00:23.524447

2024-10-09 14:34:19,450 - features.base.feature - INFO - Retrieving Bad Boy data from https://www.usatoday.com/sports/nfl/arrests...
2024-10-09 14:34:58,772 - features.base.feature - INFO - ...retrieved 784 Bad Boy data records in 0:00:39.322170.
2024-10-09 14:34:58,773 - features.base.feature - INFO - Retrieving Beef data from https://api.sleeper.app/v1/players/nfl...
2024-10-09 14:34:59,607 - features.base.feature - INFO - ...retrieved 10311 Beef data records in 0:00:00.834833.
2024-10-09 14:34:59,609 - features.base.feature - INFO - Retrieving High Roller data from https://www.spotrac.com/nfl/fines/_/year/2024...
2024-10-09 14:35:00,902 - features.base.feature - INFO - ...retrieved 129 High Roller data records in 0:00:01.293409.
2024-10-09 14:35:00,902 - report.builder - INFO - ...setup complete for "SLACK HOC" (297966608) week 5 report.

2024-10-09 14:35:00,920 - report.data - INFO - Week 1 data processed.
2024-10-09 14:35:00,937 - report.data - INFO - Week 2 data processed.
2024-10-09 14:35:00,961 - report.data - INFO - Week 3 data processed.
2024-10-09 14:35:00,979 - report.data - INFO - Week 4 data processed.
2024-10-09 14:35:00,995 - calculate.playoff_probabilities - INFO - Running 10,000 Monte Carlo playoff simulations...
2024-10-09 14:35:02,184 - calculate.playoff_probabilities - INFO - ...ran 10,000 playoff simulations in 0:00:01.186047

2024-10-09 14:35:02,238 - report.data - INFO - Week 5 data processed.
2024-10-09 14:35:02,442 - report.pdf.generator - INFO - generating PDF (Slack-Hoc(297966608)_week-5_report.pdf)...
Traceback (most recent call last):
  File "/opt/ffmwr/main.py", line 306, in <module>
    report_pdf: Path = report.create_pdf_report()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/ffmwr/report/builder.py", line 395, in create_pdf_report
    file_for_upload: Path = pdf_generator.generate_pdf(filename_with_path, line_chart_data_list)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/ffmwr/report/pdf/generator.py", line 1921, in generate_pdf
    doc.build(elements, onLaterPages=self.add_page_number)
  File "/usr/local/lib/python3.12/site-packages/reportlab/platypus/doctemplate.py", line 1321, in build
    BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker)
  File "/usr/local/lib/python3.12/site-packages/reportlab/platypus/doctemplate.py", line 1083, in build
    self.handle_flowable(flowables)
  File "/usr/local/lib/python3.12/site-packages/reportlab/platypus/doctemplate.py", line 962, in handle_flowable
    raise LayoutError(ident)
reportlab.platypus.doctemplate.LayoutError: Flowable <Table@0x7FFFF79C8F80 1 rows x 1 cols(tallest row 783)> with cell(0,0) containing
"<Table@0x7FFFF7F1BCB0 44 rows x 3 cols(tallest row 18)> with cell(0,0) containing\n'<Paragraph at 0x7ffff76fcf20>Teams'"(550.0 x 783.6), tallest cell 783.6 points,  too large on page 2 in frame 'normal'(550.0 x 760.0*) of template 'Later'

Additional Information as Applicable

Fantasy Football Platform

ESPN

League ID

297966608

Operating System

macOS

Other

Full League - 20 Teams

uberfastman commented 5 days ago

@brandoncruz3 thanks for the bug report, this has been fixed in v19.0.4 (b4cc276fa4618ce58d3a9a2d8b57baeb5f795fe6). Please let me know if you have any further issues!