PSLmodels / Tax-Calculator

USA Federal Individual Income and Payroll Tax Microsimulation Model
https://taxcalc.pslmodels.org
Other
262 stars 157 forks source link

Issues with `write_decile_table()` #2795

Closed awunderground closed 2 months ago

awunderground commented 2 months ago

I am trying to use write_tables_file() to output distributional tables. write_tables_file() calls the method write_decile_table(), which uses the function unweighted_sum().

This code includes the argument include_groups=False even though include_groups doesn't appear to be an argument for unweighted_sum() source code.

I get the following error, which is fatal:

Error in py_call_impl(callable, call_args$unnamed, call_args$named) :
  TypeError: unweighted_sum() got an unexpected keyword argument 'include_groups'
jdebacker commented 2 months ago

@awunderground Thanks for raising this issue. To help diagnose it, can you provide some code to replicate the error you are finding?

jdebacker commented 2 months ago

Further investigation showed that this bug is a result of the user having pandas with version < 2.2 installed in their environment. The taxcalc-dev environment specifies that the model requires pandas >= 2.2.

The specific pandas deprecation re the include_groups kwarg is noted in this Stack Overflow thread.