Skip to content

Commit bbef909

Browse files
committed
update to file to simplify some code as well as play nicely with Pydantic without arbitrarily allowing random data types
1 parent 29600ba commit bbef909

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

labelbox/data/annotation_types/data/tiled_image.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,20 @@ class EPSGTransformer(BaseModel):
114114
115115
Requires as input a Point object.
116116
"""
117-
class ProjectionTransformer():
117+
class ProjectionTransformer(Transformer):
118118
"""Custom class to help represent a Transformer that will play
119119
nicely with Pydantic.
120+
121+
Accepts a PyProj Transformer object.
120122
"""
121123
@classmethod
122124
def __get_validators__(cls):
123125
yield cls.validate
124126

125127
@classmethod
126128
def validate(cls, v):
129+
if not isinstance(v, Transformer):
130+
raise Exception("Needs to be a Transformer class")
127131
return v
128132

129133
transform_function: Optional[ProjectionTransformer] = None

0 commit comments

Comments
 (0)