Skip to content

Test for yaml config for custom recognizers#1720

Merged
omri374 merged 2 commits intomainfrom
omri/issue_1696_test
Sep 10, 2025
Merged

Test for yaml config for custom recognizers#1720
omri374 merged 2 commits intomainfrom
omri/issue_1696_test

Conversation

@omri374
Copy link
Copy Markdown
Collaborator

@omri374 omri374 commented Sep 10, 2025

Change Description

Testing that custom recognizers can be successfully defined in YAML through the AnalyzerEngineProvider

Issue reference

Fixes #1696

Checklist

  • I have reviewed the contribution guidelines
  • I have signed the CLA (if required)
  • My code includes unit tests
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds test coverage for custom recognizers defined via YAML configuration through the AnalyzerEngineProvider. The primary purpose is to validate that custom pattern-based recognizers can be successfully loaded and utilized from YAML configuration files.

  • Adds a new test function to verify custom recognizer functionality
  • Creates a YAML configuration file defining a ZIP code recognizer with patterns and context
  • Imports PatternRecognizer class to support the new test functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
presidio-analyzer/tests/test_analyzer_engine_provider.py Adds import for PatternRecognizer and new test function for custom recognizer validation
presidio-analyzer/tests/conf/custom_recognizer_yaml.yaml New YAML configuration file defining a ZIP code recognizer with pattern matching and context

@omri374 omri374 merged commit 5312d32 into main Sep 10, 2025
34 checks passed
@omri374 omri374 deleted the omri/issue_1696_test branch September 10, 2025 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context in recognizer YAML is ignored when scoring matches

3 participants