Red Hat Bugzilla – Bug 979277
[RFE] Specify the formatting requirements for the CSV file so that Beaker can successfully import the data
Last modified: 2015-07-26 18:15:24 EDT
Created attachment 766430 [details]
screenshot for comment0
Description of problem:
can't import CSV
Version-Release number of selected component (if applicable):
beaker-devel Version - 0.13.1
Steps to Reproduce:
2. browse one CSV(have attached)
3. click import.
always return 'Missing csv_type from record' in error log, but it was in the CSV.
can import CSV.
the example CSV attached.
The attachment seems to be a tab separated values. Beaker supports comma separated values.
(In reply to Raymond Mancy from comment #1)
> The attachment seems to be a tab separated values. Beaker supports comma
> separated values.
the attachment file was exported by Beaker, so it should be imported to Beaker too.
Can you please describe how you exported the CSV containing tabs as separators? Beaker is configured to produce the Python standard CSV dialect on output and expect it on input, and this is not it.
(In reply to Dan Callaghan from comment #4)
> Can you please describe how you exported the CSV containing tabs as
> separators? Beaker is configured to produce the Python standard CSV dialect
> on output and expect it on input, and this is not it.
I see the problem:
steps for explaining:
1. Admin->Export, export one file, such as user_group.csv.
2. open user_group.csv via LibreOffice calc, a window pop up to set the parameters, including the *Separator options*, and we must only check *Comma* here.
3. add some user and group in this file, then import.
the point is step2, in comment0, I didn't know that we must only check *Comma* in *Separator options* section, so maybe it contained 'tab' in front of 'Comma' by default, then I met the error message that confused me.
now I know how to import. I'd like to change this bug to an RFE to add some text on web UI for indicating this requirement of the csv file when imported.
Is it sufficient to document this in the (going to be written) admin guide or do we also need a hint in the Web UI ?
(In reply to Amit Saha from comment #6)
> Is it sufficient to document this in the (going to be written) admin guide
> or do we also need a hint in the Web UI ?
Maybe the web UI could have a reference to the docs, just so that users realise that "CSV import" doesn't mean it will magically accept CSV in any of its weird and wonderful forms. I don't think it is worth trying to describe the exact CSV format there in the web UI though.
Created attachment 847549 [details]
attached csv files with quotes
(In reply to wangjing from comment #10)
> 2. checking the links on the CSV import/export page-->fail.
> 1)visit page: Admin->Import(Export)
> 2)check the links refer to the docs.
> Actual results:
> sometimes displaying correctly like:
> 'Refer to the documentation to learn more about the exported data.'
> 'Refer to the documentation for details about the supported CSV format.'
> but sometimes nothing above displaying on web, such as freshing the page.
> Expected results:
> hope the link to the docs provided on the CSV import page and export page
> are displayed stably.
(In reply to wangjing from comment #21)
> tested on
> 1. checking the
> questions need to confirm:
> 1) the doc was not added what we talked in scrum meeting(complete CSV
> examples in comment14) temporarily?
> 2) seems importing field value: "wj test,"""csv""" ""wjabc""""" was not
> correct, it can be imported and result is: wj test,"csv""" ""wjabc"""""
> based on comment16, suppose odd number quotes won't be imported.
That is Python's CSV module behaviour from what I can see which is what Beaker's import feature also uses.
Using your example from comment 16 (wj test,"csv" "c"""""""). The output for this is:
wj test,"csv" "c"""""""
Which is what you get as well.
based on the discussions in comment21-26,
verified on beaker-devel(beaker-server-0.15.3-0.git.18.2d0d7d8.el6eng.noarch)-->pass
1. checking the doc(http://beaker-project.org/docs-release-0.15/admin-guide/interface.html#import)-->pass
2. checking the links on the CSV import/export page-->pass
the question of importing invalid odd number quotes was filed a low bug 1052012 for tracking.
This change is included in the Beaker 0.15.3 maintenance release: