Bug#1053944: q2-types: test failure with pandas 2.1 (Was: Bug#1044068: q2templates: FTBFS with pandas 2.0)

2024-02-16 Thread Andreas Tille
Control: tags -1 help

Hi again,

thanks again for your great help.  I admit I need some help for q2-types as
well.  While log in the bug report vanished you will easily find things like

  TypeError: read_csv() got an unexpected keyword argument 'squeeze'

when trying to build the package.

I've found an issue at pandas upstream[1] which inspired me to the patch

--- a/q2_types/sample_data/tests/test_transformer.py
+++ b/q2_types/sample_data/tests/test_transformer.py
@@ -28,8 +28,8 @@ class TestTransformers(TestPluginBase):
 obs = transformer(exp)

 # Squeeze equals true to return series instead of dataframe
-obs = pd.read_csv(str(obs), sep='\t', header=0, index_col=0,
-  squeeze=True)
+obs = pd.read_csv(str(obs), sep='\t', header=0, index_col=0)
+obs.squeeze("columns")

 assert_series_equal(exp, obs)

which is obviously wrong since it leads to

# Squeeze equals true to return series instead of dataframe
obs = pd.read_csv(str(obs), sep='\t', header=0, index_col=0)
obs.squeeze("columns")

>   assert_series_equal(exp, obs)


Probably a better solution can be found at stackoverflow[2] to use
DataFrame.squeeze('columns') but I'm simply lacking an example how to use
this.

Finally this is not the only error and I would appreciate any helping hint
(patch?) to get the package ported to recent pandas.

Kind regards
Andreas.

[1] https://github.com/pandas-dev/pandas/issues/43242
[2] 
https://stackoverflow.com/questions/76684141/why-am-i-getting-an-error-when-using-squeeze-keyword-in-read-csv


Am Fri, Feb 16, 2024 at 10:48:59AM +0100 schrieb s3v:
> ...
> Kind Regards

-- 
http://fam-tille.de



Bug#1044068: q2templates: FTBFS with pandas 2.0

2024-02-16 Thread Andreas Tille
Hi,

thanks a lot for all your help!  I've just uploaded q2templates.  If you
have more hints to pandas2 related bugs these are very welcome.

Kind regards
Andreas.

Am Fri, Feb 16, 2024 at 02:29:15PM +0100 schrieb s3v:
> Hi,
> 
> sorry for writing again but, after removing override for auto_test in
> d/rules and s/python3/python3-all in d/control for Build-Depends,
> tests fail with Python 3.12:
> 
> dh_auto_clean
> I: pybuild base:305: python3.12 setup.py clean
> /build/q2templates-2023.9.0+ds/versioneer.py:422: SyntaxWarning: invalid 
> escape sequence '\s'
>   LONG_VERSION_PY['git'] = '''
> Traceback (most recent call last):
>   File "/build/q2templates-2023.9.0+ds/setup.py", line 14, in 
>     version=versioneer.get_version(),
>     
>   File "/build/q2templates-2023.9.0+ds/versioneer.py", line 1481, in 
> get_version
>     return get_versions()["version"]
>    ^^
>   File "/build/q2templates-2023.9.0+ds/versioneer.py", line 1413, in 
> get_versions
>     cfg = get_config_from_root(root)
>   ^^
>   File "/build/q2templates-2023.9.0+ds/versioneer.py", line 343, in 
> get_config_from_root
>     parser = configparser.SafeConfigParser()
>  ^
> AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. 
> Did you mean: 'RawConfigParser'?
> E: pybuild pybuild:391: clean: plugin distutils failed with: exit code=1: 
> python3.12 setup.py clean
> 
> Kind Regards
> 
> ___
> Debian-med-packaging mailing list
> debian-med-packag...@alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-packaging

-- 
http://fam-tille.de



Bug#1044068: q2templates: FTBFS with pandas 2.0

2024-02-16 Thread s3v
Hi,

sorry for writing again but, after removing override for auto_test in
d/rules and s/python3/python3-all in d/control for Build-Depends,
tests fail with Python 3.12:

dh_auto_clean
I: pybuild base:305: python3.12 setup.py clean
/build/q2templates-2023.9.0+ds/versioneer.py:422: SyntaxWarning: invalid escape 
sequence '\s'
  LONG_VERSION_PY['git'] = '''
Traceback (most recent call last):
  File "/build/q2templates-2023.9.0+ds/setup.py", line 14, in 
    version=versioneer.get_version(),
    
  File "/build/q2templates-2023.9.0+ds/versioneer.py", line 1481, in get_version
    return get_versions()["version"]
   ^^
  File "/build/q2templates-2023.9.0+ds/versioneer.py", line 1413, in 
get_versions
    cfg = get_config_from_root(root)
  ^^
  File "/build/q2templates-2023.9.0+ds/versioneer.py", line 343, in 
get_config_from_root
    parser = configparser.SafeConfigParser()
 ^
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did 
you mean: 'RawConfigParser'?
E: pybuild pybuild:391: clean: plugin distutils failed with: exit code=1: 
python3.12 setup.py clean

Kind Regards



Bug#1044068: q2templates: FTBFS with pandas 2.0

2024-02-16 Thread s3v
Dear Maintainer,

According to [1][2]|

 Support for negative integer for :attr:`pd.options.display.max_colwidth`
 is deprecated in favor of using ``None`` (:issue:`31532`)|

I guess this line:

 with pd.option_context('display.max_colwidth', -1):

should be changed in:

 with pd.option_context('display.max_colwidth', None):

in [3].

I've not tested #1053942[4] disappears after this bug is fixed.

Kind Regards
 
[1] https://github.com/pandas-dev/pandas/pull/31569
[2] 
https://sources.debian.org/src/pandas/2.1.4%2Bdfsg-4/doc/source/whatsnew/v1.0.1.rst/#L46
[3] 
https://sources.debian.org/src/q2templates/2023.9.0%2Bds-1/q2templates/util.py/#L46
[4] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053942



Bug#1044068: q2templates: FTBFS with pandas 2.0

2024-02-04 Thread Andreas Tille
Hi Rebecca,

I've checked several Debian Med packages for your assumption that
replacing pandas.util.testing might help but non of the candidates
I've checked was caused by this.  I'm rather seeing quite strange
errors like in the case of q2templates here in Salsa CI

   https://salsa.debian.org/med-team/q2templates/-/jobs/5247852

Do you have any hint how to fix this?

Kind regards

 Andreas.

-- 
http://fam-tille.de



Bug#1044068: q2templates: FTBFS with pandas 2.0

2023-08-13 Thread Rebecca N. Palmer

Package: src:q2templates
Version: 2022.11.1+ds-2
Control: block 1043240 by -1

q2templates fails to build with pandas 2.0, currently in experimental.

Build log:
https://launchpadlibrarian.net/680701792/buildlog_ubuntu-mantic-amd64.q2templates_2022.11.1+ds-2_BUILDING.txt.gz

Autopkgtest log:
https://ci.debian.net/data/autopkgtest/unstable/amd64/q/q2templates/36575889/log.gz

A common source of failures is that pandas.util.testing has been renamed 
to pandas.testing.  Both names were available in all 1.x versions (and 
hence in Debian stable and oldstable), so Debian packages that were 
using this can immediately switch unconditionally.