[COMPASS-5373] Import ignores first column type when CSV file contains BOM Created: 17/Dec/21  Updated: 29/Oct/23  Resolved: 18/Feb/22

Status: Closed
Project: Compass
Component/s: Import/Export
Affects Version/s: 1.29.5
Fix Version/s: 1.31.0

Type: Bug Priority: Minor - P4
Reporter: Ilias Addab Assignee: Alena Khineika
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac os 10.15.5


Attachments: PNG File Schermafbeelding 2021-12-17 om 09.48.41.png     File testimport.csv    
Story Points: 2
Documentation Changes: Not Needed
Sprint: Iteration Seoul, Iteration Versailles

 Description   

Problem Statement/Rationale

When importing a csv file, the first column type setting(e.g. Number) gets ignored, and becomes a String anyways.

Steps to Reproduce

Import a CSV, select the first column as Number.

Expected Results

Get Number type

Actual Results

Gets String

 



 Comments   
Comment by Githook User [ 25/Feb/22 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: fix: import ignores first column type when CSV file contains BOM COMPASS-5373 (#2804)
Branch: 1.31-releases
https://github.com/mongodb-js/compass/commit/cc55c886d232ec67a5a008dd8dd435b251483475

Comment by Githook User [ 23/Feb/22 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: fix: import ignores first column type when CSV file contains BOM COMPASS-5373 (#2804)
Branch: COMPASS-5506-update-item
https://github.com/mongodb-js/compass/commit/cc55c886d232ec67a5a008dd8dd435b251483475

Comment by Githook User [ 22/Feb/22 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: fix: import ignores first column type when CSV file contains BOM COMPASS-5373 (#2804)
Branch: move-query-history-to-left-of-query-bar
https://github.com/mongodb-js/compass/commit/cc55c886d232ec67a5a008dd8dd435b251483475

Comment by Githook User [ 22/Feb/22 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: fix: import ignores first column type when CSV file contains BOM COMPASS-5373 (#2804)
Branch: remove-bootstrap
https://github.com/mongodb-js/compass/commit/cc55c886d232ec67a5a008dd8dd435b251483475

Comment by Githook User [ 21/Feb/22 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: fix: import ignores first column type when CSV file contains BOM COMPASS-5373 (#2804)
Branch: e2e-aggregations
https://github.com/mongodb-js/compass/commit/cc55c886d232ec67a5a008dd8dd435b251483475

Comment by Githook User [ 20/Feb/22 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: fix: import ignores first column type when CSV file contains BOM COMPASS-5373 (#2804)
Branch: make-radio-group-with-label
https://github.com/mongodb-js/compass/commit/cc55c886d232ec67a5a008dd8dd435b251483475

Comment by Githook User [ 18/Feb/22 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: fix: import ignores first column type when CSV file contains BOM COMPASS-5373 (#2804)
Branch: main
https://github.com/mongodb-js/compass/commit/cc55c886d232ec67a5a008dd8dd435b251483475

Comment by Githook User [ 18/Feb/22 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: fix: import ignores first column type when CSV file contains BOM COMPASS-5373
Branch: COMPASS-5373-fix-import-csv-with-bom
https://github.com/mongodb-js/compass/commit/2d964ec26ef22d2f2c44742e1169135087b37b5d

Comment by Ilias Addab [ 17/Dec/21 ]

Thank you for your work.
Ps The tool i'm using is Excel.

Comment by Anna Henningsen [ 17/Dec/21 ]

iliasaddab@gmail.com Thank you for the reproduction!

This bug is occurring because the .csv file in question is stored with a Unicode Byte Order Mark (BOM). Many CSV export tools will allow you to specify whether to include a BOM in the output file, and so excluding it should be a reasonable workaround for this issue. If your tool does not allow this, most plain text editor will also allow you to remove a BOM after the CSV is already exported.

That being said, this is still a bug that we will address. Thank you for bringing it up.

Comment by Ilias Addab [ 17/Dec/21 ]

testimport.csv.

Thank you.

Comment by Anna Henningsen [ 17/Dec/21 ]

iliasaddab@gmail.com Thanks for opening this ticket! I tried to reproduce this but couldn’t do so locally, can you maybe share a simple CSV file with which this happens?

Generated at Wed Feb 07 22:39:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.