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

Parse port_search_count as an int #1114

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

maxhully
Copy link

Chore that needs to be done:

  • Add newsfragment pipenv run towncrier create [issue_number].[type].rst

Types are defined in the pyproject.toml, issue_number either from issue tracker or the Pull request number


load_paths = detect_paths(get_postgresql_option("load"))

return PostgresqlConfigDict(
exec=get_postgresql_option("exec"),
host=get_postgresql_option("host"),
port=get_postgresql_option("port"),
port_search_count=get_postgresql_option("port_search_count"),
# Parse as int, because if it's defined in an INI file then it'll always be a string
port_search_count=int(get_postgresql_option("port_search_count", default=5)),
Copy link
Member

Choose a reason for hiding this comment

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

I'd defer to keeping all defaults in single place either defaults for ini or here

Copy link
Author

Choose a reason for hiding this comment

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

Sounds good! I'll keep them in INI. This should also fix the bug where my return request.config.getoption(name) or request.config.getini(name) or default code was returning None for any falsey config setting

Copy link
Author

Choose a reason for hiding this comment

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

(I could change it to be more careful about only coalescing when request.config.getoption(name) is None)

@maxhully maxhully requested a review from fizyk April 1, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants