CleanGuestlineTask
The CleanGuestlineTask converts Guestline raw models into the standard Clean* models used across our ETL framework. The task is Queensway-specific (Guestline chain) and contains bespoke mapping logic and additional fields used by Queensway.
Overview
This task:
- Reads
RawRoompicksModelandRawPersonprofilesModelas inputs - Standardizes reservation, guest, and room fields according to the shared schema
- Adds Queensway-specific fields (
queensway_exclude_from_mailings,queensway_exclude_from_thirdparty_mailings) - Creates
guest_idUUID mapping (ensures a one-to-one mapping between OG IDs and internal UUIDs) - Explodes
ratelinesto produce daily room revenue records - Performs tie-breaking logic for duplicate reservations using status priority and last edited timestamp
Flow Diagram
Requires
RawRoompicksModelRawPersonprofilesModel
Provides
CleanGuestModelCleanReservationModelCleanRoomModel
Notable Transformations
- Status mapping to standard codes (
CHKO→checked_out,CAN→cancelled, etc.) - Aggregate ratelines and evenly spread revenue across stay dates
- Generate
res_idandguest_idUUIDs where missing - Map property IDs to property names using the
JobContextlookup - Standardize guest fields (names, address, email, phone) and run cleaning helpers for country, email, and phone
Best Practices
- Use
sync_datesto limit data processed during development - Use
profilereffallback logic when guest profile lookups are missing - Monitor checkpoint/repartition settings when running at scale
Downstream Tasks
ProcessingTask— depends on the cleaned models as inputs
Last updated on