What PySpark transformations have you implemented in your recent projects?
Implement the equivalent transformation pipeline as transform_records(records): filter records with status == "completed" and amount > 0, aggregate total amount and record count by category, then return results sorted by category.
Input records are dictionaries with category, amount, and status. Return dictionaries containing category, total_amount, and count.
Example: [{'category':'A','amount':10,'status':'completed'}] returns [{'category':'A','total_amount':10,'count':1}].
def transform_records(records):