Skip to content

Add csv-delimiter #19

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

Closed
wants to merge 3 commits into from
Closed

Add csv-delimiter #19

wants to merge 3 commits into from

Conversation

qdequele
Copy link
Member

@qdequele qdequele commented Sep 5, 2024

Pull Request

Related issue

Fixes #<issue_number>

What does this PR do?

  • ...

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@qdequele qdequele requested a review from Kerollmops September 5, 2024 15:12
@qdequele qdequele marked this pull request as draft September 5, 2024 15:12
@Kerollmops
Copy link
Member

Kerollmops commented Sep 6, 2024

Please only use the csv::ReaderBuilder, specify the delimiter and then .build() and that's it.

pub fn new(file: PathBuf, size: usize, delimiter: Option<char>) -> Result<Self> {
let mut reader_builder = ReaderBuilder::new();
if let Some(delim) = delimiter {
reader_builder.delimiter(delim as u8);
Copy link
Member

@Kerollmops Kerollmops Sep 5, 2024

Choose a reason for hiding this comment

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

Can you do a try_into instead? By using .context("your error") you can return an error for when a character cannot be represented as a single byte.

@Kerollmops Kerollmops closed this Sep 25, 2024
@Kerollmops Kerollmops deleted the small_updates branch September 25, 2024 18:47
@Kerollmops
Copy link
Member

Kerollmops commented Sep 25, 2024

I close this PR as I brought the support of CSV delimiters on main directly.

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