names: add internal id to identify the names #1717
Annotations
10 errors
Run tests:
tests/contrib/names/test_names_datastreams.py#L418
test_names_service_writer_update_existing
invenio_vocabularies.datastreams.errors.WriterError: [{'ValidationError': {'internal_id': ['Field may not be null.']}}]
|
Run tests:
tests/contrib/names/test_names_service.py#L57
test_simple_flow
marshmallow.exceptions.ValidationError: {'internal_id': ['Field may not be null.']}
|
Run tests:
invenio_vocabularies/alembic/3ba812d80559_add_internal_name_id.py#L1
pydocstyle-check
/home/runner/work/invenio-vocabularies/invenio-vocabularies/invenio_vocabularies/alembic/3ba812d80559_add_internal_name_id.py:8 at module level:
D400: First line should end with a period (not 'D')
|
Run tests:
invenio_vocabularies/alembic/3ba812d80559_add_internal_name_id.py#L1
Black format check
--- /home/runner/work/invenio-vocabularies/invenio-vocabularies/invenio_vocabularies/alembic/3ba812d80559_add_internal_name_id.py 2024-12-12 09:49:38.682266+00:00
+++ /home/runner/work/invenio-vocabularies/invenio-vocabularies/invenio_vocabularies/alembic/3ba812d80559_add_internal_name_id.py 2024-12-12 09:54:24.849810+00:00
@@ -10,21 +10,27 @@
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
-revision = '3ba812d80559'
-down_revision = '55a700f897b6'
+revision = "3ba812d80559"
+down_revision = "55a700f897b6"
branch_labels = ()
depends_on = None
def upgrade():
"""Upgrade database."""
- op.add_column('name_metadata', sa.Column('internal_id', sa.String(length=255), nullable=True))
- op.create_unique_constraint(op.f('uq_name_metadata_internal_id'), 'name_metadata', ['internal_id'])
+ op.add_column(
+ "name_metadata", sa.Column("internal_id", sa.String(length=255), nullable=True)
+ )
+ op.create_unique_constraint(
+ op.f("uq_name_metadata_internal_id"), "name_metadata", ["internal_id"]
+ )
def downgrade():
"""Downgrade database."""
- op.drop_constraint(op.f('uq_name_metadata_internal_id'), 'name_metadata', type_='unique')
- op.drop_column('name_metadata', 'internal_id')
+ op.drop_constraint(
+ op.f("uq_name_metadata_internal_id"), "name_metadata", type_="unique"
+ )
+ op.drop_column("name_metadata", "internal_id")
|
Run tests:
invenio_vocabularies/alembic/3ba812d80559_add_internal_name_id.py#L1
isort-check
"""Add internal name ID"""
+import sqlalchemy as sa
from alembic import op
-import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
|
Run tests:
invenio_vocabularies/contrib/names/components.py#L1
pydocstyle-check
/home/runner/work/invenio-vocabularies/invenio-vocabularies/invenio_vocabularies/contrib/names/components.py:1 at module level:
D100: Missing docstring in public module
|
Run tests:
invenio_vocabularies/contrib/names/components.py#L1
Black format check
--- /home/runner/work/invenio-vocabularies/invenio-vocabularies/invenio_vocabularies/contrib/names/components.py 2024-12-12 09:49:38.688265+00:00
+++ /home/runner/work/invenio-vocabularies/invenio-vocabularies/invenio_vocabularies/contrib/names/components.py 2024-12-12 09:54:46.080000+00:00
@@ -8,11 +8,8 @@
def create(self, identity, data=None, record=None, **kwargs):
"""Create handler."""
setattr(record, self.field, data.pop(self.field, None))
-
def update(self, identity, data=None, record=None, **kwargs):
"""Update handler."""
setattr(record, self.field, data.pop(self.field, None))
-
-
|
Run tests:
invenio_vocabularies/contrib/names/config.py#L1
isort-check
)
from werkzeug.local import LocalProxy
+from ...services.components import PIDComponent
from .components import InternalIDComponent
-from ...services.components import PIDComponent
names_schemes = LocalProxy(lambda: current_app.config["VOCABULARIES_NAMES_SCHEMES"])
|
Run tests:
invenio_vocabularies/contrib/names/names.py#L1
Black format check
--- /home/runner/work/invenio-vocabularies/invenio-vocabularies/invenio_vocabularies/contrib/names/names.py 2024-12-12 09:49:38.689265+00:00
+++ /home/runner/work/invenio-vocabularies/invenio-vocabularies/invenio_vocabularies/contrib/names/names.py 2024-12-12 09:54:47.570937+00:00
@@ -50,13 +50,11 @@
"internal_id": db.Column(db.String(255), unique=True, nullable=True),
},
schema_version="1.0.0",
schema_path="local://names/name-v1.0.0.json",
index_name="names-name-v2.0.0",
- record_cls_attrs={
- "internal_id": ModelField("internal_id", dump=False)
- },
+ record_cls_attrs={"internal_id": ModelField("internal_id", dump=False)},
record_relations=name_relations,
record_dumper=SearchDumper(
model_fields={"pid": ("id", str)},
extensions=[
RelationDumperExt("relations"),
|
Run tests:
invenio_vocabularies/contrib/names/names.py#L1
isort-check
from invenio_records.dumpers import SearchDumper
from invenio_records.dumpers.indexedat import IndexedAtDumperExt
from invenio_records.dumpers.relations import RelationDumperExt
-from invenio_records.systemfields import RelationsField, ModelField
+from invenio_records.systemfields import ModelField, RelationsField
from invenio_records_resources.factories.factory import RecordTypeFactory
from invenio_records_resources.records.systemfields import (
ModelPIDField,
|
Loading