Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Bail out more gracefully if profile data isn't present #1459

Open
HaoZeke opened this issue Jan 6, 2025 · 0 comments
Open

MAINT: Bail out more gracefully if profile data isn't present #1459

HaoZeke opened this issue Jan 6, 2025 · 0 comments

Comments

@HaoZeke
Copy link
Member

HaoZeke commented Jan 6, 2025

Currently loading a benchmark without profile data present and checking for it raises, which could well be a user warning instead.

File ~/Git/Github/asvWork/asv/asv/results.py:564, in Results.get_profile(self, benchmark_name)
    549 """
    550 Get the profile data for the given benchmark name.
    551 
   (...)
    561 
    562 """
    563 profile_data = self._profiles[benchmark_name]
--> 564 profile_data = profile_data.encode('ascii')
    565 profile_bytes = zlib.decompress(base64.b64decode(profile_data))
    566 return profile_bytes

AttributeError: 'NoneType' object has no attribute 'encode'

In [64]: b1.get_profile('benchmarks.TimeSuite.time_add_arr')

Doesn't really matter but still, a better error / warning would be nicer.

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

No branches or pull requests

1 participant