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

BUG: Error messages for variables that are disaggregated to the individual level #757

Open MImmesberger opened 4 months ago

MImmesberger commented 4 months ago

Bug description

In #753 we introduced the variables wohnfläche, heizkosten_m, bruttokaltmiete_m that are computed from the basic input variables at hh level.

If the user forgets to add the individual level variable and the variable on hh level, the error message reports a cycle in the DAG. It would be more helpful for the user if this message reported the missing input column.

Reproducable Example

Test input:

---
info:
  note: ''
  source: ''
inputs:
  provided:
    p_id:
      - 0
    hh_id:
      - 0
    bruttokaltmiete_m_bg:
      - 600.0
    heizkosten_m_bg:
      - 0.0
  assumed: {}
outputs:
  _arbeitsl_geld_2_warmmiete_pro_qm_m_bg:
    - 600.0

Error message:

E           ValueError: The DAG contains one or more cycles:
E
E           [
E               "['wohnfläche_hh', 'wohnfläche']",
E           ]