Skip to content

Minor fix for disabling duplication - #25

Merged
PabloPardoGarcia merged 3 commits into
mainfrom
fix/disable-duplication-when-enabled-false
Mar 27, 2026
Merged

PabloPardoGarcia merged 3 commits into
mainfrom
fix/disable-duplication-when-enabled-false

Conversation

@PabloPardoGarcia

@PabloPardoGarcia PabloPardoGarcia commented Mar 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fix DuplicateController being initialised when duplication.enabled is False — duplicates were generated even when the feature was turned off
  • Add TestGenerator with two tests covering the disabled and enabled paths
  • Test names clearly reflect what is being asserted; generate_optimized() is correctly called in the enabled-path test

Closes #21 (supersedes the original PR by @aditypan , which was accidentally closed during a merge conflict resolution).
And fixes #19

Test plan

  • test_duplicate_controller_is_none_when_duplication_disabled — asserts duplicate_controller is None when enabled=False and verifies generate_simple produces correct batches
  • test_duplicate_controller_initialized_when_duplication_enabled — asserts duplicate_controller is not None when enabled=True and verifies generate_optimized produces correct batches

🤖 Generated with Claude Code

PabloPardoGarcia and others added 2 commits March 27, 2026 14:46
Do not initialise DuplicateController when duplication.enabled is False.
Previously the controller was created whenever a duplication config block
was present, regardless of the enabled flag, causing duplicates to be
generated even when the feature was turned off.

Also adds TestGenerator covering both the disabled and enabled paths,
with corrected test names and generate_optimized() called in the
enabled-path test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
glassgen Ready Ready Preview, Comment Mar 27, 2026 1:49pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Coverage

Test Coverage Report
FileStmtsMissCoverMissing
__init__.py60100% 
config.py791186%104–106, 108–109, 111–113, 115, 125–126
interface.py601181%14–16, 40–44, 54, 65–66
generator
   __init__.py50100% 
   batch_controller.py39392%16, 21–22
   duplication.py641281%34, 38–39, 41–43, 45–46, 48–50, 52
   generator.py67494%41, 54, 91, 108
   generators.py1032476%61, 118, 147–149, 151–154, 156–157, 159–161, 163, 170, 172–173, 176, 188, 191, 205, 258, 263
schema
   __init__.py40100% 
   base.py70100% 
   schema.py92792%50, 66, 76–77, 106–107, 132
   user_schema.py16193%30
sinks
   __init__.py130100% 
   base.py90100% 
   csv_sink.py47197%41
   kafka_sink.py281353%20–23, 27–28, 33, 36–38, 43–44, 47
   webhook_sink.py260100% 
   yield_sink.py100100% 
TOTAL6758787% 

@PabloPardoGarcia
PabloPardoGarcia merged commit 534bae8 into main Mar 27, 2026
2 checks passed

This branch was successfully deployed

1 active deployment
Preview — 181ae852 Deployed Mar 27, 2026 by vercel[bot]
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.

Duplicates are generated even when duplication config is disabled

1 participant