"""Collection of functions used to transform data for Proper feeds. Functions used in data transformation, specified in config.py CHANGED_RELEASES_MAP and consumed by proper.py during CSV construction. *** PLEASE FOLLOW THE FOLLOWING METHOD SIGNATURE CONVENTION *** def transform_field(field_value, **kwargs): You may then pull your dependent values from kwargs by the keys defined in CHANGED_RELEASES_MAP 'depends' list. """ def transform_deletion_status(deletion_status, **kwargs): """Transform Orchard Deletion Status. Transform to deletion_type code expected by Proper. See TD here: https://docs.google.com/document/d/1NM0iNPN2sXEnr9-nhWp6zRAQ0w 0c4qP9OBMV4nwfM30/edit#heading=h.cc9m6fszncis Args: deletion_status (str): 'Y' for deleted, 'N' otherwise. kwargs (dict): NOT USED - necessary for transform function contract. Returns: str: 'D3' for deleted, 'D0' for undeleted. """ if deletion_status == 'Y': return 'D3' elif deletion_status == 'N': return 'D0' return ''