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

NotImplementedError when calling str on StatisticsAggregator #662

Closed
PaulCormier opened this issue Feb 23, 2023 · 0 comments · Fixed by #678
Closed

NotImplementedError when calling str on StatisticsAggregator #662

PaulCormier opened this issue Feb 23, 2023 · 0 comments · Fixed by #678
Labels
bug The issue describes a malfunctioning aspect of the project. P4 Future work. E.g. something we might to get on in the future. Might be used for future ideas too. selected The issue has been selected to be worked on.

Comments

@PaulCormier
Copy link

This doesn't look like it will work:

print(str(stats))

aggregator = StatisticsAggregator()
for _, secret in secrets:
# TODO: gather real secrets?
# TODO: do we need repo_info?
aggregator.record_secret(secret)
return aggregator

def __str__(self) -> str:
raise NotImplementedError

Sure enough, running detect-secrets audit --stats .secrets.baseline:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\DevApps\Python\Python311\Scripts\detect-secrets.exe\__main__.py", line 7, in <module>
  File "C:\DevApps\Python\Python311\Lib\site-packages\detect_secrets\main.py", line 32, in main
    handle_audit_action(args)
  File "C:\DevApps\Python\Python311\Lib\site-packages\detect_secrets\main.py", line 131, in handle_audit_action
    print(str(stats))
          ^^^^^^^^^^
  File "C:\DevApps\Python\Python311\Lib\site-packages\detect_secrets\audit\analytics.py", line 61, in __str__
    raise NotImplementedError
NotImplementedError
@jpdakran jpdakran added pending The issue still needs to be reviewed by one of the maintainers. triaged The issue has been reviewed but has not been solved yet. bug The issue describes a malfunctioning aspect of the project. P4 Future work. E.g. something we might to get on in the future. Might be used for future ideas too. selected The issue has been selected to be worked on. and removed pending The issue still needs to be reviewed by one of the maintainers. triaged The issue has been reviewed but has not been solved yet. labels Mar 22, 2023
@jpdakran jpdakran linked a pull request Mar 29, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue describes a malfunctioning aspect of the project. P4 Future work. E.g. something we might to get on in the future. Might be used for future ideas too. selected The issue has been selected to be worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants