posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.59k stars 79 forks source link

Data Explorer refresh only works when opened via the Variables pane. #2896

Closed jthomasmock closed 5 months ago

jthomasmock commented 6 months ago

Positron Version: 2024.04.0 (Universal) build 1548 Code - OSS Version: 1.88.0 Commit: c3cf4927abb9c88f74d82ebba07b683fc6d0e099 Date: 2024-04-25T03:28:24.588Z Electron: 28.2.8 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Darwin arm64 23.4.0

Steps to reproduce the issue:

  1. Create a minimal df in Python and assign it to an object so that it is available in the variables pane
import pandas as pd
# Dictionary of key pair values called data
data = {'Name':['Ashika', 'Tanu', 'Ashwin', 'Mohit', 'Sourabh'],
        'Age': [24, 23, 22, 19, 10]}
data
{'Age': [24, 23, 22, 19, 10],  'Name': ['Ashika', 'Tanu', 'Ashwin', 'Mohit', 'Sourabh']}
# Calling the pandas data frame method by passing the dictionary (data) as a parameter
df = pd.DataFrame(data)
df
  1. Use %view df to display the df in the Data Explorer
  2. Reassign a column to a different value
df["Age"] = [True, True, True, False, False]
  1. Note that the Data Explorer hasn't updated.

What did you expect to happen?

The Data Explorer should refresh for viewing objects in the environment, whether viewed via the variables pane or not.

Were there any error messages in the output or Developer Tools console?

jmcphers commented 6 months ago

FWIW I could not reproduce this with R. Here's the code I used, which drops a column from the frame and then changes all the values in another column.

df <- data.frame(a = c(1,2,3), b = c(4,5,6))
View(df)
df$a <- NULL
df$b <- c(8,9,10)
image
jthomasmock commented 6 months ago

@jmcphers -- I think you're right. I tried my reprex again for R and couldn't reproduce.

jthomasmock commented 5 months ago

Verified in build 1191

Image