Skip to content

Python: Hide ModuleVariableNode in data-flow paths #12937

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

Merged
merged 4 commits into from
May 3, 2023

Conversation

RasmusWL
Copy link
Member

They just add an extra step, and don't actually contribute any good information for end-users.

(also fixed their .toString() implementation)

This will generate a lot of changes in .expected files, which I will fix up once tests have indicated which ones :D

In some cases mod.getName() does not have a result, so toString of
ModuleVariableNode would also not have a result, which would cause
data-flow paths that use these as an edge to not be valid :O
They just add an extra step, and don't actually contribute any good
information for end-users.
@RasmusWL RasmusWL marked this pull request as ready for review April 30, 2023 12:50
@RasmusWL RasmusWL requested a review from a team as a code owner April 30, 2023 12:50
@RasmusWL RasmusWL added the no-change-note-required This PR does not need a change note label Apr 30, 2023
@calumgrant calumgrant requested a review from yoff May 2, 2023 09:08
Copy link
Contributor

@yoff yoff left a comment

Choose a reason for hiding this comment

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

I wonder if, had you not changed the format of ModuleVariableNode.toString, it had been obvious which paths we used to miss?

@RasmusWL
Copy link
Member Author

RasmusWL commented May 2, 2023

I wonder if, had you not changed the format of ModuleVariableNode.toString, it had been obvious which paths we used to miss?

With the way our tests are set up, I don't think we used to miss any paths in our tests (only when files were extracted as script).

@RasmusWL RasmusWL requested a review from yoff May 2, 2023 11:20
@RasmusWL
Copy link
Member Author

RasmusWL commented May 2, 2023

(but agreed it would have been cleaner to accept test changes for each commit individually)

@yoff
Copy link
Contributor

yoff commented May 3, 2023

I wonder if, had you not changed the format of ModuleVariableNode.toString, it had been obvious which paths we used to miss?

With the way our tests are set up, I don't think we used to miss any paths in our tests (only when files were extracted as script).

In that case, it would make no difference..

Copy link
Contributor

@yoff yoff left a comment

Choose a reason for hiding this comment

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

LGTM

@yoff yoff merged commit a905917 into github:main May 3, 2023
@RasmusWL RasmusWL deleted the fix-module-variable-node branch May 3, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants