When I try to upload a project with the update=True flag, pepdbagent raises an AttributeError. I think I've confirmed that this occurs only if the project already exists.
Steps to reproduce:
Start with fresh database:
DROP TABLE projects;
SET client_encoding = 'LATIN1';
CREATE TABLE projects (
id BIGSERIAL NOT NULL,
namespace TEXT NOT NULL,
name TEXT NOT NULL,
tag TEXT NOT NULL,
digest TEXT NOT NULL, -- shoud be changed to CHARACTER
project_value jsonb NOT NULL,
anno_info jsonb, -- annotation information
CONSTRAINT id PRIMARY KEY (namespace, name, tag)
);
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File ".venv/lib/python3.9/site-packages/pepdbagent/pepdbagent.py", line 153, in upload_project
self.update_project(
File ".venv/lib/python3.9/site-packages/pepdbagent/pepdbagent.py", line 215, in update_project
proj_annot = Annotation().create_new_annotation(
File ".venv/lib/python3.9/site-packages/pepdbagent/pepannot.py", line 78, in create_new_annotation
for dict_key in anno_dict.keys():
AttributeError: 'str' object has no attribute 'keys'
When I try to upload a project with the
update=True
flag,pepdbagent
raises anAttributeError
. I think I've confirmed that this occurs only if the project already exists.Steps to reproduce:
SET client_encoding = 'LATIN1';
CREATE TABLE projects ( id BIGSERIAL NOT NULL, namespace TEXT NOT NULL, name TEXT NOT NULL, tag TEXT NOT NULL, digest TEXT NOT NULL, -- shoud be changed to CHARACTER project_value jsonb NOT NULL, anno_info jsonb, -- annotation information CONSTRAINT id PRIMARY KEY (namespace, name, tag) );
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in
File ".venv/lib/python3.9/site-packages/pepdbagent/pepdbagent.py", line 153, in upload_project
self.update_project(
File ".venv/lib/python3.9/site-packages/pepdbagent/pepdbagent.py", line 215, in update_project
proj_annot = Annotation().create_new_annotation(
File ".venv/lib/python3.9/site-packages/pepdbagent/pepannot.py", line 78, in create_new_annotation
for dict_key in anno_dict.keys():
AttributeError: 'str' object has no attribute 'keys'