Skip to content

Commit

Permalink
Fix null issue
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanSteinberg committed May 4, 2024
1 parent c1ebdc8 commit 08b2562
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Byte-compiled / optimized / DLL files
_version.py
__pycache__/
*.py[cod]
*$py.class
Expand Down
16 changes: 8 additions & 8 deletions src/meds/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ def patient_schema(per_event_properties_schema=pa.null()):
# Return a patient schema with a particular per event metadata subschema
event = pa.struct(
[
pa.field("time", pa.timestamp("us")), # Static events will have a null timestamp
pa.field("code", pa.string(), nullable=False),
pa.field("text_value", pa.string()),
pa.field("numeric_value", pa.float32()),
pa.field("datetime_value", pa.timestamp("us")),
pa.field("properties", per_event_properties_schema),
("time", pa.timestamp("us")), # Static events will have a null timestamp
("code", pa.string()),
("text_value", pa.string()),
("numeric_value", pa.float32()),
("datetime_value", pa.timestamp("us")),
("properties", per_event_properties_schema),
]
)

patient = pa.schema(
[
pa.field("patient_id", pa.int64(), nullable=False),
pa.field("events", pa.list_(event), nullable=False), # Require ordered by time, nulls must be first
("patient_id", pa.int64()),
("events", pa.list_(event)), # Require ordered by time, nulls must be first
]
)

Expand Down

0 comments on commit 08b2562

Please sign in to comment.