Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track/adjust for test failure with genno 1.23.0 #788

Closed
khaeru opened this issue Jan 29, 2024 · 5 comments · Fixed by #790
Closed

Track/adjust for test failure with genno 1.23.0 #788

khaeru opened this issue Jan 29, 2024 · 5 comments · Fixed by #790
Labels
bug Doesn't work as advertised/unintended effects

Comments

@khaeru
Copy link
Member

khaeru commented Jan 29, 2024

(Apparently) with genno 1.23.0, we see failures like this:

>       assert_qty_equal(obs, demand, check_attrs=False)

message_ix/tests/test_report.py:70: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

left = Index(['chicago', 'new-york', 'topeka'], dtype='object', name='n')
right = MultiIndex([( 'chicago',),
            ('new-york',),
            (  'topeka',)],
           names=['n'])
obj = 'Series.index'

    def _check_types(left, right, obj: str = "Index") -> None:
        if not exact:
            return
    
>       assert_class_equal(left, right, exact=exact, obj=obj)
E       AssertionError: Series.index are different
E       
E       Series.index classes are different
E       [left]:  Index(['chicago', 'new-york', 'topeka'], dtype='object', name='n')
E       [right]: MultiIndex([( 'chicago',),
E                   ('new-york',),
E                   (  'topeka',)],
E                  names=['n'])

This may actually be a regression in genno due to some housekeeping in khaeru/genno#115, that adapted AttrSeries.__init__ to address deprecation warnings with pandas 2.2. What appears to have happened is that the code now skips this block that ensures a pd.MultiIndex. So obs in this test, while functionally identical to demand, has a different index class and thus fails assert_qty_equal().

This fix is probably upstream, this is just to track.

@khaeru khaeru added the bug Doesn't work as advertised/unintended effects label Jan 29, 2024
@khaeru
Copy link
Member Author

khaeru commented Jan 29, 2024

@glatterf42 my preferred temporarily mitigation here would be to install genno<1.23 in the CI workflows.

@glatterf42
Copy link
Member

We currently have two failed tests, but when all tests first started failing, there was only one. This was on Saturday and I found these version changes:

  • dask 2024.1.0 -> 2024.1.1
  • genno 1.22.0 -> 1.23.0
  • coverage 7.4.0 -> 7.4.1

On Sunday, the second test failure was introduced when some additional dependency updates came along:

  • overrides 7.6.0 -> 7.7.0
  • pytest 7.4.4 -> 8.0.0

@glatterf42
Copy link
Member

The relevant changes in pytest might be detailed here: https://docs.pytest.org/en/stable/changelog.html#old-deprecations-are-now-errors

@glatterf42
Copy link
Member

Partially/temporarily addressed by #789.

@khaeru
Copy link
Member Author

khaeru commented Feb 1, 2024

This should be addressed in genno 1.23.1, just released.

@glatterf42 glatterf42 mentioned this issue Feb 5, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Doesn't work as advertised/unintended effects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants