I am trying to polygonize a line vector layer using "Polygonize" QGIS Geoalgorithm tool in PyQGIS. The polygon geometries are created successfully from the line features. But attributes of the line layer are not adopted to the created polygon layer upon polygonization. However, I have managed to adopt the attribute table's column headers from the input line layer to the polygonized layer using this command.
How to transfer the attribute values of the input line layer to the created polygon layer during polygonization process using the 'Polygonize' tool?