welearn-database 1.4.4__tar.gz → 1.4.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {welearn_database-1.4.4 → welearn_database-1.4.5}/PKG-INFO +1 -1
- {welearn_database-1.4.4 → welearn_database-1.4.5}/pyproject.toml +1 -1
- welearn_database-1.4.5/welearn_database/alembic/versions/8b780aea403a_add_university_data.py +44 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/models/document_related.py +0 -1
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/models/user_related.py +2 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/exceptions.py +20 -3
- {welearn_database-1.4.4 → welearn_database-1.4.5}/LICENSE +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/README.md +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/__init__.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/README +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/env.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/script.py.mako +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/068312e7800c_add_referrer_origin_column_to_user_and_.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/0e0bc0fca384_doc_qty_per_source.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/16ff997426d3_remove_error_retrieval_unique_constraint.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/2ad4895b2674_data_collection.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/4c7161819e5a_grafana_views.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/4f5a188dd614_add_main_url_column.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/4fcbfb7f3145_added_api_key_management_table.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/5d82613c9aca_context_document.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/821173cf9c5d_initial_migration.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/84c42739c17b_create_table_errordataquality.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/89920abb7ff8_add_category.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/96bba9e4842a_merge_external_id_error_quality.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/9b4f1da0c1f2_data_collection_for_focus_group.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/a50a1db3ca2a_add_used_since_column_for_embeddings.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/b031206324b7_agent_related.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/b049924f7067_modify_corpus_name_embedding_model_lang_.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/ccdbd708c997_create_column_external_id.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/e354666f951d_inferred_user.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/f1ce0ad2845b_add_doi_column_to_document.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/alembic/versions/f8602200fa99_update_session_view.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/__init__.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/enumeration.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/models/__init__.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/models/agent_related.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/models/corpus_related.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/models/grafana.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/database_utils.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/modules/__init__.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/modules/text_cleaning.py +0 -0
- {welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/regular_expression.py +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""add_university_data
|
|
2
|
+
|
|
3
|
+
Revision ID: 8b780aea403a
|
|
4
|
+
Revises: f1ce0ad2845b
|
|
5
|
+
Create Date: 2026-06-03 11:34:02.441435
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Sequence, Union
|
|
10
|
+
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
from alembic import op
|
|
13
|
+
from sqlalchemy.dialects import postgresql
|
|
14
|
+
|
|
15
|
+
# revision identifiers, used by Alembic.
|
|
16
|
+
revision: str = "8b780aea403a"
|
|
17
|
+
down_revision: Union[str, None] = "f1ce0ad2845b"
|
|
18
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
19
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def upgrade() -> None:
|
|
23
|
+
# op.execute("""
|
|
24
|
+
# CREATE TYPE user_related.university_role AS ENUM ('student', 'teacher', 'staff')
|
|
25
|
+
# """)
|
|
26
|
+
op.add_column(
|
|
27
|
+
"inferred_user",
|
|
28
|
+
sa.Column("university_title", sa.String(), nullable=True),
|
|
29
|
+
schema="user_related",
|
|
30
|
+
)
|
|
31
|
+
op.add_column(
|
|
32
|
+
"inferred_user",
|
|
33
|
+
sa.Column(
|
|
34
|
+
"role",
|
|
35
|
+
sa.String(),
|
|
36
|
+
nullable=True,
|
|
37
|
+
),
|
|
38
|
+
schema="user_related",
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def downgrade() -> None:
|
|
43
|
+
op.drop_column("inferred_user", "university_title", schema="user_related")
|
|
44
|
+
op.drop_column("inferred_user", "role", schema="user_related")
|
{welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/models/user_related.py
RENAMED
|
@@ -216,6 +216,8 @@ class InferredUser(Base):
|
|
|
216
216
|
types.Uuid, primary_key=True, nullable=False, server_default="gen_random_uuid()"
|
|
217
217
|
)
|
|
218
218
|
origin_referrer: Mapped[str | None]
|
|
219
|
+
university_title: Mapped[str | None]
|
|
220
|
+
role: Mapped[str | None]
|
|
219
221
|
created_at: Mapped[datetime] = mapped_column(
|
|
220
222
|
TIMESTAMP(timezone=False),
|
|
221
223
|
nullable=False,
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
class
|
|
1
|
+
class WeLearnDatabaseException(Exception):
|
|
2
|
+
"""
|
|
3
|
+
Base class for all WeLearnDatabase exceptions
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class InvalidURLScheme(WeLearnDatabaseException):
|
|
2
8
|
"""
|
|
3
9
|
Scheme detected in URL is not accepted
|
|
4
10
|
"""
|
|
@@ -7,7 +13,7 @@ class InvalidURLScheme(Exception):
|
|
|
7
13
|
super().__init__(msg, *args)
|
|
8
14
|
|
|
9
15
|
|
|
10
|
-
class InvalidDOI(
|
|
16
|
+
class InvalidDOI(WeLearnDatabaseException):
|
|
11
17
|
"""
|
|
12
18
|
Scheme detected in DOI is not accepted
|
|
13
19
|
"""
|
|
@@ -16,7 +22,7 @@ class InvalidDOI(Exception):
|
|
|
16
22
|
super().__init__(msg, *args)
|
|
17
23
|
|
|
18
24
|
|
|
19
|
-
class ContentIsTooShort(
|
|
25
|
+
class ContentIsTooShort(WeLearnDatabaseException):
|
|
20
26
|
"""
|
|
21
27
|
The string used as content is too short, it should be at least 25 characters long
|
|
22
28
|
"""
|
|
@@ -27,3 +33,14 @@ class ContentIsTooShort(Exception):
|
|
|
27
33
|
*args,
|
|
28
34
|
):
|
|
29
35
|
super().__init__(msg, *args)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class EarlyEnumerationVerificationError(WeLearnDatabaseException):
|
|
39
|
+
"""
|
|
40
|
+
SQLAlchemy detect an enumeration value that is not in the list of accepted values
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def __init__(
|
|
44
|
+
self, msg="Enumeration value is not in the list of accepted values", *args
|
|
45
|
+
):
|
|
46
|
+
super().__init__(msg, *args)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/models/agent_related.py
RENAMED
|
File without changes
|
{welearn_database-1.4.4 → welearn_database-1.4.5}/welearn_database/data/models/corpus_related.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|