Skip to content
Snippets Groups Projects
Verified Commit 0af91939 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

MAINT: Making typing compatible with Python 3.8

parent d97c5426
No related branches found
No related tags found
2 merge requests!89ENH: JsonSchemaExporter accepts do_not_create parameter.,!82ENH: JsonSchemaExporter accepts do_not_create parameter.
Pipeline #43065 passed
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"""Module for converting a data model into a json schema compatible dictionary. """Module for converting a data model into a json schema compatible dictionary.
""" """
from typing import Any, Optional from typing import Any, List, Optional
import linkahead as db import linkahead as db
from linkahead.common.datatype import get_list_datatype, is_list_datatype from linkahead.common.datatype import get_list_datatype, is_list_datatype
...@@ -36,7 +36,7 @@ class JsonSchemaExporter: ...@@ -36,7 +36,7 @@ class JsonSchemaExporter:
name_and_description_in_properties: bool = False, name_and_description_in_properties: bool = False,
additional_options_for_text_props: dict = None, additional_options_for_text_props: dict = None,
units_in_description: bool = True, units_in_description: bool = True,
do_not_create: list[str] = None, do_not_create: List[str] = None,
): ):
"""Set up a JsonSchemaExporter, which can then be applied on RecordTypes. """Set up a JsonSchemaExporter, which can then be applied on RecordTypes.
...@@ -272,7 +272,7 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T ...@@ -272,7 +272,7 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T
name_and_description_in_properties: bool = False, name_and_description_in_properties: bool = False,
additional_options_for_text_props: Optional[dict] = None, additional_options_for_text_props: Optional[dict] = None,
units_in_description: bool = True, units_in_description: bool = True,
do_not_create: list[str] = None): do_not_create: List[str] = None):
"""Create a jsonschema from a given RecordType that can be used, e.g., to """Create a jsonschema from a given RecordType that can be used, e.g., to
validate a json specifying a record of the given type. validate a json specifying a record of the given type.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment