fused
Advanced tools
+27
-0
@@ -246,3 +246,28 @@ import datetime | ||
| annotation = PD_DATAFRAME | ||
| else: | ||
| ANNOTATION_TO_TYPE = { | ||
| "datetime": datetime.datetime, | ||
| "date": datetime.date, | ||
| "time": datetime.time, | ||
| "datetime.datetime": datetime.datetime, | ||
| "datetime.date": datetime.date, | ||
| "datetime.time": datetime.time, | ||
| "uuid.UUID": uuid.UUID, | ||
| "UUID": uuid.UUID, | ||
| "Bbox": Bbox, | ||
| "Bounds": Bounds, | ||
| "Tile": Tile, | ||
| "TileGDF": TileGDF, | ||
| "TileXYZ": TileXYZ, | ||
| "ViewportGDF": ViewportGDF, | ||
| "fused.types.Bbox": Bbox, | ||
| "fused.types.Bounds": Bounds, | ||
| "fused.types.Tile": Tile, | ||
| "fused.types.TileGDF": TileGDF, | ||
| "fused.types.TileXYZ": TileXYZ, | ||
| "fused.types.ViewportGDF": ViewportGDF, | ||
| } | ||
| annotation = ANNOTATION_TO_TYPE.get(annotation, None) | ||
| if annotation is str: | ||
@@ -270,2 +295,4 @@ return str(val) | ||
| if annotation is uuid.UUID: | ||
| if isinstance(val, uuid.UUID): | ||
| return val | ||
| return uuid.UUID(val) | ||
@@ -272,0 +299,0 @@ if annotation in [datetime.datetime, datetime.date, datetime.time]: |
@@ -426,4 +426,7 @@ import ast | ||
| for param, annot in type_hints.items(): | ||
| if annot.__module__ not in ("builtins", "fused"): | ||
| annotations[param] = annot | ||
| try: | ||
| if annot.__module__ not in ("builtins", "fused"): | ||
| annotations[param] = annot | ||
| except AttributeError: | ||
| pass | ||
@@ -447,2 +450,3 @@ if not annotations: | ||
| # If the annotation is a string, we don't need to do anything | ||
| if isinstance(arg.annotation, ast.Name): | ||
@@ -449,0 +453,0 @@ name = arg.annotation.id |
@@ -1,1 +0,1 @@ | ||
| __version__ = "2.0.3" | ||
| __version__ = "2.0.4" |
+1
-1
| Metadata-Version: 2.4 | ||
| Name: fused | ||
| Version: 2.0.3 | ||
| Version: 2.0.4 | ||
| Project-URL: Homepage, https://www.fused.io | ||
@@ -5,0 +5,0 @@ Project-URL: Documentation, https://docs.fused.io |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
934835
0.13%22378
0.13%