Define simple local runner

This commit is contained in:
Daniel Roth 2026-01-16 17:28:28 +00:00
parent b808f132a8
commit b1aca16be0
6 changed files with 51 additions and 1 deletions

View file

@ -16,4 +16,5 @@ uvicorn[standard]
sqlmodel
# Testing
pytest==9.0.2
pytest-cov==7.0.0
pytest-cov==7.0.0
ipykernel>=6.25,<7

2
.gitignore vendored
View file

@ -242,6 +242,8 @@ fabric.properties
local_data/*
/local_data/*
etl/epc/local_data/*
/backend/condition/sample_data/lbwf/*
/backend/condition/sample_data/peadody/*
*.DS_Store
infrastructure/terraform/.terraform*

View file

View file

@ -0,0 +1,16 @@
from typing import Mapping, Any
from io import BytesIO
from utils.logger import setup_logger
from ingestion.processor import process_file
logger = setup_logger()
def handler(event: Mapping[str, Any], context: Any) -> None:
# Temporary stub for PoC wiring
dummy_stream = BytesIO(b"")
source_key = event.get("source_key", "unknown-source")
process_file(dummy_stream, source_key)

View file

@ -0,0 +1,6 @@
from typing import BinaryIO, List
from utils.logger import setup_logger
def process_file(file_stream: BinaryIO, source_key: str) -> None:
print(f"[processor] Received file: {source_key}")

View file

@ -0,0 +1,25 @@
from pathlib import Path
from ingestion.processor import process_file
def main() -> None:
try:
# Works in scripts / debugger / pytest
ROOT_DIR = Path(__file__).resolve().parents[1]
except NameError:
# __file__ is not defined in notebooks
ROOT_DIR = Path.cwd()
path: Path = ROOT_DIR / "condition" / "sample_data"
lbwf_path: Path = path / "lbwf" / "LBWF - Example Asset Data September 2025.xlsx" # TODO: get this from s3 as part of devcontainer init
with lbwf_path.open("rb") as f:
process_file(
file_stream=f,
source_key=lbwf_path.as_posix(),
)
if __name__ == "__main__":
main()