Add the code num_itemsets=2 to limit the itemset so that the modification becomes
rules = association_rules(frequent_items, metric='confidence',min_threshold=0.7, num_itemsets=2)