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

Generation max_workers defaults to None if omitted from config file #435

Merged
merged 3 commits into from
Nov 22, 2023

Conversation

ppinchuk
Copy link
Collaborator

Mostly a QOL change - it has no impact if the user explicitly specifies max_workers in their config file. However, if the user omits this input from their config file altogether, the default value is set to None instead of 1. The default value for the API is still 1.

@ppinchuk ppinchuk requested a review from grantbuster November 21, 2023 23:17
@ppinchuk ppinchuk changed the title Generation max_workers default to None if omitted from config ffile Generation max_workers defaults to None if omitted from config file Nov 21, 2023
Copy link
Member

@grantbuster grantbuster left a comment

Choose a reason for hiding this comment

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

Nice way to preserve the config default vs. python default, but where does the max_workers=None default get set? I see that .setdefault() call but does that assume None? Is there a corresponding GAPs PR?

@ppinchuk
Copy link
Collaborator Author

Yea the setdefault() function will add the key to the dictionary if it's missing with a value of None by default. If the key is in the dictionary, the function just returns the value and leaves the dictionary unchanged.

No need for any new GAPs functionality - we simply perform a pre-processing check on the config and force a default value if needbe.

@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2763063) 87.00% compared to head (ec710b6) 87.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #435      +/-   ##
==========================================
+ Coverage   87.00%   87.07%   +0.06%     
==========================================
  Files         122      122              
  Lines       17016    17057      +41     
==========================================
+ Hits        14805    14852      +47     
+ Misses       2211     2205       -6     
Flag Coverage Δ
unittests 87.07% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@ppinchuk ppinchuk merged commit ed82907 into main Nov 22, 2023
8 checks passed
@ppinchuk ppinchuk deleted the pp/gen_mw_default branch November 22, 2023 00:49
github-actions bot pushed a commit that referenced this pull request Nov 22, 2023
Generation `max_workers` defaults to `None` if omitted from config file
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.

3 participants