From 7d27b910cd891ca6d87121040aca1dd83a462396 Mon Sep 17 00:00:00 2001 From: Michael Hohn Date: Thu, 22 Aug 2024 13:58:07 -0700 Subject: [PATCH] Fix: include CID when filtering in mc-rows-from-mrva-list --- client/qldbtools/bin/mc-rows-from-mrva-list | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/qldbtools/bin/mc-rows-from-mrva-list b/client/qldbtools/bin/mc-rows-from-mrva-list index 8495e6b..1264cf6 100755 --- a/client/qldbtools/bin/mc-rows-from-mrva-list +++ b/client/qldbtools/bin/mc-rows-from-mrva-list @@ -19,9 +19,11 @@ Script to list full details for a mrva-list file ] } 2. reads a pandas dataframe stored in a csv file -3. selects all rows from 2. that contain the 'owner' column matching - the string before the slash from 1. and the 'name' column matching - the string between the slash and the marker 'ctsj' +3. selects all rows from 2. that + - contain the 'owner' column matching the string before the slash from 1. and + - the 'name' column matching the string between the slash and the marker + 'ctsj' and + - the 'CID' column matching the string after the marker 'ctsj' """ import argparse @@ -49,7 +51,8 @@ parsed_mirva_list = [] for item in mirva_list: owner_name = item.split('/')[0] repo_name = item.split('/')[1].split('ctsj')[0] - parsed_mirva_list.append((owner_name, repo_name)) + cid = item.split('/')[1].split('ctsj')[1] + parsed_mirva_list.append((owner_name, repo_name, cid)) #* Step 2: Read the CSV file into a pandas dataframe import pandas as pd @@ -58,7 +61,7 @@ df = pd.read_csv(args.info_csv) #* Step 3: Filter the dataframe based on the parsed "mirva-list" filtered_df = df[ df.apply(lambda row: - (row['owner'], row['name']) in parsed_mirva_list, axis=1)] + (row['owner'], row['name'], row['CID']) in parsed_mirva_list, axis=1)] # Optionally, you can save the filtered dataframe to a new CSV file filtered_df.to_csv(sys.stdout, index=False)