GithubHelp home page GithubHelp logo

Python exception types not displayed about knitr HOT 3 CLOSED

brry avatar brry commented on June 3, 2024
Python exception types not displayed

from knitr.

Comments (3)

brry avatar brry commented on June 3, 2024 2

Thanks for the backtick reference - I somehow missed that section. I fixed that above now.
Yes, the idea is to see ValueError: inside the document.
Oh, I should have thought of reticulate - that is indeed where the change is.
Version 1.28 still contained ValueError, Version 1.29 no longer does that. I will investigate and (hopefully^^) solve the issue there.

from knitr.

cderv avatar cderv commented on June 3, 2024 1

error = TRUE means to not let any error in the chunk to stop the knitting. (see doc at https://yihui.org/knitr/options/#text-output)

This is what I get in output
image

where I can see the error.

If set to FALSE then the error is thrown during knitting.

==> rmarkdown::render('C:/Users/chris/Documents/test.Rmd',  encoding = 'UTF-8');

  |....................................................| 100% [unnamed-chunk-1]

processing file: test.Rmd

Quitting from lines 9-11 [unnamed-chunk-1] (test.Rmd)
Error in `py_call_impl()`:
! ValueError: invalid literal for int() with base 10: 'charstring'
Run `reticulate::py_last_error()` for details.
Backtrace:
  1. rmarkdown::render("C:/Users/chris/Documents/test.Rmd", encoding = "UTF-8")
  2. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
  3. knitr:::process_file(text, output)
  8. knitr:::process_group.block(group)
  9. knitr:::call_block(x)
     ...
 13. knitr (local) engine(options)
 14. reticulate::eng_python(options)
 15. reticulate:::py_compile_eval(snippet, compile_mode)
 18. builtins$eval(compiled, globals, locals)
 19. reticulate:::py_call_impl(callable, call_args$unnamed, call_args$named)
                                                                                                            
Exécution arrêtée

So I guess you want to see ! ValueError: inside the document - is that right ?

This is using dev knitr and recent rmarkdown and reticulate packages

> packageVersion('reticulate')
[1] ‘1.34.0> packageVersion('knitr')
[1] ‘1.45.9> packageVersion('rmarkdown')
[1] ‘2.25

You'll have to add backticks for the chunk, I couldn't get the markdown preview to be right.

BTW about this, you can read how to in the guide : https://yihui.org/issue/#please-format-your-issue-correctly

from knitr.

cderv avatar cderv commented on June 3, 2024

python engine is handled by reticulate so I wonder if something has changed in there error handling maybe 🤔

from knitr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.