InseeFrLab / pynsee

pynsee package contains tools to easily search and download french data from INSEE and IGN APIs
https://pynsee.readthedocs.io/en/latest/
MIT License
69 stars 10 forks source link

with pandas 2.0, append to dataframe has been removed, so pynsee needs a fix #177

Closed hadrilec closed 11 months ago

tfardet commented 11 months ago

@hadrilec where is the code located? (looking for all calls to append is a bit tedious 😅)

hadrilec commented 11 months ago

now that you ask, I dont find it anymore >< (checking from my phone), I will have a look from my PC tomorrow. It might be that the issue I had a quick look at is actually related to a different cause, sorry. In anycase, I have the feeling that some tests made with python 3.7 on the module localdata might need a change in order for the tests to pass, to be confirmed though.

tfardet commented 11 months ago

The localdata fails locally but it does not seem to be related to pandas (though there is one warning that should be fixed.

tests/localdata/test_pynsee_localdata.py::TestFunction::test_get_included_area
tests/localdata/test_pynsee_localdata.py::TestFunction::test_get_included_area
tests/localdata/test_pynsee_localdata.py::TestFunction::test_get_included_area
  /home/tfardet/Documents/GitWork/pynsee/tests/localdata/test_pynsee_localdata.py:449: DeprecationWarning: This function is deprecated.
  Please, use get_descending_area instead.
    data = get_included_area(area_type=a, codeareas=code)

tests/localdata/test_pynsee_localdata.py::TestFunction::test_get_local_data_1
tests/localdata/test_pynsee_localdata.py::TestFunction::test_get_local_data_all
tests/localdata/test_pynsee_localdata.py::TestFunction::test_get_local_data_all
  /home/tfardet/Documents/GitWork/pynsee/pynsee/localdata/get_local_data.py:138: 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.
    data_final = pd.concat(list_data_all).reset_index(drop=True)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================================= short test summary info ==============================================================================================
FAILED tests/localdata/test_pynsee_localdata.py::TestFunction::test_get_population - multiprocessing.pool.MaybeEncodingError: Error sending result: '<multiprocessing.pool.ExceptionWithTraceback object at 0x7f7df519b950>'. Reason: 'TypeError("cannot pickle 'SSLContext' object")'
============================================================================== 1 failed, 18 passed, 6 warnings in 1876.25s (0:31:16) ===============================================================================
hadrilec commented 11 months ago

issue should not have been raised, not relevant