welearn-database 1.5.3.dev1__py3-none-any.whl → 1.5.4.dev1__py3-none-any.whl
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/alembic/versions/0310ff0bda4f_track_document_last_state.py +38 -0
- welearn_database/alembic/versions/d22d6324c256_cleaned_document_state.py +30 -0
- welearn_database/alembic/versions/d990f127902f_merge_keycloack_and_new_cleaned_state_.py +26 -0
- welearn_database/data/enumeration.py +1 -0
- welearn_database/data/models/document_related.py +18 -0
- {welearn_database-1.5.3.dev1.dist-info → welearn_database-1.5.4.dev1.dist-info}/METADATA +1 -1
- {welearn_database-1.5.3.dev1.dist-info → welearn_database-1.5.4.dev1.dist-info}/RECORD +9 -6
- {welearn_database-1.5.3.dev1.dist-info → welearn_database-1.5.4.dev1.dist-info}/LICENSE +0 -0
- {welearn_database-1.5.3.dev1.dist-info → welearn_database-1.5.4.dev1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""track_document_last_state
|
|
2
|
+
|
|
3
|
+
Revision ID: 0310ff0bda4f
|
|
4
|
+
Revises: d22d6324c256
|
|
5
|
+
Create Date: 2026-09-23 11:48:30.473174
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Sequence, Union
|
|
10
|
+
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
from alembic import op
|
|
13
|
+
|
|
14
|
+
# revision identifiers, used by Alembic.
|
|
15
|
+
revision: str = "0310ff0bda4f"
|
|
16
|
+
down_revision: Union[str, None] = "d22d6324c256"
|
|
17
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
18
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def upgrade() -> None:
|
|
22
|
+
op.execute("""
|
|
23
|
+
CREATE OR REPLACE VIEW document_related.track_document_latest_state
|
|
24
|
+
AS SELECT DISTINCT ON (ps.document_id) ps.id,
|
|
25
|
+
ps.document_id,
|
|
26
|
+
wd.corpus_id,
|
|
27
|
+
wd.lang,
|
|
28
|
+
ps.title,
|
|
29
|
+
ps.created_at,
|
|
30
|
+
ps.operation_order
|
|
31
|
+
FROM document_related.process_state ps
|
|
32
|
+
JOIN document_related.welearn_document wd ON ps.document_id = wd.id
|
|
33
|
+
ORDER BY ps.document_id, ps.operation_order DESC;
|
|
34
|
+
""")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def downgrade() -> None:
|
|
38
|
+
op.execute("DROP VIEW IF EXISTS document_related.track_document_latest_state;")
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""cleaned_document_state
|
|
2
|
+
|
|
3
|
+
Revision ID: d22d6324c256
|
|
4
|
+
Revises: 5d46d7920342
|
|
5
|
+
Create Date: 2026-09-23 11:18:46.784209
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Sequence, Union
|
|
10
|
+
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
from alembic import op
|
|
13
|
+
|
|
14
|
+
from welearn_database.data.enumeration import Step
|
|
15
|
+
|
|
16
|
+
# revision identifiers, used by Alembic.
|
|
17
|
+
revision: str = "d22d6324c256"
|
|
18
|
+
down_revision: Union[str, None] = "5d46d7920342"
|
|
19
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
20
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def upgrade() -> None:
|
|
24
|
+
op.execute(
|
|
25
|
+
f"""ALTER TYPE document_related.step ADD VALUE '{Step.DOCUMENT_CLEANED.value}'"""
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def downgrade() -> None:
|
|
30
|
+
pass
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""merge keycloack and new cleaned state related stuff
|
|
2
|
+
|
|
3
|
+
Revision ID: d990f127902f
|
|
4
|
+
Revises: 0310ff0bda4f, f10903998081
|
|
5
|
+
Create Date: 2026-09-23 16:20:59.738749
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from typing import Sequence, Union
|
|
9
|
+
|
|
10
|
+
from alembic import op
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# revision identifiers, used by Alembic.
|
|
15
|
+
revision: str = 'd990f127902f'
|
|
16
|
+
down_revision: Union[str, None] = ('0310ff0bda4f', 'f10903998081')
|
|
17
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
18
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def upgrade() -> None:
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def downgrade() -> None:
|
|
26
|
+
pass
|
|
@@ -563,3 +563,21 @@ class QtyDocumentPerCorpus(Base):
|
|
|
563
563
|
|
|
564
564
|
source_name: Mapped[str] = mapped_column(primary_key=True)
|
|
565
565
|
count: Mapped[int]
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
class TrackDocumentLatestState(Base):
|
|
569
|
+
__tablename__ = "track_document_latest_state"
|
|
570
|
+
__table_args__ = {"schema": schema_name}
|
|
571
|
+
__read_only__ = True
|
|
572
|
+
|
|
573
|
+
id: Mapped[UUID] = mapped_column(
|
|
574
|
+
primary_key=True,
|
|
575
|
+
type_=types.Uuid,
|
|
576
|
+
)
|
|
577
|
+
document_id: Mapped[UUID] = mapped_column(
|
|
578
|
+
type_=types.Uuid,
|
|
579
|
+
)
|
|
580
|
+
lang: Mapped[str]
|
|
581
|
+
title: Mapped[str]
|
|
582
|
+
created_at: Mapped[datetime] = mapped_column()
|
|
583
|
+
operation_order: Mapped[int]
|
|
@@ -2,6 +2,7 @@ welearn_database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
|
2
2
|
welearn_database/alembic/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38
|
|
3
3
|
welearn_database/alembic/env.py,sha256=19AsrQzRbiNcxUmnBJ8rn7FPTTLf8rQSPYoZbN9iMAs,3114
|
|
4
4
|
welearn_database/alembic/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
|
|
5
|
+
welearn_database/alembic/versions/0310ff0bda4f_track_document_last_state.py,sha256=3ohy8ZsAdPVQnfMhCK0XdgR6phhD2Qt2aeriBDlOs_c,1030
|
|
5
6
|
welearn_database/alembic/versions/068312e7800c_add_referrer_origin_column_to_user_and_.py,sha256=H9rGLdUy9Xhz7P0H-JJagGknloP5RyrlXlfOwU45gf8,1008
|
|
6
7
|
welearn_database/alembic/versions/0e0bc0fca384_doc_qty_per_source.py,sha256=TYrIgiMO9tmowFAfmfjQT-ywtpWDeLlJzs_G5ZxqNWQ,1605
|
|
7
8
|
welearn_database/alembic/versions/16ff997426d3_remove_error_retrieval_unique_constraint.py,sha256=858ig87DVtqz9Wwq5LAsaX73qJmlC-v-gnfJGdutQ1U,932
|
|
@@ -25,6 +26,8 @@ welearn_database/alembic/versions/b031206324b7_agent_related.py,sha256=BAB1js3qg
|
|
|
25
26
|
welearn_database/alembic/versions/b049924f7067_modify_corpus_name_embedding_model_lang_.py,sha256=v9h4jxHakTTxupJzw4lPb-ZEnhzV5BQOOiAE5YITl-s,2167
|
|
26
27
|
welearn_database/alembic/versions/b84462ca3800_update_grafana_process_state_view.py,sha256=5xmW9BO3Y3Aq-qyssXHZGKk6pNfX_9oq9Grpwk6-pug,1318
|
|
27
28
|
welearn_database/alembic/versions/ccdbd708c997_create_column_external_id.py,sha256=xQtLsONPsaqHFck_RgV2VAcpRN-RFdeF3relGQ7A7-c,1757
|
|
29
|
+
welearn_database/alembic/versions/d22d6324c256_cleaned_document_state.py,sha256=gSeipL3j2PnzS6sDjVojFz92EyuUa9TwzHkoe2iZc3o,656
|
|
30
|
+
welearn_database/alembic/versions/d990f127902f_merge_keycloack_and_new_cleaned_state_.py,sha256=waYWTYW7f4yPeaAWJDgezToEcd5MsrCH5Tw7-sm59TM,562
|
|
28
31
|
welearn_database/alembic/versions/e354666f951d_inferred_user.py,sha256=WGmsJKDsLKq3IhmaG23BixFR0X7ldeiAvLkfzqpR3oE,3483
|
|
29
32
|
welearn_database/alembic/versions/f10903998081_keycloack_id_for_user_id.py,sha256=0xCmuyonpNK1tkHZu3OBj7riCN-DS8S4wKAZxZsT9aQ,713
|
|
30
33
|
welearn_database/alembic/versions/f1ce0ad2845b_add_doi_column_to_document.py,sha256=rDTirFy51Qid8SSQ80QQCC0u_Oex6OVMHux4i6ePl90,715
|
|
@@ -32,11 +35,11 @@ welearn_database/alembic/versions/f5e91a5c950d_add_analytic_form.py,sha256=q0BBZ
|
|
|
32
35
|
welearn_database/alembic/versions/f8602200fa99_update_session_view.py,sha256=92lb6Lr-9HuW3zVHuD5SzyUhHRQrwVup8a3QSTI1s4g,831
|
|
33
36
|
welearn_database/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
37
|
welearn_database/data/details_dict.py,sha256=9C-WA6owsMh_ZflbV6LvZ8084QjPZK8-wN-bXPn5Zn8,957
|
|
35
|
-
welearn_database/data/enumeration.py,sha256=
|
|
38
|
+
welearn_database/data/enumeration.py,sha256=BDdwzV5pHapyCQoBNwPj0i-DHRcgA4VJr3sBc44ba68,1187
|
|
36
39
|
welearn_database/data/models/__init__.py,sha256=J0k9nHY6D5j-nEXGWYsbI2nBhmlHPaXIaW0RWsUs32A,1149
|
|
37
40
|
welearn_database/data/models/agent_related.py,sha256=Z0foQ-dcsORp7Wi_bPMsS2zulU843MySMWxrC7GLD7I,3139
|
|
38
41
|
welearn_database/data/models/corpus_related.py,sha256=fli3Je6hi49nn6IfMxptujisJRDSM5slWivabMp_ZTg,6850
|
|
39
|
-
welearn_database/data/models/document_related.py,sha256=
|
|
42
|
+
welearn_database/data/models/document_related.py,sha256=PLsOIWUrwT0tgRnY58EbhSEFondWahD3kq5wuik6yPk,18427
|
|
40
43
|
welearn_database/data/models/grafana.py,sha256=Q_8RKoXSyNShqVx7Bl-763ImuCnqzmWdJU04mlg4axU,5614
|
|
41
44
|
welearn_database/data/models/user_related.py,sha256=PC9CipMej7yqnM1CALNbPyHaThdWPR7NIVX0Nvl8xDE,9909
|
|
42
45
|
welearn_database/database_utils.py,sha256=fFCjFHXLYa80XblQAB5so0NQgd5yr_RmO5rM4r3qm0I,800
|
|
@@ -44,7 +47,7 @@ welearn_database/exceptions.py,sha256=6XP4vxRSJ40mwqGZ7PdjWaW1MarZLX3vRsBL9WQe4W
|
|
|
44
47
|
welearn_database/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
48
|
welearn_database/modules/text_cleaning.py,sha256=N_OgJNsjOOKp6m05iljvM0f22_U9wEhy7nKpqnfuG0k,2169
|
|
46
49
|
welearn_database/regular_expression.py,sha256=qAUCoxBSfzD1DLlaRfz0R8H6wp7iyQPiBgNhNOT-2Qw,668
|
|
47
|
-
welearn_database-1.5.
|
|
48
|
-
welearn_database-1.5.
|
|
49
|
-
welearn_database-1.5.
|
|
50
|
-
welearn_database-1.5.
|
|
50
|
+
welearn_database-1.5.4.dev1.dist-info/LICENSE,sha256=5mwmnUgZqqs0tJ71IgxN2rZ1byG7UYB2Gk64Vh8re70,20850
|
|
51
|
+
welearn_database-1.5.4.dev1.dist-info/METADATA,sha256=3Jlod72rqBFYW3nYVGhF5axoUzN7PqlAMTQcofiZQvY,2183
|
|
52
|
+
welearn_database-1.5.4.dev1.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
|
53
|
+
welearn_database-1.5.4.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|