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: better error for list data fmt_nanoplot #356

Merged

Conversation

marcozzxx810
Copy link
Contributor

@marcozzxx810 marcozzxx810 commented May 20, 2024

Summary

add a type check for data column, so that only scalar value is passed.

will add a pytest but want to make sure this is expected.

Related GitHub Issues and PRs

Checklist

@marcozzxx810 marcozzxx810 marked this pull request as draft May 20, 2024 15:19
@machow
Copy link
Collaborator

machow commented May 22, 2024

Hey, thanks for taking this up! It seems like the challenge in #331 might be:

  • fmt_nanoplot current accepts two plot types: line, bar
  • these types work with scalars. E.g. bar produces a single sideways bar.
  • however, invalid plot_types seem to be allowed through. For examples bars (or maybe even barsabcdefg) don't raise an error :/.

I wonder if just validating that plot_type is in the list of plot_type options would be enough to resolve the issue? I'm happy to take it up, or if you want to take a swing at it, I'm happy to review!

@marcozzxx810
Copy link
Contributor Author

Hi @machow , thank you for the guidelines. I think it is clear for me now.

I will change it and add a testcase for it

@marcozzxx810 marcozzxx810 marked this pull request as ready for review May 23, 2024 14:40
@marcozzxx810
Copy link
Contributor Author

Hi @machow, I have updated the code but CI Test seems to failed in main as well.

It will be great that if you can let me know how to resolve.

@rich-iannone
Copy link
Member

I can reproduce this on my system after upgrading Polars to version 0.20.28.

@codecov-commenter
Copy link

codecov-commenter commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.91%. Comparing base (e3649d2) to head (2bbbd1a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #356   +/-   ##
=======================================
  Coverage   85.90%   85.91%           
=======================================
  Files          41       41           
  Lines        4328     4330    +2     
=======================================
+ Hits         3718     3720    +2     
  Misses        610      610           

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

Copy link
Collaborator

@machow machow left a comment

Choose a reason for hiding this comment

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

This looks great, thanks so much for submitting this PR! These kinds of warnings seem really important for avoiding surprising issues due to typos. This LGTM -- Rich do you want to merge?

@rich-iannone rich-iannone merged commit 23704ee into posit-dev:main May 29, 2024
11 checks passed
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.

4 participants