welearn-database 1.5.2__tar.gz → 1.5.3__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.5.2 → welearn_database-1.5.3}/PKG-INFO +1 -1
- {welearn_database-1.5.2 → welearn_database-1.5.3}/pyproject.toml +1 -1
- welearn_database-1.5.3/welearn_database/alembic/versions/5d46d7920342_support_sub_corpus.py +75 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/models/corpus_related.py +4 -1
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/models/grafana.py +7 -4
- {welearn_database-1.5.2 → welearn_database-1.5.3}/LICENSE +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/README.md +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/__init__.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/README +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/env.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/script.py.mako +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/068312e7800c_add_referrer_origin_column_to_user_and_.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/0e0bc0fca384_doc_qty_per_source.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/16ff997426d3_remove_error_retrieval_unique_constraint.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/2ad4895b2674_data_collection.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/4c7161819e5a_grafana_views.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/4f5a188dd614_add_main_url_column.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/4fcbfb7f3145_added_api_key_management_table.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/5aad97149044_add_histo_table_for_materialized_views.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/5d82613c9aca_context_document.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/6d4346fad6f4_view_used_feature_per_session.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/821173cf9c5d_initial_migration.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/84c42739c17b_create_table_errordataquality.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/89920abb7ff8_add_category.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/8b780aea403a_add_university_data.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/95ffe7afa64c_add_index_idx_welearn_document_keyword_.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/96bba9e4842a_merge_external_id_error_quality.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/9b4f1da0c1f2_data_collection_for_focus_group.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/a50a1db3ca2a_add_used_since_column_for_embeddings.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/b031206324b7_agent_related.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/b049924f7067_modify_corpus_name_embedding_model_lang_.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/b84462ca3800_update_grafana_process_state_view.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/ccdbd708c997_create_column_external_id.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/e354666f951d_inferred_user.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/f1ce0ad2845b_add_doi_column_to_document.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/f5e91a5c950d_add_analytic_form.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/alembic/versions/f8602200fa99_update_session_view.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/__init__.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/details_dict.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/enumeration.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/models/__init__.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/models/agent_related.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/models/document_related.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/models/user_related.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/database_utils.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/exceptions.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/modules/__init__.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/modules/text_cleaning.py +0 -0
- {welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/regular_expression.py +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""support_sub_corpus
|
|
2
|
+
|
|
3
|
+
Revision ID: 5d46d7920342
|
|
4
|
+
Revises: 95ffe7afa64c
|
|
5
|
+
Create Date: 2026-09-21 14:47:28.116941
|
|
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 = "5d46d7920342"
|
|
16
|
+
down_revision: Union[str, None] = "95ffe7afa64c"
|
|
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.add_column(
|
|
23
|
+
"corpus",
|
|
24
|
+
sa.Column("parent_corpus_id", sa.Uuid(), nullable=True),
|
|
25
|
+
schema="corpus_related",
|
|
26
|
+
)
|
|
27
|
+
op.create_foreign_key(
|
|
28
|
+
"corpus_parent_corpus_id_fkey",
|
|
29
|
+
"corpus",
|
|
30
|
+
"corpus",
|
|
31
|
+
["parent_corpus_id"],
|
|
32
|
+
["id"],
|
|
33
|
+
source_schema="corpus_related",
|
|
34
|
+
referent_schema="corpus_related",
|
|
35
|
+
)
|
|
36
|
+
op.execute("DROP VIEW grafana.corpus")
|
|
37
|
+
op.drop_column("corpus", "binary_treshold", schema="corpus_related")
|
|
38
|
+
op.execute("""
|
|
39
|
+
CREATE OR REPLACE VIEW grafana.corpus
|
|
40
|
+
AS SELECT corpus.id,
|
|
41
|
+
corpus.parent_corpus_id,
|
|
42
|
+
corpus.source_name,
|
|
43
|
+
corpus.main_url,
|
|
44
|
+
corpus.is_fix,
|
|
45
|
+
corpus.is_active,
|
|
46
|
+
corpus.category_id
|
|
47
|
+
FROM corpus_related.corpus;
|
|
48
|
+
""")
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def downgrade() -> None:
|
|
52
|
+
op.drop_constraint(
|
|
53
|
+
"corpus_parent_corpus_id_fkey", "corpus", schema="corpus_related"
|
|
54
|
+
)
|
|
55
|
+
op.execute("DROP VIEW grafana.corpus")
|
|
56
|
+
op.drop_column("corpus", "parent_corpus_id", schema="corpus_related")
|
|
57
|
+
op.add_column(
|
|
58
|
+
"corpus",
|
|
59
|
+
sa.Column(
|
|
60
|
+
"binary_treshold",
|
|
61
|
+
sa.Float(),
|
|
62
|
+
nullable=False,
|
|
63
|
+
default=0.5,
|
|
64
|
+
server_default="0.5",
|
|
65
|
+
),
|
|
66
|
+
schema="corpus_related",
|
|
67
|
+
)
|
|
68
|
+
op.execute("""
|
|
69
|
+
CREATE OR REPLACE VIEW grafana.corpus
|
|
70
|
+
AS SELECT corpus.id,
|
|
71
|
+
corpus.source_name,
|
|
72
|
+
corpus.is_fix,
|
|
73
|
+
corpus.binary_treshold
|
|
74
|
+
FROM corpus_related.corpus;
|
|
75
|
+
""")
|
{welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/models/corpus_related.py
RENAMED
|
@@ -19,10 +19,13 @@ class Corpus(Base):
|
|
|
19
19
|
id: Mapped[UUID] = mapped_column(
|
|
20
20
|
types.Uuid, primary_key=True, nullable=False, server_default="gen_random_uuid()"
|
|
21
21
|
)
|
|
22
|
+
parent_corpus_id: Mapped[UUID | None] = mapped_column(
|
|
23
|
+
types.Uuid,
|
|
24
|
+
ForeignKey(f"{schema_name}.corpus.id"),
|
|
25
|
+
)
|
|
22
26
|
source_name: Mapped[str]
|
|
23
27
|
main_url: Mapped[str | None] = mapped_column(nullable=True)
|
|
24
28
|
is_fix: Mapped[bool]
|
|
25
|
-
binary_treshold: Mapped[float] = mapped_column(nullable=False, default=0.5)
|
|
26
29
|
is_active: Mapped[bool]
|
|
27
30
|
category_id: Mapped[UUID] = mapped_column(
|
|
28
31
|
types.Uuid,
|
|
@@ -16,10 +16,13 @@ class Corpus(Base):
|
|
|
16
16
|
__table_args__ = {"schema": schema_name}
|
|
17
17
|
__read_only__ = True
|
|
18
18
|
|
|
19
|
-
id: Mapped[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
id: Mapped[UUID] = mapped_column(UUID(as_uuid=True), primary_key=True)
|
|
20
|
+
parent_corpus_id: Mapped[UUID | None] = mapped_column(UUID(as_uuid=True))
|
|
21
|
+
source_name: Mapped[str]
|
|
22
|
+
main_url: Mapped[str | None] = mapped_column(nullable=True)
|
|
23
|
+
is_fix: Mapped[bool]
|
|
24
|
+
is_active: Mapped[bool]
|
|
25
|
+
category_id: Mapped[UUID | None] = mapped_column(UUID(as_uuid=True))
|
|
23
26
|
|
|
24
27
|
|
|
25
28
|
class DocumentLatestState(Base):
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/models/agent_related.py
RENAMED
|
File without changes
|
{welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/models/document_related.py
RENAMED
|
File without changes
|
{welearn_database-1.5.2 → welearn_database-1.5.3}/welearn_database/data/models/user_related.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|