dataset_pseudonymizer_5.py 993 B

123456789101112131415161718192021222324252627
  1. def _pseudonymize_csv(
  2. input_csv_path: str,
  3. identifier_unit_id_type: Union[str, None],
  4. measure_unit_id_type: Union[str, None],
  5. job_id: str
  6. ) -> str:
  7. if identifier_unit_id_type and not measure_unit_id_type:
  8. logger.info('Pseudonymizing identifier')
  9. return _pseudonymize_identifier_only(
  10. input_csv_path, identifier_unit_id_type, job_id
  11. )
  12. elif measure_unit_id_type and not identifier_unit_id_type:
  13. logger.info('Pseudonymizing measure')
  14. return _pseudonymize_measure_only(
  15. input_csv_path, measure_unit_id_type, job_id
  16. )
  17. elif identifier_unit_id_type and measure_unit_id_type:
  18. logger.info('Pseudonymizing identifier and measure')
  19. return _pseudonymize_identifier_and_measure(
  20. input_csv_path,
  21. identifier_unit_id_type,
  22. measure_unit_id_type,
  23. job_id
  24. )
  25. else:
  26. logger.info('No pseudonymization')
  27. return input_csv_path