Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Surface python error in Problems tab and Editor #40

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Conversation

bmingles
Copy link
Collaborator

@bmingles bmingles commented Jul 16, 2024

Python server errors are now surfaced via the Problems tab and red squiggles in the editor.

image

Testing

  • Introduce a typo in a script (e.g. printx('some text'))
  • Run the whole file
  • Should see an error in the Problems tab + red squiggles on the offending line
  • Save. Errors should disappear
  • Select the line and "Run Deephaven Selected Lines"
  • Error should show again on correct line + Problems tab
  • Save. Errors should disappear

UPDATE: found out the running script isn't always the top-level error, so added handling for that. Example to test:

import sys; print(sys.version)

from deephaven import empty_table, time_table
from deephaven.plot import Figure

t1 = empty_table(10).update(["X = i", "Y = 10 * i"])
t2 = time_table("PT1s").update(["X = i%10", "Y = 10 * i"])

t3 = t1.natural_join(t2.last_by("X"), on="X", joins="YY=Y")

p1 = Figure().plot_xy("Plot 1", t1, x="X", y="Y").show()
p2 = Figure().plot_xy(t2, "X", "Y").show()

# p1 = Figure().plot_xy("Plot 1", t1, x="X", y="Y").show()
# p2 = Figure().plot_xy("Plot 2", t2, x="X", y="Y").show()


print("DH Rules")
print("DH Sucks")

resolves #39

@bmingles bmingles requested a review from mofojed July 16, 2024 16:00
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@bmingles bmingles merged commit b96e32a into main Jul 17, 2024
2 checks passed
@bmingles bmingles deleted the 39-diagnostics branch July 17, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose python code errors as diagnostics
2 participants