Coder Social home page Coder Social logo

Comments (3)

mkoohafkan avatar mkoohafkan commented on May 28, 2024

This seems to be caused by the setting r.session.watchGlobalEnvironment. Setting this to false results in import("re", delay_load = TRUE) working as expected. It also resolved the continuous error throw issue in my last paragraph.

It seems that the session watcher is not working quite right with reticulate connections to Python modules and objects.

from vscode-r.

mkoohafkan avatar mkoohafkan commented on May 28, 2024

The issue is encountered in the VSCode-R session watcher function, and specifically this line triggers the evaluation. This code gets evaluated because is_promise() and is_active() both return FALSE for a delayed-load module (and thus the "else" part of the if-else statement is evaluated).

Perhaps the most straightforward solution is to add a condition in inspect_env()for checking if the object is a python.builtin.module and/or python.builtin.object object, and if so to avoid inspecting it.

from vscode-r.

ElianHugh avatar ElianHugh commented on May 28, 2024

Thanks for the detailed writeup @mkoohafkan.

Your solution definitely works, and I'm happy to write a PR soon to remedy this. It would be nice to have non-delayed modules still be evaluated, but I haven't found a way of inspecting that from within R.

from vscode-r.

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.