Skip to content

Commit

Permalink
dataset.Column obj: change checks attr data type
Browse files Browse the repository at this point in the history
  • Loading branch information
sf-dcp committed Dec 19, 2024
1 parent a041b06 commit f158ce4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dcpy/models/dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dcpy.models.base import SortedSerializedBase
from typing import Literal
from typing import Literal, Any

COLUMN_TYPES = Literal[
"text",
Expand All @@ -14,10 +14,10 @@
]


# TODO: extend/modify Checks model
class Checks(SortedSerializedBase):
is_primary_key: bool | None = None
non_nullable: bool | None = None
# TODO: DELETE
# class Checks(SortedSerializedBase):
# is_primary_key: bool | None = None
# non_nullable: bool | None = None


class Column(SortedSerializedBase, extra="forbid"):
Expand All @@ -29,4 +29,4 @@ class Column(SortedSerializedBase, extra="forbid"):
data_type: COLUMN_TYPES | None = None
description: str | None = None
is_required: bool = True
checks: Checks | None = None
checks: list[str | dict[str, Any]] | None = None
1 change: 1 addition & 0 deletions dcpy/models/lifecycle/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class Template(BaseModel, extra="forbid"):
attributes: DatasetAttributes
ingestion: Ingestion
columns: list[Column] = []
checks: list[str | dict[str, Any]] | None = None

@property
def has_geom(self):
Expand Down

0 comments on commit f158ce4

Please sign in to comment.