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

Missing cases for importing scripts from package initialization code #210

Open
khatchad opened this issue Jul 22, 2024 · 0 comments · Fixed by ponder-lab/ML#122
Open

Missing cases for importing scripts from package initialization code #210

khatchad opened this issue Jul 22, 2024 · 0 comments · Fixed by ponder-lab/ML#122
Labels
enhancement New feature or request help wanted Extra attention is needed PYTHONPATH

Comments

@khatchad
Copy link
Collaborator

We're missing some cases from #202 where we import scripts containing package initialization code that involve the syntax import A.B.C. It looks like we covered from A.B import C. Consider the following example:

# src/__init__.py
from .module import *

# src/module.py
import tensorflow as tf

def f(a):
    assert isinstance(a, tf.Tensor)

# client.py
from tensorflow import ones
import src

src.f(ones([1, 2]))

We cannot find a CG node for src.module.f. If we change the wildcard in src/__init__.py to explicitly reference f, it still doesn't work.

Regression

I don't think this is a bug. I think we just only handled the wildcard import case in the client.

@khatchad khatchad added enhancement New feature or request help wanted Extra attention is needed PYTHONPATH labels Jul 22, 2024
khatchad added a commit to ponder-lab/ML that referenced this issue Jul 22, 2024
@khatchad khatchad linked a pull request Jul 22, 2024 that will close this issue
khatchad added a commit to ponder-lab/ML that referenced this issue Jul 22, 2024
…ng-scripts-from-package-initialization-code

Add tests for wala#210.
@khatchad khatchad reopened this Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed PYTHONPATH
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant