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

[Processing] Various algorithms: "DeprecationWarning: QgsField constructor is deprecated" #57920

Closed
2 tasks done
agiudiceandrea opened this issue Jun 28, 2024 · 1 comment · Fixed by #58756
Closed
2 tasks done
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@agiudiceandrea
Copy link
Member

agiudiceandrea commented Jun 28, 2024

What is the bug or the crash?

The following warning are printed in the "Python warning" tab of the Log Messages panel when the "Check validity" (qgis:checkvalidity) processing algorithm (and probably many other ones) is executed:

2024-06-28T08:49:49     WARNING    warning:C:\OSF9FA~1/apps/qgis/./python/plugins\processing\algs\qgis\CheckValidity.py:137: DeprecationWarning: QgsField constructor is deprecated
              invalid_fields.append(QgsField('_errors', QVariant.String, 'string', 255))
             
             traceback: File "C:\OSF9FA~1/apps/qgis/./python/plugins\processing\algs\qgis\CheckValidity.py", line 122, in processAlgorithm
              return self.doCheck(
              File "C:\OSF9FA~1/apps/qgis/./python/plugins\processing\algs\qgis\CheckValidity.py", line 137, in doCheck
              invalid_fields.append(QgsField('_errors', QVariant.String, 'string', 255))
             
2024-06-28T08:49:49     WARNING    warning:C:\OSF9FA~1/apps/qgis/./python/plugins\processing\algs\qgis\CheckValidity.py:143: DeprecationWarning: QgsField constructor is deprecated
              error_fields.append(QgsField('message', QVariant.String, 'string', 255))
             
             traceback: File "C:\OSF9FA~1/apps/qgis/./python/plugins\processing\algs\qgis\CheckValidity.py", line 122, in processAlgorithm
              return self.doCheck(
              File "C:\OSF9FA~1/apps/qgis/./python/plugins\processing\algs\qgis\CheckValidity.py", line 143, in doCheck
              error_fields.append(QgsField('message', QVariant.String, 'string', 255))

Steps to reproduce the issue

  1. execute the "Check validity" processing algorithm

Versions

QGIS version
3.38.0-Grenoble
QGIS code revision
37aa618
Qt version
5.15.13
Python version
3.12.4
GDAL/OGR version
3.9.0
PROJ version
9.4.0
EPSG Registry database version
v11.004 (2024-02-24)
GEOS version
3.12.2-CAPI-1.18.2
SQLite version
3.45.1
PDAL version
2.6.3
PostgreSQL client version
16.2
SpatiaLite version
5.1.0
QWT version
6.2.0
QScintilla2 version
2.14.1
OS version
Windows 10 Version 1903

Active Python plugins
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

Related to #57272.

@agiudiceandrea agiudiceandrea added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels Jun 28, 2024
@agiudiceandrea agiudiceandrea changed the title [Processing] Check validity: "DeprecationWarning: QgsField constructor is deprecated" [Processing] "Check validity" algorithm: "DeprecationWarning: QgsField constructor is deprecated" Jun 28, 2024
@agiudiceandrea agiudiceandrea changed the title [Processing] "Check validity" algorithm: "DeprecationWarning: QgsField constructor is deprecated" [Processing] Various algorithms: "DeprecationWarning: QgsField constructor is deprecated" Jun 28, 2024
@mbukowski
Copy link

I experienced very similar behaviour for instance when running qgis:exportaddgeometrycolumns algorithm
file: ./python/plugins\processing\algs\qgis\ExportGeometryInfo.py:106
file: ./python/plugins\processing\algs\qgis\ExportGeometryInfo.py:107

This piece of code is still using old QGSField constructor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
2 participants