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

Make @df support string column names #5033

Merged
merged 2 commits into from
Nov 25, 2024
Merged

Conversation

ron-wolf
Copy link
Contributor

Description

Add a special case to add_sym! to convert an AbstractString column name to a Symbol before adding it.

The old behavior would iterate over the string and try to add each character as a column name. This produced a stack overflow, since add_sym! had no special case for Char, resulting in indefinite recursion. More details in JuliaPlots/StatsPlots.jl#562.

Attribution

Things to consider

  • Does it work on log scales? -- Change only affects column names
  • Does it work in layouts? -- ''
  • Does it work in recipes? -- ''
  • Does it work with multiple series in one call? -- No new functions introduced
  • PR includes or updates tests? -- No changes to tests
  • PR includes or updates documentation? -- No changes to docs

Add a special case to `add_sym!` to convert an `AbstractString` column name to a `Symbol` before adding it.

The old behavior would iterate over the string and try to add each character as a column name. This produced a stack overflow, since `add_sym!` had no special case for `Char`, resulting in indefinite recursion.
Copy link

codecov bot commented Nov 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.40%. Comparing base (f017272) to head (56514c7).
Report is 1 commits behind head on v2.

Files with missing lines Patch % Lines
StatsPlots/src/df.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v2    #5033      +/-   ##
==========================================
- Coverage   78.41%   78.40%   -0.01%     
==========================================
  Files          78       78              
  Lines        8261     8262       +1     
==========================================
  Hits         6478     6478              
- Misses       1783     1784       +1     

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


🚨 Try these New Features:

@BeastyBlacksmith
Copy link
Member

Great, thanks!

@BeastyBlacksmith BeastyBlacksmith merged commit 0b9a176 into JuliaPlots:v2 Nov 25, 2024
9 of 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.

2 participants