Skip to content

Commit

Permalink
Support upcoming FHIRDate changes in fhirclient
Browse files Browse the repository at this point in the history
Use a `issubclass` check instead of an `is` check.
  • Loading branch information
mikix committed Jul 22, 2024
1 parent 8ce2a64 commit 32c68a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cumulus_fhir_support/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""FHIR support code for the Cumulus project"""

__version__ = "1.2.0"
__version__ = "1.2.1"

from .json import list_multiline_json_in_dir, read_multiline_json, read_multiline_json_from_dir
from .schemas import pyarrow_schema_from_rows
2 changes: 1 addition & 1 deletion cumulus_fhir_support/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,6 @@ def _basic_fhir_to_pyarrow_type(pytype: type) -> pyarrow.DataType:
return pyarrow.string()
elif pytype is bool:
return pyarrow.bool_()
elif pytype is fhirdate.FHIRDate:
elif issubclass(pytype, fhirdate.FHIRDate):
return pyarrow.string() # just leave it as a string, like it appears in the JSON
raise ValueError(f"Unexpected type: {pytype}")

0 comments on commit 32c68a2

Please sign in to comment.