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

[ci][tests][python] remove assertion for filename that is no longer true with new version of graphviz #4778

Merged
merged 1 commit into from
Nov 7, 2021

Conversation

StrikerRUS
Copy link
Collaborator

@StrikerRUS StrikerRUS commented Nov 7, 2021

New 0.18 version of graphviz was released about 7 hours ago: https://pypi.org/project/graphviz/#history.
In new version something was broken (I guess due to refactoring the internal class hierarchy) and default value for the filename argument was changed.

filename – Filename for saving the source (defaults to name + '.gv').
https://graphviz.readthedocs.io/en/stable/api.html#graphviz.Digraph

So our test started to fail with the following assertion error:

        graph.render(view=False)
        assert isinstance(graph, graphviz.Digraph)
        assert graph.name == 'Tree4'
>       assert graph.filename == 'Tree4.gv'
E       AssertionError: assert 'Digraph.gv' == 'Tree4.gv'
E         - Tree4.gv
E         + Digraph.gv

https://github.com/microsoft/LightGBM/runs/4131382043?check_suite_focus=true#step:5:1686

I suggest simply remove this assertion as it doesn't related to LightGBM API as we just pass kwargs to Digraph constructor as-is:

**kwargs
Other parameters passed to ``Digraph`` constructor.
Check https://graphviz.readthedocs.io/en/stable/api.html#digraph for the full list of supported parameters.

... <some calls of internal functions that don't modify kwargs in any way >
graph = Digraph(**kwargs)

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree! Thanks for investigating this.

@StrikerRUS StrikerRUS merged commit cebdc2a into master Nov 7, 2021
@StrikerRUS StrikerRUS deleted the fix_graphviz branch November 7, 2021 17:33
@StrikerRUS StrikerRUS mentioned this pull request Jan 6, 2022
13 tasks
@jameslamb jameslamb mentioned this pull request Oct 7, 2022
40 tasks
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants