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 import csv failing when file contains single quote #626

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

psvri
Copy link
Contributor

@psvri psvri commented Jan 7, 2025

While importing csv data with quotes, those lines were skipped. This code fixes it .

❯ cat .\testing\test_files\test.csv
1,2.0,"String'1"
3,4.0,"String2"

./target/debug/limbo.exe
Limbo v0.0.11
limbo> CREATE TABLE csv_table(c1 INT, c2 REAL, c3 String);
limbo> .import -v --csv ./testing/test_files/test.csv csv_table
Added 1 rows with 1 errors using 2 lines of input
limbo> select * from csv_table;
3|4.0|String2

With this pr

Limbo v0.0.11
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database
limbo> CREATE TABLE csv_table(c1 INT, c2 REAL, c3 String);
limbo>  .import -v --csv ./testing/test_files/test.csv csv_table
Added 2 rows with 0 errors using 2 lines of input
limbo> select * from csv_table;
1|2.0|String'1
3|4.0|String2

@psvri psvri changed the title Fix import csv failing when single quote is in string Fix import csv failing when file contains single quote Jan 7, 2025
@psvri
Copy link
Contributor Author

psvri commented Jan 7, 2025

The action needs to be rerun. Not sure why its failing when I didnt change that code.

@PThorpe92
Copy link
Contributor

The action needs to be rerun. Not sure why its failing when I didnt change that code.

Yeah I need to fix those tests as it seems they can occasionally fail in certain environments cuz it's comparing sub-milliseconds, not your fault 👍

penberg added a commit that referenced this pull request Jan 7, 2025
This PR fixes the issue with tests running on slow systems such as
github actions, where a couple `datetime` tests would be off by very
small margins and fail (e.g. #626)
![image](https://github.com/user-
attachments/assets/57d5a7bf-5acc-41f6-839b-034cab771dce)

Closes #627
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