-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
raw python replIssues with piping syntax in raw python REPLIssues with piping syntax in raw python REPL
Description
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:
- https://pwwang.github.io/pipda/piping/
- [BUG] warnings when using pipe #202
- [QST] Warning: PipeableCallCheckWarning: Failed to detect AST node calling
mutate
, assuming a piping call. #196 - warning #198
- Failed to detect AST nodes in Windows ipython for verb calls #170
- piping to verbs is not passing the dataframe argument #149
- dataframe to tibble #55
- pipe operator doesn't work in plain python prompt #45
GitHunter0
Metadata
Metadata
Assignees
Labels
raw python replIssues with piping syntax in raw python REPLIssues with piping syntax in raw python REPL