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

fix: Log figure errors, don't show infinite spinner #1614

Merged
merged 6 commits into from
Nov 10, 2023

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Nov 2, 2023

  • Requires Core PR Add support for MultiXYErrorBarSeries, MultiOHLCSeries figures deephaven-core#4763
    • Also need to port that to Enterprise
  • Actually look at the errors reported by the figure, and log them so we have a clearer idea of what the issue is when plots are reported as not working
  • Also show the error message in the chart panel button bar. Clicking the button will display the full error message.
  • Don't show the spinner infinitely if there are no series to load

@mofojed mofojed requested a review from mattrunyon November 2, 2023 16:05
@mofojed mofojed self-assigned this Nov 2, 2023
Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Attention: 30 lines in your changes are missing coverage. Please review.

Comparison is base (52ba2cd) 46.63% compared to head (438ed4f) 46.60%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1614      +/-   ##
==========================================
- Coverage   46.63%   46.60%   -0.03%     
==========================================
  Files         591      592       +1     
  Lines       36406    36435      +29     
  Branches     9113     9120       +7     
==========================================
+ Hits        16979    16982       +3     
- Misses      19375    19401      +26     
  Partials       52       52              
Flag Coverage Δ
unit 46.60% <16.66%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
packages/chart/src/ChartTestUtils.ts 96.42% <100.00%> (+0.06%) ⬆️
packages/chart/src/DownsamplingError.ts 0.00% <0.00%> (ø)
packages/chart/src/ChartModel.ts 41.37% <33.33%> (-0.44%) ⬇️
packages/chart/src/FigureChartModel.ts 53.80% <50.00%> (-0.35%) ⬇️
packages/chart/src/Chart.tsx 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@mattrunyon mattrunyon left a comment

Choose a reason for hiding this comment

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

Need instructions on how to test this if I'm using the linked core PR

packages/chart/src/FigureChartModel.ts Outdated Show resolved Hide resolved
@mofojed
Copy link
Member Author

mofojed commented Nov 7, 2023

@mattrunyon updated so you can see the full error message from the UI:
image

@mofojed mofojed requested a review from mattrunyon November 7, 2023 21:07
@mofojed
Copy link
Member Author

mofojed commented Nov 7, 2023

Use the linked Core PR with Groovy, and test with this snippet:

import static io.deephaven.csv.CsvTools.readCsv
import static io.deephaven.api.agg.Aggregation.AggAvg

cryptoTrades = readCsv("https://media.githubusercontent.com/media/deephaven/examples/main/CryptoCurrencyHistory/CSV/CryptoTrades_20210922.csv")

agg_list = [
    AggLast("Close = Price"),\
    AggFirst("Open = Price"),\
    AggMax("High = Price"),\
    AggMin("Low = Price"),
]

btcBin = cryptoTrades.where(FilterOr.of(Filter.from("Instrument = `BTC/USD`", "Instrument = `ETH/USD`")))
    .update("TimestampBin = lowerBin(Timestamp, HOUR)")
tOHLC = btcBin.aggBy(agg_list, "Instrument", "TimestampBin")

plotByOHLC = ohlcPlotBy("Instrument", tOHLC, "TimestampBin", "Open", "High", "Low", "Close", "Instrument").show()

btcBin2 = cryptoTrades.where("Instrument in `BTC/USD`, `ETH/USD`")
    .update("TimestampBin = lowerBin(Timestamp, HOUR)")
tOHLC2 = btcBin2.aggBy(agg_list, "Instrument", "TimestampBin")

plotByOHLC2 = ohlcPlotBy("Instrument", tOHLC2, "TimestampBin", "Open", "High", "Low", "Close", "Instrument").show()

I then commented out the changes in FigureWidgetTranslator part from that linked PR so that same snippet produces a plot with an error, and the error appears correctly.

packages/chart/src/Chart.tsx Outdated Show resolved Hide resolved
packages/chart/src/FigureChartModel.ts Outdated Show resolved Hide resolved
mofojed and others added 6 commits November 10, 2023 10:07
- Log errors reported by the figure
- If the figure doesn't have any series, don't show the loading spinner infinitely. Just show the blank chart.
- Emit error from model so the UI can handle it
  - It just stops the loading spinner right now - we should look at displaying a toast later
- Clean up `updateGrid` calls
- Now the error appears as a button in the button bar
- Clicking the button will display the full error message
- Have it wired up to show the downsampling error message as well when that occurs
Co-authored-by: Matthew Runyon <mattrunyonstuff@gmail.com>
- chartTheme was null
@mofojed mofojed merged commit 75783d0 into deephaven:main Nov 10, 2023
5 checks passed
@mofojed mofojed deleted the read-plot-errors branch November 10, 2023 19:17
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants