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

Possible misnamed attribute in error handler #1072

Closed nikhilwoodruff closed 2 years ago

nikhilwoodruff commented 3 years ago

Hi there!

I really enjoy OpenFisca, but I recently encountered an issue.

When debugging a whole host of unrelated errors, at some point I managed to trigger the error handler in Population.check_array_compatible_with_entity. However, printing that error message threw another error, that Population has no attribute key.

I couldn't disagree with this new exception - I wonder if in this line, should self.key instead be self.entity.key like other occurrences? I couldn't find any assignment or other usage of Population.key.

bonjourmauko commented 3 years ago

Hi @nikhilwoodruff ! Good catch, this seems like a bug, as as you've already noted, all seems to indicate that key belongs to entities.

bonjourmauko commented 3 years ago

Do not hesitate to propose a fix for this @nikhilwoodruff 😊

nikhilwoodruff commented 2 years ago

Thanks for the confirmation @maukoquiroga - I've just filed #1081