Closed jim-smith closed 1 year ago
mypy is picking up a number of type errors. See pre-commit output
also, the static analysis is not happy about:
Use of possibly insecure function - consider using safer ast.literal_eval.
on https://github.com/AI-SDC/ACRO/blob/9469f7b443d0cb8063314d33fba5bcdeef8af2c0/acro/acro_stata_parser.py#L35
Yes mypy is - but that is because of two things: 1: its really odd about dictionaries 2: it is only doing static analysis
Professor Jim Smith Department of Computer Science and Creative Technologies University of the West of England Bristol BS16 1QY, UK t: +44 117 3287417 w: www.fet.uwe.ac.uk/~jsmith Orcidhttps://orcid.org/0000-0001-7908-1859 :
See my availability @.***/6ff8c362328448d49c717917ae5cd3c66650096615907872250/calendar.html>:
Find out about my new UKRI-funded project here: https://dareuk.org.uk/driver-project-sacro/
On 15 Aug 2023, at 13:34, Richard Preen @.***> wrote:
mypy is picking up a number of type errors. See pre-commit outputhttps://results.pre-commit.ci/run/github/534172863/1692102464.uwpCstbnRDaCNLPpVN8kTw
also, the static analysis is not happyhttps://app.codacy.com/gh/AI-SDC/ACRO/pullRequest?prid=12415414 about: Use of possibly insecure function - consider using safer ast.literal_eval. on https://github.com/AI-SDC/ACRO/blob/9469f7b443d0cb8063314d33fba5bcdeef8af2c0/acro/acro_stata_parser.py#L35
— Reply to this email directly, view it on GitHubhttps://github.com/AI-SDC/ACRO/pull/142#issuecomment-1678856873, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACZSEI3HZAO2Q4V55DGWUZTXVNUF5ANCNFSM6AAAAAA3Q6XQDM. You are receiving this because you authored the thread.Message ID: @.***>
Added lots more tests and a few pragma:no cover around try...except cases
patch coverage is reporting la fraction of a percent low because I test the function that do stata subsetting separately rather than adding extra tests to do the same thing via an acro table command. Will add a test to box those off later, but otherwise / notwithstanding, good to review I think
@rpreen Think I have addressed everything - this gets a clean bill of health and improve the overall coverage of acro to 100% (with one or two lines pragma'd out for valid reasons)
BUT I spent ages working on testing the aggregation functions only to realise I'd uncovered a bug /assumption in the code that does dominate/threshold checking - separate issue raised
Codecov Report
100.00% <100.00%> (ø)
100.00% <100.00%> (+1.47%)
100.00% <100.00%> (ø)
100.00% <100.00%> (+1.76%)
... and 1 file with indirect coverage changes