gusbacos / suews_database_manager

suews_database_manager
1 stars 0 forks source link

Adding New Referenvces #10

Closed gusbacos closed 2 months ago

gusbacos commented 2 months ago

Error when adding new references in DB

An error has occurred while executing Python code:

KeyError: "['authorYear'] not found in axis" Traceback (most recent call last): File "C:\Users/xbacos/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\suews_database_manager\utilities\references.py", line 111, in add_ref save_to_db(db_path, db_dict) File "C:\Users/xbacos/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\suews_database_manager\utilities\database_functions.py", line 82, in save_to_db db_dict[col] = db_dict[col].drop(columns = 'authorYear') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pandas\core\frame.py", line 5581, in drop return super().drop( ^^^^^^^^^^^^^ File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pandas\core\generic.py", line 4788, in drop obj = obj._drop_axis(labels, axis, level=level, errors=errors) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pandas\core\generic.py", line 4830, in _drop_axis new_axis = axis.drop(labels, errors=errors) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pandas\core\indexes\base.py", line 7070, in drop raise KeyError(f"{labels[mask].tolist()} not found in axis") KeyError: "['authorYear'] not found in axis"

Python version: 3.12.5 (main, Aug 8 2024, 11:21:54) [MSC v.1938 64 bit (AMD64)] QGIS version: 3.38.2-Grenoble Grenoble, 130c432394

gusbacos commented 2 months ago

Fixed. Also Added DOI