@@ -100,7 +100,7 @@ def _parse_fixed_type(fixed: Any) -> int:
100100 return fixed
101101
102102
103- def _parse_geography_type (geography : Any ) -> Tuple [str , GeographyType .EdgeAlgorithm ]:
103+ def _parse_geography_type (geography : Any ) -> Tuple [Optional [ str ], Optional [ GeographyType .EdgeAlgorithm ] ]:
104104 if isinstance (geography , str ):
105105 matches = GEOGRAPHY_REGEX .search (geography )
106106 if matches :
@@ -120,7 +120,7 @@ def _parse_geography_type(geography: Any) -> Tuple[str, GeographyType.EdgeAlgori
120120 return geography
121121
122122
123- def _parse_geometry_type (geometry : Any ) -> str :
123+ def _parse_geometry_type (geometry : Any ) -> Optional [ str ] :
124124 if isinstance (geometry , str ):
125125 matches = GEOMETRY_REGEX .search (geometry )
126126 if matches :
@@ -137,7 +137,7 @@ def _parse_geometry_type(geometry: Any) -> str:
137137 return geometry
138138
139139
140- def _raise_if_any_missing_dictionary_key (d : Dict , expected_type : str , * keys : str ):
140+ def _raise_if_any_missing_dictionary_key (d : Dict [ str , str ], expected_type : str , * keys : str ) -> None :
141141 missing_keys = []
142142 for key in keys :
143143 if key not in d :
@@ -960,12 +960,12 @@ def ser_model(self) -> str:
960960 return f"geography({ self .crs or GeographyType .default_crs } , { self .edge_algorithm .value } )"
961961
962962 @property
963- def crs (self ) -> str :
963+ def crs (self ) -> Optional [ str ] :
964964 """Return the crs of the geography."""
965965 return self .root [0 ]
966966
967967 @property
968- def edge_algorithm (self ) -> EdgeAlgorithm :
968+ def edge_algorithm (self ) -> Optional [ EdgeAlgorithm ] :
969969 """Return the algorithm of the geography."""
970970 return self .root [1 ]
971971
@@ -986,7 +986,7 @@ def __hash__(self) -> int:
986986 """Return the hash of the crs."""
987987 return hash (self .root )
988988
989- def __getnewargs__ (self ) -> Tuple [str , EdgeAlgorithm ]:
989+ def __getnewargs__ (self ) -> Tuple [Optional [ str ], Optional [ EdgeAlgorithm ] ]:
990990 """Pickle the GeographyType class."""
991991 return self .crs , self .edge_algorithm
992992
@@ -1021,7 +1021,7 @@ def ser_model(self) -> str:
10211021 return f"geometry({ self .crs } )"
10221022
10231023 @property
1024- def crs (self ) -> str :
1024+ def crs (self ) -> Optional [ str ] :
10251025 """Return the crs of the geometry."""
10261026 return self .root [0 ]
10271027
@@ -1039,7 +1039,7 @@ def __hash__(self) -> int:
10391039 """Return the hash of the crs."""
10401040 return hash (self .root )
10411041
1042- def __getnewargs__ (self ) -> str :
1042+ def __getnewargs__ (self ) -> Tuple [ Optional [ str ]] :
10431043 """Pickle the GeometryType class."""
10441044 return (self .crs , )
10451045
0 commit comments