Skip to content

Fix csv generate by limit#1615

Merged
kingthorin merged 2 commits intodatafaker-net:mainfrom
abudevich:fix-csv-generate
Aug 19, 2025
Merged

Fix csv generate by limit#1615
kingthorin merged 2 commits intodatafaker-net:mainfrom
abudevich:fix-csv-generate

Conversation

@abudevich
Copy link
Copy Markdown
Contributor

@abudevich abudevich commented Aug 18, 2025

Fixed an issue in the CSV generation logic where an extra data row was being added. The output now contains the correct number of rows based on the input.

Changes:

Adjusted CSV generation to prevent adding an unnecessary row.

Added/updated tests to verify the correct number of rows.

Before:
CSV file had N + 1 rows instead of N

After:
CSV file has exactly N rows as expected

@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Aug 18, 2025

PR Summary

  • Adjustment of Data Generation Method
    The code changes in this PR focus on adjusting how our system generates CSV (Comma Separated Value) data. Specifically, the modifications occur in the 'generate' method found in FakeValuesService.java. Prior to these changes, the system was adding a value of '1' to the 'limit' parameter during CSV data creation, which could cause inaccuracies or mismatches in data. With this alteration, we are removing this additional '1', ensuring the data generated aligns with the intended data limits set by the user.

  • Improvement of Initialization for Testing
    Another improvement is made concerning how we prepare for testing our system. This change takes place in FakerTest.java. Here, the way we initialize variables numberOfLinesFull and numberOfLinesShort is updated to account for potential empty csvFullExpression scenarios. These scenarios could previously lead to errors or incorrect test results. Now, with these updates, the system will be able to handle these situations accurately, setting both counts accordingly. This will lead to more reliable and accurate test outcomes, aiding in maintaining the quality of our application.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.36%. Comparing base (caf59bb) to head (51b2f04).
⚠️ Report is 2 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1615      +/-   ##
============================================
- Coverage     92.42%   92.36%   -0.07%     
+ Complexity     3358     3355       -3     
============================================
  Files           331      331              
  Lines          6618     6618              
  Branches        655      655              
============================================
- Hits           6117     6113       -4     
- Misses          346      347       +1     
- Partials        155      158       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kingthorin kingthorin merged commit eb179f2 into datafaker-net:main Aug 19, 2025
@asolntsev asolntsev added this to the 2.4.5 milestone Aug 19, 2025
@asolntsev asolntsev added the bug Something isn't working label Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants