Skip to content

Commit

Permalink
replace checks obj in ingest and dataset.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sf-dcp committed Dec 19, 2024
1 parent 2ca8dd3 commit 919a826
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 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: 0 additions & 1 deletion dcpy/models/lifecycle/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class Column(BaseColumn):
_head_sort_order = ["id", "data_type", "description"]

data_type: COLUMN_TYPES # override BaseColumn `data_type` to be required field
checks: list[str | dict[str, Any]] | None = None


class Template(BaseModel, extra="forbid"):
Expand Down

0 comments on commit 919a826

Please sign in to comment.