Skip to content

Commit c24c677

Browse files
committed
fix: replace missing utils.extract_item_id with inline implementation
Use urlparse to extract item_id from source_url, matching the implementation in convert.py
1 parent 81a1bab commit c24c677

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/register.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import tempfile
1111
import time
1212
from pathlib import Path
13+
from urllib.parse import urlparse
1314

1415
import httpx
1516
from augment_stac_item import augment
@@ -23,7 +24,6 @@
2324
from pystac import Item
2425
from register_stac import register_item
2526
from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential
26-
from utils import extract_item_id
2727

2828

2929
def check_item_exists(stac_api_url: str, collection: str, item_id: str) -> bool:
@@ -79,7 +79,7 @@ def run_registration(
7979
RegistrationError: If registration fails after retries
8080
"""
8181
# Set up contextual logging
82-
item_id = extract_item_id(source_url)
82+
item_id = urlparse(source_url).path.rstrip("/").split("/")[-1]
8383
context = ContextLogger(logging.getLogger("pipeline.register"), {"item_id": item_id})
8484

8585
context.info("=" * 78)

0 commit comments

Comments
 (0)