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:
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:
pythonfrom command line and run your code there)exec()If you want to use a Python REPL to run your code,
ipython,bpythonandjupyter notebookare recommended.If you can't avoid using
exec(), useexec_code()fromvarname.helpersinstead.What if I want to use Raw Python REPL or
exec()anyway? The idea is to telldatarif you are using "piping" or "normal" calling for the function. You can choose either way:ast_fallbackfor a function__ast_fallbackto a function callPlease also refer to:
mutate, assuming a piping call. #196