Skip to content

Commit 3fbaf4d

Browse files
committed
refactor(ingestor-api): rename file & class to make project-agnostic (#24)
1 parent 6cc4936 commit 3fbaf4d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/ingestor-api/runtime/src/collection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from .schemas import StacCollection
77
from .utils import get_db_credentials
8-
from .vedaloader import VEDALoader
8+
from .loader import Loader
99

1010

1111
def ingest(collection: StacCollection):
@@ -17,7 +17,7 @@ def ingest(collection: StacCollection):
1717
try:
1818
creds = get_db_credentials(os.environ["DB_SECRET_ARN"])
1919
with PgstacDB(dsn=creds.dsn_string, debug=True) as db:
20-
loader = VEDALoader(db=db)
20+
loader = Loader(db=db)
2121
loader.load_collection(file=collection, insert_mode=Methods.upsert)
2222
except Exception as e:
2323
print(f"Encountered failure loading collection into pgSTAC: {e}")
@@ -29,5 +29,5 @@ def delete(collection_id: str):
2929
"""
3030
creds = get_db_credentials(os.environ["DB_SECRET_ARN"])
3131
with PgstacDB(dsn=creds.dsn_string, debug=True) as db:
32-
loader = VEDALoader(db=db)
32+
loader = Loader(db=db)
3333
loader.delete_collection(collection_id)

lib/ingestor-api/runtime/src/vedaloader.py renamed to lib/ingestor-api/runtime/src/loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""Utilities to bulk load data into pgstac from json/ndjson."""
22
import logging
33

4-
from pypgstac.load import Loader
4+
from pypgstac.load import Loader as BaseLoader
55

66
logger = logging.getLogger(__name__)
77

88

9-
class VEDALoader(Loader):
9+
class Loader(BaseLoader):
1010
"""Utilities for loading data and updating collection summaries/extents."""
1111

1212
def __init__(self, db) -> None:

lib/ingestor-api/runtime/src/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pypgstac.load import Methods
1010

1111
from .schemas import Ingestion
12-
from .vedaloader import VEDALoader
12+
from .loader import Loader
1313

1414

1515
class DbCreds(pydantic.BaseModel):
@@ -61,7 +61,7 @@ def load_items(creds: DbCreds, ingestions: Sequence[Ingestion]):
6161
Bulk insert STAC records into pgSTAC.
6262
"""
6363
with PgstacDB(dsn=creds.dsn_string, debug=True) as db:
64-
loader = VEDALoader(db=db)
64+
loader = Loader(db=db)
6565

6666
items = [
6767
# NOTE: Important to deserialize values to convert decimals to floats

0 commit comments

Comments
 (0)