[dataflowengineoss] handle python imports in globalFromLiteral #4576
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Noticed a regression after #4559, in which flows from imported members would not longer propagate, e.g.
At play is the representation of
import
statements, which look likeFOOBAR = import("models", "FOOBAR")
.Prior to #4559,
globalFromLiteral
would yieldFOOBAR
in the aforementioned import statement, since it would recursively look for literals in assignments. That wasn't bullet-proof because then inx = foo(20)
we would also yieldx
, leading to an extra (incorrect) data-flow from20
tox
(see #4549.)In #4559, we changed that to only look for literals as the proper RHS of assignments, which then misses this particular representation of import statements.
So in this patch we extend
globalFromLiteral
to also account for literals found insideimport
statements.