Dependency versions
rpreen opened this issue · comments
The CI tools (including the tests) are run using the dependency versions from requirements.txt
so the pandas version we test against is 1.4.4. However, when running the tests with the latest pandas, the error below is generated. As a temporary solution, the setup.py
version has been set to ~=1.4.4
. We should either figure out how to change our code to be compatible with 2.1.0 or find out what the maximum version number is that acro works with to set the version number more loosely i.e., <=
.
The error with pandas==2.1.0
:
data = charity grant_type index year inc_activity inc_grants ... sh_assets_balance sh_income_assets sh_staff_a...0.391120 0.203788 3.242479 0.062849 0.308406 4.0
[918 rows x 44 columns]
acro = <acro.acro.ACRO object at 0x7fc3449b3340>
def test_finalise_json(data, acro):
"""Finalise json test."""
_ = acro.crosstab(data.year, data.grant_type)
acro.add_exception("output_0", "Let me have it")
# write JSON
result: Records = acro.finalise(PATH, "json")
# load JSON
loaded: Records = load_records(PATH)
orig = result.get_index(0)
read = loaded.get_index(0)
print("*****************************")
print(orig)
print("*****************************")
print(read)
print("*****************************")
# check equal
assert orig.uid == read.uid
assert orig.status == read.status
assert orig.output_type == read.output_type
assert orig.properties == read.properties
assert orig.sdc == read.sdc
assert orig.command == read.command
assert orig.summary == read.summary
assert orig.comments == read.comments
assert orig.timestamp == read.timestamp
> assert (orig.output[0].reset_index()).equals(read.output[0])
E assert False
E + where False = <bound method NDFrame.equals of grant_type year G N R R/G\n0 2010 15 59 71 NaN\n1 2011 ... 15 59 71 NaN\n3 2013 15 59 71 NaN\n4 2014 15 59 71 NaN\n5 2015 15 59 71 NaN>( year G N R R/G\n0 2010 15 59 71 NaN\n1 2011 15 59 71 NaN\n2 2012 15 59 71 NaN\n3 2013 15 59 71 NaN\n4 2014 15 59 71 NaN\n5 2015 15 59 71 NaN)
E + where <bound method NDFrame.equals of grant_type year G N R R/G\n0 2010 15 59 71 NaN\n1 2011 ... 15 59 71 NaN\n3 2013 15 59 71 NaN\n4 2014 15 59 71 NaN\n5 2015 15 59 71 NaN> = grant_type year G N R R/G\n0 2010 15 59 71 NaN\n1 2011 15 59 71 NaN\n2 2012 15 59 71 NaN\n3 2013 15 59 71 NaN\n4 2014 15 59 71 NaN\n5 2015 15 59 71 NaN.equals
E + where grant_type year G N R R/G\n0 2010 15 59 71 NaN\n1 2011 15 59 71 NaN\n2 2012 15 59 71 NaN\n3 2013 15 59 71 NaN\n4 2014 15 59 71 NaN\n5 2015 15 59 71 NaN = <bound method DataFrame.reset_index of grant_type G N R R/G\nyear \n2010 15 59 71 ...1 NaN\n2012 15 59 71 NaN\n2013 15 59 71 NaN\n2014 15 59 71 NaN\n2015 15 59 71 NaN>()
E + where <bound method DataFrame.reset_index of grant_type G N R R/G\nyear \n2010 15 59 71 ...1 NaN\n2012 15 59 71 NaN\n2013 15 59 71 NaN\n2014 15 59 71 NaN\n2015 15 59 71 NaN> = grant_type G N R R/G\nyear \n2010 15 59 71 NaN\n2011 15 59 71 NaN\n2012 15 59 71 NaN\n2013 15 59 71 NaN\n2014 15 59 71 NaN\n2015 15 59 71 NaN.reset_index
test/test_initial.py:318: AssertionError
I have added CI tests for Python versions 3.8, 3.9, 3.10, and 3.11 in #150 and #151 - These are set to run only on a push to main because it involves 12 tests (win, mac, linux).
Also, I have updated the pandas version to 1.5.0 because this has wheels available for all of the above mentioned Python versions and the tests all succeed, whereas with 1.4.4 there is no wheel available for Python 3.11
Putting this on hold for now because it is all affected by what dependencies aisdc inherits from tensorflow-privacy