Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(targets): Targets now accept a batch_size_rows setting to configure how many rows are loaded in each record batch #2248

Merged

Conversation

BuzzCutNorman
Copy link
Contributor

@BuzzCutNorman BuzzCutNorman commented Feb 15, 2024

This feature will allow target users the ability to set the batch size used to triggers a drain via the target's meltano confiig.

batch_size_rows: 100000

When a batch is full and a drain is triggered, the message logged will now state the size of the batch so the users has a visual confirmation that the batch size they configured is being utilized.

The code for this PR was pulled out of PR 1876.

Closes #2155


📚 Documentation preview 📚: https://meltano-sdk--2248.org.readthedocs.build/en/2248/

@BuzzCutNorman BuzzCutNorman changed the title feat(target): Configurable batch size limit for targets feat(targets): Configurable batch size limit for targets Feb 15, 2024
Copy link

codspeed-hq bot commented Feb 15, 2024

CodSpeed Performance Report

Merging #2248 will not alter performance

Comparing BuzzCutNorman:2155-target-set-batch-size-rows (ea048a5) with main (0285704)

Summary

✅ 6 untouched benchmarks

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0285704) 88.54% compared to head (ea048a5) 88.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2248      +/-   ##
==========================================
+ Coverage   88.54%   88.56%   +0.01%     
==========================================
  Files          54       54              
  Lines        4724     4730       +6     
  Branches      920      921       +1     
==========================================
+ Hits         4183     4189       +6     
  Misses        380      380              
  Partials      161      161              

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

@BuzzCutNorman
Copy link
Contributor Author

@pnadolny13 and @edgarrmondragon I broke out the code from pr 1876 that gives the user of a target the ability to set the batch size in rows which triggers a drain. Please take a look and let me know what you think.

BuzzCutNorman and others added 2 commits February 19, 2024 11:31
Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>
Copy link
Collaborator

@edgarrmondragon edgarrmondragon left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time for extracting this into its own PR @BuzzCutNorman!

@BuzzCutNorman
Copy link
Contributor Author

BuzzCutNorman commented Feb 19, 2024

@edgarrmondragon Thanks 🙏 for all of the comment and documentation edits. Loads better 🥳 than what I had. 🎉

@edgarrmondragon edgarrmondragon changed the title feat(targets): Configurable batch size limit for targets feat(targets): Targets now accept a batch_size_rows setting to configure how many rows are loaded in each record batch Feb 20, 2024
@edgarrmondragon edgarrmondragon added this pull request to the merge queue Feb 23, 2024
Merged via the queue into meltano:main with commit 3e2c3d3 Feb 23, 2024
30 checks passed
edgarrmondragon added a commit that referenced this pull request Mar 6, 2024
…igure how many rows are loaded in each record batch (#2248)

* added batch_size_rows tests to target

* add batch_size_rows test to test target sql

* added batch size row to target capabilities

* add batch_size_rows to target as a bulitin config

* added code for batch_size_rows

* Apply suggestions from code review

Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>

* applied documentaion update from review to max_size

* Update singer_sdk/sinks/core.py

* Update singer_sdk/sinks/core.py

* chore: Link to `batch_size_rows` attribute docs

* Update `batch_size_rows` docs

---------

Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>
Co-authored-by: Edgar Ramírez-Mondragón <edgarrm358@gmail.com>
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.

feat: allow target MAX_SIZE_DEFAULT to be externally configurable
2 participants