#!/usr/bin/env python3
"""手动补全 demand_video_expansion 缺失的 point_desc。

用法:
    python jobs/backfill_demand_video_expansion_point_desc.py
    python jobs/backfill_demand_video_expansion_point_desc.py 20260721
    python jobs/backfill_demand_video_expansion_point_desc.py 20260721 --dry-run
"""
from __future__ import annotations

import logging
import sys
from pathlib import Path

_ROOT = Path(__file__).resolve().parents[1]
if str(_ROOT) not in sys.path:
    sys.path.insert(0, str(_ROOT))

from scripts.backfill_demand_video_expansion_point_desc import backfill_missing_point_descs

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
)


def main(biz_dt: str | None = None, *, dry_run: bool = False) -> dict:
    result = backfill_missing_point_descs(biz_dt, dry_run=dry_run)
    print(result)
    return result


if __name__ == "__main__":
    args = sys.argv[1:]
    biz_dt_arg = args[0] if args and not args[0].startswith("-") else None
    main(biz_dt_arg, dry_run="--dry-run" in args)
