techmatters / soil-id-algorithm

GNU Affero General Public License v3.0
1 stars 0 forks source link

FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated #125

Open paulschreiber opened 2 months ago

paulschreiber commented 2 months ago

Description

Fix the code causing this warning:

soil_id/tests/us/test_us.py::test_empty_rank
  /Users/paul/.dev/soil-id-algorithm/soil_id/utils.py:1012: FutureWarning: The behavior of DataFrame concatenation with 
empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when 
determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
    site_vars = pd.concat([p_slope, mucompdata[["compname", "slope_r", "elev_r"]]], axis=0)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html