pyrit.common.warn_if_set

Contents

pyrit.common.warn_if_set#

warn_if_set(*, config: ~typing.Any, unused_fields: ~typing.List[str], log: ~logging.Logger | ~logging.LoggerAdapter = <Logger pyrit.common.utils (WARNING)>) None[source]#

Utility method to warn about unused parameters in configurations.

This method checks if specified fields in a configuration object are set (not None and not empty for collections) and logs a warning message for each field that will be ignored by the current attack strategy.

Parameters:
  • config (Any) – The configuration object to check for unused fields.

  • unused_fields (List[str]) – List of field names to check in the config object.