Skip to content

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

@pwwang

Description

@pwwang

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 and jupyter notebook are 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    raw python replIssues with piping syntax in raw python REPL

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions