iza-institute-of-labor-economics / gettsim

The GErman Taxes and Transfers SIMulator
https://gettsim.readthedocs.io/
GNU Affero General Public License v3.0
54 stars 32 forks source link

fix: fall back to default value if foreign key of `join_numpy` is unresolved #741

Closed lars-reimann closed 5 months ago

lars-reimann commented 5 months ago

What problem do you want to solve?

Closes #740

join_numpy now takes a value that is used if a foreign key cannot be resolved, e.g. because it is explicitly set to -1.

Todo

lars-reimann commented 5 months ago
  1. Currently, a default value must always be specified. Would that suffice for now?
  2. Should there still be a check of the validity of foreign keys? I've kept it for non-negative foreign keys.
  3. A default value for _unterhaltsvorschuss_empf_eink_above_income_threshold must still be added.
hmgaudecker commented 5 months ago
  1. I think the name "default" is misleading a bit. Maybe: "value_if_foreign_key_is_missing"? Too long, maybe... But yes, we should be explicit there.
  2. Validity checks for non-negative numbers sound good.
  3. That'll be up to @MImmesberger

Thanks!!!

MImmesberger commented 5 months ago

I just renamed the new argument and adjusted the join for Unterhaltsvorschuss accordingly.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.41%. Comparing base (23e7b4f) to head (42c5eca).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #741 +/- ## ======================================= Coverage 89.41% 89.41% ======================================= Files 51 51 Lines 3646 3647 +1 ======================================= + Hits 3260 3261 +1 Misses 386 386 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.