mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-26 17:51:54 +01:00
made description optional for document sets (#3407)
* made description optional for document sets * update document set optional * update alembic migration head --------- Co-authored-by: pablodanswer <pablo@danswer.ai>
This commit is contained in:
parent
c69b7fc941
commit
54dcbfa288
@ -0,0 +1,30 @@
|
||||
"""make document set description optional
|
||||
|
||||
Revision ID: 94dc3d0236f8
|
||||
Revises: bf7a81109301
|
||||
Create Date: 2024-12-11 11:26:10.616722
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "94dc3d0236f8"
|
||||
down_revision = "bf7a81109301"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# Make document_set.description column nullable
|
||||
op.alter_column(
|
||||
"document_set", "description", existing_type=sa.String(), nullable=True
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# Revert document_set.description column to non-nullable
|
||||
op.alter_column(
|
||||
"document_set", "description", existing_type=sa.String(), nullable=False
|
||||
)
|
@ -1226,7 +1226,7 @@ class DocumentSet(Base):
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
||||
name: Mapped[str] = mapped_column(String, unique=True)
|
||||
description: Mapped[str] = mapped_column(String)
|
||||
description: Mapped[str | None] = mapped_column(String)
|
||||
user_id: Mapped[UUID | None] = mapped_column(
|
||||
ForeignKey("user.id", ondelete="CASCADE"), nullable=True
|
||||
)
|
||||
|
@ -44,7 +44,7 @@ class CheckDocSetPublicResponse(BaseModel):
|
||||
class DocumentSet(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
description: str
|
||||
description: str | None
|
||||
cc_pair_descriptors: list[ConnectorCredentialPairDescriptor]
|
||||
is_up_to_date: bool
|
||||
is_public: bool
|
||||
|
@ -65,9 +65,7 @@ export const DocumentSetCreationForm = ({
|
||||
}}
|
||||
validationSchema={Yup.object().shape({
|
||||
name: Yup.string().required("Please enter a name for the set"),
|
||||
description: Yup.string().required(
|
||||
"Please enter a description for the set"
|
||||
),
|
||||
description: Yup.string().optional(),
|
||||
cc_pair_ids: Yup.array()
|
||||
.of(Yup.number().required())
|
||||
.required("Please select at least one connector"),
|
||||
@ -125,6 +123,7 @@ export const DocumentSetCreationForm = ({
|
||||
label="Description:"
|
||||
placeholder="Describe what the document set represents"
|
||||
autoCompleteDisabled={true}
|
||||
optional={true}
|
||||
/>
|
||||
|
||||
{isPaidEnterpriseFeaturesEnabled && (
|
||||
|
Loading…
x
Reference in New Issue
Block a user