openfisca / openfisca-core

OpenFisca core engine. See other repositories for countries-specific code & data.
https://openfisca.org
GNU Affero General Public License v3.0
170 stars 75 forks source link

Fix TypeError on YAML test execution with trace option #1299

Open sandcha opened 1 week ago

sandcha commented 1 week ago

Connected to #1293 issue Connected to openfisca/openfisca-france#2387 issue

And contains same fix as in #1304 issue (adds tests)

We can merge #1304 before looking at this PR for the reactivated and added minimal test(s)

Bug fix

sandcha commented 1 day ago

Rebasing to get #1297. This should fix current TypeError: '>' not supported between instances of 'int' and 'NoneType' (detected for example by these GitHub actions checks).

sandcha commented 14 hours ago

Rebasing on top of #1297 didn't fix the issue: max_depth was set to a high default value but it was forgotten in YamlItem.runtest(...) where the max_depth command line option was used. So, a command line that didn't set the max_depth option ended up with max_depth set to None and the TypeError described above.

Fixed in last commits and the same fix also comes with open #1304.

🐛 The issue seems to have started with #1185: see line 64 in openfisca_core/tracers/computation_log.py file from diff.