About warning messages during build

I would like to know how to detect warning messages output within the code repository.

If a duplicate record exists in a data frame to be processed in the code repository,
I would like to output warning messages.

Errors during build are monitored by health checks,
When an error occurs, an email is sent through the monitoring_view.

Similarly, we would like to be notified by email when a warning message is output. Is this possible?
Also, is it possible to distinguish between warnings and errors in the case of email?

Hello. You should be able to use Data Expectations to achieve your goal, setting primary key columns.

https://www.palantir.com/docs/foundry/pipeline-builder/dataexpectations-overview/

Data Expectations can be set to WARN (which will allow the build to succeed but create a health check failure) or FAIL (which will cause the entire build to fail).

Data Expectations are configured in code repositories, but create Data Health Checks on datasets that can be set up for notifications in the same way as any other Data Health Check. You can set the check to fail with severity level MODERATE or CRITICAL.

The exact way that a failing health check presents in email depends on the configuration in your particular environment and the level of redaction applied. In general, you should be able to distinguish between severity levels of a failing health check based on the information in the email.