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

chore: simplify the datagen API #2288

Merged
merged 1 commit into from
May 2, 2024

Conversation

westonpace
Copy link
Contributor

Very minor change but one that has been annoying me for a while. The datagen allows columns to be specified with or without a name ("without a name" means one is automatically generated based on the column index). If a name is specified it must be a String. The vast majority of usage does specify a name and provides it as a &str. As a result we have a lot of boilerplate Some("foo".to_string()) that I would like to avoid.

To generate a column without a name use the function anon_col.
When generating a column with a name the name is now provided as impl Into<String> instead of Option<String>.

@github-actions github-actions bot added the chore label May 2, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.86%. Comparing base (9ddcadd) to head (460ba3c).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2288   +/-   ##
=======================================
  Coverage   80.85%   80.86%           
=======================================
  Files         190      190           
  Lines       55907    55840   -67     
  Branches    55907    55840   -67     
=======================================
- Hits        45206    45157   -49     
+ Misses       8165     8164    -1     
+ Partials     2536     2519   -17     
Flag Coverage Δ
unittests 80.86% <100.00%> (+<0.01%) ⬆️

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

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

@westonpace westonpace merged commit be4110d into lancedb:main May 2, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants