Skip to content

Conversation

@golowanow
Copy link
Member

@golowanow golowanow commented Aug 19, 2025

  1. Fix float_format string passed to pandas to_csv() and to_html() to be a callable object resolving 'TypeError: 'str' object is not callable' observed (with pandas==2.1.4)

  2. Fix missing return statement at skip_to_first_trace() pylint R1710 'inconsistent return statement'.

For 1) - no issue with pandas==1.3.5, but TypeError with pandas==2.1.4+dfsg

Traceback (most recent call last):
  File "/home/ubuntu/sof-test/tools/sof_perf_analyzer.py", line 306, in 
    main()
  File "/home/ubuntu/sof-test/tools/sof_perf_analyzer.py", line 303, in main
    print_perf_info()
  File "/home/ubuntu/sof-test/tools/sof_perf_analyzer.py", line 269, in print_perf_info
    stats.to_html(args.out2html, float_format='%.3f', index=False)
  File "/usr/lib/python3/dist-packages/pandas/core/frame.py", line 3235, in to_html
    return fmt.DataFrameRenderer(formatter).to_html(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pandas/io/formats/format.py", line 1074, in to_html
    string = html_formatter.to_string()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pandas/io/formats/html.py", line 88, in to_string
    lines = self.render()
            ^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pandas/io/formats/html.py", line 94, in render
    self._write_table()
  File "/usr/lib/python3/dist-packages/pandas/io/formats/html.py", line 269, in _write_table
    self._write_body(indent + self.indent_delta)
  File "/usr/lib/python3/dist-packages/pandas/io/formats/html.py", line 417, in _write_body
    fmt_values = self._get_formatted_values()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pandas/io/formats/html.py", line 412, in _get_formatted_values
    fmt_values = {i: self.fmt.format_col(i) for i in range(self.ncols)}
                     ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pandas/io/formats/format.py", line 893, in format_col
    return format_array(
           ^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pandas/io/formats/format.py", line 1296, in format_array
    return fmt_obj.get_result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pandas/io/formats/format.py", line 1329, in get_result
    fmt_values = self._format_strings()
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pandas/io/formats/format.py", line 1398, in _format_strings
    fmt_values.append(float_format(v))
                      ^^^^^^^^^^^^^^^
TypeError: 'str' object is not callable

Fix float_format string passed to pandas to_csv() and to_html() to be
a callable object resolving 'TypeError: 'str' object is not callable'
observed with pandas==2.1.4

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Fix missing return statement at skip_to_first_trace()
pylint R1710 'inconsistent return statement'.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
@golowanow golowanow changed the title [SKIP SOF-TEST] sof_perf_analyzer: fix float_format not callable error sof_perf_analyzer: fix float_format not callable error Aug 19, 2025
@golowanow golowanow marked this pull request as ready for review August 19, 2025 14:47
@golowanow golowanow requested review from a team, lgirdwood and marc-hb as code owners August 19, 2025 14:47
@golowanow
Copy link
Member Author

SOFCI TEST

@marc-hb marc-hb requested review from singalsu and removed request for marc-hb August 19, 2025 16:08
@golowanow golowanow merged commit 067c933 into thesofproject:main Aug 20, 2025
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants