|
|
@@ -79,8 +79,10 @@ def parse_args() -> argparse.Namespace:
|
|
|
description="Run DemandAgent from Hive gap rows and write only MySQL demand_content."
|
|
|
)
|
|
|
parser.add_argument("--execution-id", type=int, default=None, help="Existing PG pattern_mining_execution.id")
|
|
|
+ parser.add_argument("--skip-categories", type=int, default=0, help="Skip the first N Hive gap categories")
|
|
|
parser.add_argument("--max-categories", type=int, default=None, help="Only run the first N gap categories")
|
|
|
parser.add_argument("--max-total-count", type=int, default=None, help="Cap total requested demand count")
|
|
|
+ parser.add_argument("--per-category-count", type=int, default=None, help="Override each selected gap row count")
|
|
|
parser.add_argument("--run-label-prefix", default=None, help="Prefix stored in ext_data.run_label")
|
|
|
parser.add_argument("--dry-run", action="store_true", help="Print gap plan only; do not call the agent")
|
|
|
return parser.parse_args()
|
|
|
@@ -99,6 +101,8 @@ async def async_main() -> dict[str, Any]:
|
|
|
_validate_execution_success(int(execution_id))
|
|
|
|
|
|
gap_rows = get_demand_merge_level2_names()
|
|
|
+ if args.skip_categories:
|
|
|
+ gap_rows = gap_rows[max(int(args.skip_categories), 0):]
|
|
|
if args.max_categories is not None:
|
|
|
gap_rows = gap_rows[: max(int(args.max_categories), 0)]
|
|
|
|
|
|
@@ -109,6 +113,8 @@ async def async_main() -> dict[str, Any]:
|
|
|
|
|
|
for index, row in enumerate(gap_rows, start=1):
|
|
|
requested = int(row.get("count") or 0)
|
|
|
+ if args.per_category_count is not None:
|
|
|
+ requested = max(int(args.per_category_count), 0)
|
|
|
if remaining is not None:
|
|
|
if remaining <= 0:
|
|
|
break
|