Silly98/postgres
020
1import argparse2import sys3sys.path.append(r"C:\Users\FCI\Desktop\engineero_ai\pg-clean-search")4from app.cleaning.pipeline import run_cleaning_from_yaml5 6def main():7 """Defines the command-line interface for the cleaning pipeline."""8 p = argparse.ArgumentParser(9 description="Run an in-place data cleaning pipeline on specified PostgreSQL tables.",10 formatter_class=argparse.RawTextHelpFormatter11 )12 p.add_argument(13 "--cfg", 14 # required=True,15 default="scripts\clean_test.yaml", 16 help="YAML file listing source schema, table names, primary keys, and culprit columns."17 )18 p.add_argument(19 "--batch", 20 type=int, 21 default=1000, 22 help=(23 "If --clean-all=False, this is the maximum number of rows read (LIMIT) and processed (1 batch).\n"24 "If --clean-all=True, this is the chunk size for reading/writing multiple batches."25 )26 )27 p.add_argument(28 "--clean-all", 29 action="store_true", 30 help="Process and clean every row in the table (overrides the LIMIT set by --batch)."31 )32 p.add_argument(33 "--clean_cap",34 type=int,35 # default=20,36 help="Maximum number of rows to clean per table."37 )38 39 args = p.parse_args()40 41 run_cleaning_from_yaml(42 args.cfg,43 batch_size=args.batch,44 clean_all=args.clean_all,45 clean_cap=args.clean_cap, # ← MUST PASS THIS46 )47 48if __name__ == "__main__":49 main()50 