demand_id.py 378 B

12345678910111213141516
  1. """脚本主驱需求 demand_id 生成。"""
  2. from __future__ import annotations
  3. import hashlib
  4. def build_gap_script_demand_id(
  5. *,
  6. strategy: str,
  7. demand_name: str,
  8. partition_dt: str,
  9. ) -> str:
  10. """md5(concat(strategy, demand_name, partition_dt))"""
  11. raw = f"{strategy}{demand_name}{partition_dt}"
  12. return hashlib.md5(raw.encode("utf-8")).hexdigest()