46 lines
1.3 KiB
Markdown
46 lines
1.3 KiB
Markdown
|
|
|
|
## Task: Fix basedpyright pyarrow import errors (2026-02-27)
|
|
|
|
### Problem
|
|
Basedpyright reported 5 errors for missing pyarrow imports in:
|
|
- opengait/demo/pipeline.py (4 errors)
|
|
- tests/demo/test_pipeline.py (1 error)
|
|
|
|
### Solution
|
|
Used `importlib.import_module()` for runtime optional imports instead of static imports.
|
|
|
|
**Pattern for optional dependencies:**
|
|
```python
|
|
import importlib
|
|
|
|
try:
|
|
pa = importlib.import_module("pyarrow")
|
|
pq = importlib.import_module("pyarrow.parquet")
|
|
except ImportError as e:
|
|
raise RuntimeError("Parquet export requires pyarrow...") from e
|
|
```
|
|
|
|
**Pattern for test skip logic:**
|
|
```python
|
|
import importlib.util
|
|
|
|
if importlib.util.find_spec("pyarrow") is not None:
|
|
pytest.skip("pyarrow is installed, skipping missing dependency test")
|
|
```
|
|
|
|
### Benefits
|
|
- No basedpyright errors (0 errors, only warnings)
|
|
- Runtime behavior unchanged
|
|
- Clear error message when pyarrow is missing
|
|
- No TYPE_CHECKING complexity needed
|
|
|
|
### Verification
|
|
- basedpyright: 0 errors, warnings only
|
|
- pytest: 12 passed, 1 skipped
|
|
## 2026-02-27: Task 11 Sample Video Acceptance Closed
|
|
|
|
- Verified `assets/sample.mp4` exists in repository root assets directory.
|
|
- OpenCV validation succeeded: `cap.isOpened()==True` and `frame_count=227` (>=60 requirement).
|
|
- Marked the final three Task 11 acceptance leaf checkboxes to `[x]` in plan.
|