Skip to content

Commit bf782b6

Browse files
committed
float was missing from JSON type
1 parent e2f2012 commit bf782b6

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

schema_salad/avro/schema.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@
5858
# MappingDataType = Dict[str, Union[PropType, List[PropsType]]]
5959
# was: Union[str, MappingDataType, List[MappingDataType]]
6060
JsonDataType = Any
61-
AtomicPropType = Union[str, int, bool, "Schema", List[str], List["Field"]]
61+
AtomicPropType = Union[None, str, int, float, bool, "Schema", List[str], List["Field"]]
6262
PropType = Union[
6363
AtomicPropType,
64-
Dict[str, Optional[AtomicPropType]],
65-
List[Dict[str, Optional[AtomicPropType]]],
64+
Dict[str, AtomicPropType],
65+
List[Dict[str, AtomicPropType]],
6666
]
67-
PropsType = Dict[str, Optional[PropType]]
67+
PropsType = Dict[str, PropType]
6868

6969
FIELD_RESERVED_PROPS = ("default", "name", "doc", "order", "type")
7070

schema_salad/schema.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,7 @@ def replace_type(
434434
find_embeds: bool = True,
435435
deepen: bool = True,
436436
) -> Any:
437-
""" Go through and replace types in the 'spec' mapping"""
438-
437+
"""Go through and replace types in the 'spec' mapping."""
439438
if isinstance(items, MutableMapping):
440439
# recursively check these fields for types to replace
441440
if items.get("type") in ("record", "enum") and items.get("name"):

schema_salad/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ def json_dump(
9898
fp, # type: IO[str]
9999
**kwargs # type: Any
100100
): # type: (...) -> None
101-
""" Force use of unicode. """
101+
"""Force use of unicode."""
102102
json.dump(convert_to_dict(obj), fp, **kwargs)
103103

104104

105105
def json_dumps(
106106
obj, # type: Any
107107
**kwargs # type: Any
108108
): # type: (...) -> str
109-
""" Force use of unicode. """
109+
"""Force use of unicode."""
110110
return json.dumps(convert_to_dict(obj), **kwargs)

0 commit comments

Comments
 (0)