Your question is Deduplicating Records Function. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Hilton Grand Vacations data workflows may receive repeated reservation or member records from multiple source files. Write a function that removes duplicate records based on a specified unique identifier while preserving the order in which identifiers first appear.
Keep the first record encountered for each identifier and discard every later record with the same identifier. The input records are not modified.
Implement deduplicate_records(records, identifier_key).
records is a list of dictionaries.identifier_key is a string naming the identifier field present in every record.def deduplicate_records(records, identifier_key):