Skip to content

Commit

Permalink
Recognize streaming shapes correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Jun 6, 2020
1 parent c3e6aca commit 1ec25dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mypy_boto3_builder/parsers/shape_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class ShapeParser:
"double": Type.float,
"float": Type.float,
"timestamp": ExternalImport(ImportString("datetime"), "datetime"),
"blob": TypeSubscript(Type.Union, [Type.bytes, Type.IOBytes]),
}

# Alias map fixes added by botocore for documentation build.
Expand Down Expand Up @@ -319,6 +318,11 @@ def _parse_shape_list(self, shape: ListShape) -> FakeAnnotation:
return type_subscript

def _parse_shape(self, shape: Shape) -> FakeAnnotation:
if shape.type_name == "blob":
if shape.serialization.get("streaming"):
return Type.IOBytes
return Type.bytes

if shape.type_name in self.SHAPE_TYPE_MAP:
return self.SHAPE_TYPE_MAP[shape.type_name]

Expand Down

0 comments on commit 1ec25dc

Please sign in to comment.