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

PipeableCallCheckWarning: Failed to detect AST node calling xxx, assuming a normal call #206

Open
pwwang opened this issue Feb 26, 2024 · 0 comments
Labels
raw python repl Issues with piping syntax in raw python REPL

Comments

@pwwang
Copy link
Owner

pwwang commented Feb 26, 2024

If you see this warning and the errors caused by it, please ensure you are running your code in the environment where the source code is available at runtime.

Typical environment where the source code is not available at runtime:

  • Raw Python REPL (type python from command line and run your code there)
  • exec()

If you want to use a Python REPL to run your code, ipython, bpython are jupyter notebook recommended.

If you can't avoid using exec(), use exec_code() from varname.helpers instead.

What if I want to use Raw Python REPL or exec() anyway? The idea is to tell datar if you are using "piping" or "normal" calling for the function. You can choose either way:

  • Set ast_fallback for a function
  • Pass __ast_fallback to a function call
from datar.all import f, select
from datar.data import iris

iris >> select(f.Species)  # warning

select.ast_fallback = "piping"
iris >> select(f.Species)  # ok
# but if you call it "normally"
select(iris, f.Species)  # Unevaluated `VerbCall object`

# or you can pass `__ast_fallback`
iris >> select(f.Species, __ast_fallback="piping")  # ok
select(iris, f.Species, __ast_fallback="normal")  # ok

Please also refer to:

@pwwang pwwang added the raw python repl Issues with piping syntax in raw python REPL label Feb 26, 2024
@pwwang pwwang pinned this issue Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
raw python repl Issues with piping syntax in raw python REPL
Projects
None yet
Development

No branches or pull requests

1 participant