Bug report #16133

Wrong default extension picked for table outputs

Added by matteo ghetta almost 3 years ago. Updated about 2 years ago.

Status:Closed
Priority:High
Assignee:Victor Olaya
Category:Processing/QGIS
Affected QGIS version:master Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:24045

Description

By default Processing assigns ".dbf" extension to table outputs, while actually it creates ".csv" files. This causes problem with loading output after algorithm execution. If output saved to the file with correct extension there are no error.

History

#1 Updated by Victor Olaya almost 3 years ago

Two questions:

Does the mentioned layer file exist and can be opened manually from QGIS?

Does this happen with other algorithms that generate tables?

It might be an error fo the algorithm itself, or a more generic thing affecting table outputs

#2 Updated by matteo ghetta almost 3 years ago

Does the mentioned layer file exist and can be opened manually from QGIS?

yes, they exist. In fact, I tried the algorithm with some custom test data of processing (points, polys) and other standard shapefiles with I can normally work (other algorithms works fine)

Does this happen with other algorithms that generate tables?

I guess you are right. The algorithm Statistics by categories gives the same error.

BTW: I tried the same algorithms in 2.18 (same input layer) and they work just fine

Can I help in other ways?

Thanks!

#3 Updated by Alexander Bruy almost 3 years ago

  • Subject changed from Processing Frequency Analysis fails to Wrong default extension picked for table outputs
  • Operating System deleted (Linux Mint)
  • OS version deleted (18)

Well, all algorithms that produce table output work like a charm.

They fail only if output saved to the temporary file. And fail because temporary file uses wrong extension by default: ".dbf" instead of ".csv".

#4 Updated by matteo ghetta over 2 years ago

Ok, I see that the algorithm works fine if the file is saved somewhere else.

But, how to deal with temporary tables? Should we not consider this a bug?

Thanks

#5 Updated by Giovanni Manghi over 2 years ago

  • Target version changed from Future Release - High Priority to Version 3.0
  • Priority changed from High to Severe/Regression

In master "statistics by category" does not work regardless if the output is temporary or if the user chooses a location on disk. The tool works fine on 2.18.4. Maybe other tools are affected on master(?).

2017-03-07T11:25:25 2 Error loading result layer:
Traceback (most recent call last):
File "C:/PROGRA~1/QGIS2~1.99/apps/qgis-dev/./python/plugins\\processing\\gui\\Postprocessing.py", line 75, in handleAlgorithmResults
out.name))
File "C:/PROGRA~1/QGIS2~1.99/apps/qgis-dev/./python/plugins\\processing\\tools\\dataobjects.py", line 223, in load
+ '\
Check the processing framework log to look for errors')
RuntimeError: Could not load layer: C:\\Users\\qgis\\AppData\\Local\\Temp\\processing9b7c26fa6fda4188a46f914f4dfd4639\\5f1c58d71ff441f68b534f00dbf467bd\\OUTPUT.dbf
Check the processing framework log to look for errors

2017-03-07T11:25:45 2 Error loading result layer:
Traceback (most recent call last):
File "C:/PROGRA~1/QGIS2~1.99/apps/qgis-dev/./python/plugins\\processing\\gui\\Postprocessing.py", line 75, in handleAlgorithmResults
out.name))
File "C:/PROGRA~1/QGIS2~1.99/apps/qgis-dev/./python/plugins\\processing\\tools\\dataobjects.py", line 223, in load
+ '\
Check the processing framework log to look for errors')
RuntimeError: Could not load layer: C:/Users/qgis/Desktop/dede.dbf
Check the processing framework log to look for errors

#6 Updated by Arnaud Morvan over 2 years ago

This seems to have been introduced by #dfb4cdd34b93d0d05ce94a842a4cf871c5a900fd
(changed default extension from .csv to .dbf in OutputTable class)

I also note this the TableWriter add a .csv extension if it is not there.

So the file is really created with .dbf.csv extension and the ouput value is not updated.

#7 Updated by Giovanni Manghi over 2 years ago

  • Regression? set to Yes

#8 Updated by Giovanni Manghi over 2 years ago

  • Priority changed from Severe/Regression to High

#9 Updated by Giovanni Manghi over 2 years ago

  • Easy fix? set to No

#10 Updated by Nyall Dawson about 2 years ago

  • Status changed from Open to Feedback

Should no longer be an issue on master - we now use proper layers instead of the old table outputs, so format/extension is any valid vector format.

#11 Updated by matteo ghetta about 2 years ago

Confirmed. I think we can close this issue. Thanks

#12 Updated by Nyall Dawson about 2 years ago

  • Resolution set to fixed/implemented
  • Status changed from Feedback to Closed

Also available in: Atom PDF