Skip to content

Commit d7de312

Browse files
committed
extensible -> obj in validate_has_extension
1 parent 5b25a43 commit d7de312

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

pystac/extensions/base.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,32 +126,30 @@ def has_extension(cls, obj: S) -> bool:
126126
)
127127

128128
@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:
132130
"""Given a :class:`~pystac.STACObject`, checks if the object has this
133131
extension's schema URI in it's :attr:`~pystac.STACObject.stac_extensions` list.
134132
If ``add_if_missing`` is ``True``, the schema URI will be added to the object.
135133
136134
Args:
137-
extensible : The object to validate.
135+
obj : The object to validate.
138136
add_if_missing : Whether to add the schema URI to the object if the URI is
139137
not already present.
140138
141139
Raises:
142140
STACError : If ``add_if_missing`` is ``True`` and ``extensible`` is None.
143141
"""
144142
if add_if_missing:
145-
if extensible is None:
143+
if obj is None:
146144
raise pystac.STACError(
147145
"Can only add schema URIs to Assets with an owner."
148146
)
149-
cls.add_to(extensible)
147+
cls.add_to(obj)
150148

151-
if extensible is None:
149+
if obj is None:
152150
return
153151

154-
if cls.get_schema_uri() not in extensible.stac_extensions:
152+
if cls.get_schema_uri() not in obj.stac_extensions:
155153
raise pystac.ExtensionNotImplemented(
156154
f"Could not find extension schema URI {cls.get_schema_uri()} in object."
157155
)

0 commit comments

Comments
 (0)