File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -126,32 +126,30 @@ def has_extension(cls, obj: S) -> bool:
126
126
)
127
127
128
128
@classmethod
129
- def validate_has_extension (
130
- cls , extensible : Optional [S ], add_if_missing : bool
131
- ) -> None :
129
+ def validate_has_extension (cls , obj : Optional [S ], add_if_missing : bool ) -> None :
132
130
"""Given a :class:`~pystac.STACObject`, checks if the object has this
133
131
extension's schema URI in it's :attr:`~pystac.STACObject.stac_extensions` list.
134
132
If ``add_if_missing`` is ``True``, the schema URI will be added to the object.
135
133
136
134
Args:
137
- extensible : The object to validate.
135
+ obj : The object to validate.
138
136
add_if_missing : Whether to add the schema URI to the object if the URI is
139
137
not already present.
140
138
141
139
Raises:
142
140
STACError : If ``add_if_missing`` is ``True`` and ``extensible`` is None.
143
141
"""
144
142
if add_if_missing :
145
- if extensible is None :
143
+ if obj is None :
146
144
raise pystac .STACError (
147
145
"Can only add schema URIs to Assets with an owner."
148
146
)
149
- cls .add_to (extensible )
147
+ cls .add_to (obj )
150
148
151
- if extensible is None :
149
+ if obj is None :
152
150
return
153
151
154
- if cls .get_schema_uri () not in extensible .stac_extensions :
152
+ if cls .get_schema_uri () not in obj .stac_extensions :
155
153
raise pystac .ExtensionNotImplemented (
156
154
f"Could not find extension schema URI { cls .get_schema_uri ()} in object."
157
155
)
You can’t perform that action at this time.
0 commit comments