Skip to content

Commit 0780b14

Browse files
author
Vishakh Pillai
committed
correcting nullable=False which is causing unit test issues
1 parent 13deb12 commit 0780b14

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/webapp/database.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ class FileTable(Base):
358358
source: Mapped[str | None] = mapped_column(String(VAR_CHAR_LENGTH), nullable=True)
359359
# The schema type(s) of this file.
360360
schemas: Mapped[list[str]] = mapped_column(
361-
MutableList.as_mutable((JSON())), nullable=False
361+
MutableList.as_mutable((JSON())),
362+
nullable=False,
363+
default=list,
362364
)
363365
# If null, the following is non-deleted.
364366
# The deleted field indicates whether there is a pending deletion request on the data.
@@ -371,9 +373,9 @@ class FileTable(Base):
371373
)
372374
retention_days: Mapped[int] = mapped_column(nullable=True)
373375
# Whether the file was generated by SST. (e.g. was it input or output)
374-
sst_generated: Mapped[bool] = mapped_column(nullable=False)
376+
sst_generated: Mapped[bool] = mapped_column(nullable=False, default=False)
375377
# Whether the file was approved (in the case of output) or valid for input.
376-
valid: Mapped[bool] = mapped_column(nullable=False)
378+
valid: Mapped[bool] = mapped_column(nullable=False, default=False)
377379
created_at: Mapped[datetime.datetime] = mapped_column(
378380
DateTime(timezone=True), server_default=func.now()
379381
)

0 commit comments

Comments
 (0)