Skip to content

Make Redis connection arguments in repr optional#664

Merged
codingjoe merged 3 commits intomainfrom
redis-repr
Feb 23, 2026
Merged

Make Redis connection arguments in repr optional#664
codingjoe merged 3 commits intomainfrom
redis-repr

Conversation

@codingjoe
Copy link
Copy Markdown
Owner

@codingjoe codingjoe commented Feb 23, 2026

Ref #659

Copilot AI review requested due to automatic review settings February 23, 2026 16:38
@codingjoe codingjoe self-assigned this Feb 23, 2026
@codingjoe codingjoe linked an issue Feb 23, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request improves the Redis health check's __repr__ method to handle cases where connection arguments (host, db) may not be present in the connection_kwargs dictionary.

Changes:

  • Modified __repr__ implementation to iterate over connection_kwargs and filter for host/db keys instead of directly accessing them
  • Removed KeyError from exception handling since the new filtering approach eliminates that possibility
  • Updated test assertions to reflect the new repr format with properly quoted string values

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
health_check/contrib/redis.py Changed repr implementation to filter connection_kwargs for host/db keys, making these parameters optional
tests/contrib/test_redis.py Updated test assertions to match new repr format with quoted host values

Comment thread tests/contrib/test_redis.py
Comment thread health_check/contrib/redis.py Outdated
codingjoe and others added 2 commits February 23, 2026 17:43
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codingjoe codingjoe merged commit fc1e254 into main Feb 23, 2026
26 checks passed
@codingjoe codingjoe deleted the redis-repr branch February 23, 2026 17:10
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.73%. Comparing base (692e0dd) to head (fbf9b66).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##              main     #664      +/-   ##
===========================================
- Coverage   100.00%   99.73%   -0.27%     
===========================================
  Files           13       13              
  Lines          765      763       -2     
===========================================
- Hits           765      761       -4     
- Misses           0        2       +2     
Flag Coverage Δ
python-3.10-django-5.2 50.72% <0.00%> (+0.13%) ⬆️
python-3.10-django-5.2-celery 55.57% <0.00%> (+0.14%) ⬆️
python-3.10-django-5.2-kafka 53.73% <0.00%> (+0.14%) ⬆️
python-3.10-django-5.2-psutil 62.25% <0.00%> (+0.16%) ⬆️
python-3.10-django-5.2-rabbitmq 53.47% <0.00%> (+0.13%) ⬆️
python-3.10-django-5.2-redis 57.01% <100.00%> (-0.38%) ⬇️
python-3.10-django-5.2-rss 69.72% <0.00%> (+0.18%) ⬆️
python-3.11-django-5.2 50.72% <0.00%> (+0.13%) ⬆️
python-3.12-django-5.2 50.72% <0.00%> (+0.13%) ⬆️
python-3.12-django-6.0 50.72% <0.00%> (+0.13%) ⬆️
python-3.13-django-5.2 50.72% <0.00%> (+0.13%) ⬆️
python-3.13-django-6.0 50.72% <0.00%> (+0.13%) ⬆️
python-3.14-django-5.2 50.98% <0.00%> (+0.13%) ⬆️
python-3.14-django-5.2-celery 55.86% <0.00%> (+0.14%) ⬆️
python-3.14-django-5.2-kafka 53.88% <0.00%> (+0.14%) ⬆️
python-3.14-django-5.2-psutil 62.58% <0.00%> (+0.16%) ⬆️
python-3.14-django-5.2-rabbitmq 53.62% <0.00%> (+0.14%) ⬆️
python-3.14-django-5.2-redis 57.31% <100.00%> (-0.38%) ⬇️
python-3.14-django-5.2-rss 70.75% <0.00%> (+0.18%) ⬆️
python-3.14-django-6.0 50.98% <0.00%> (+0.13%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Add label to Redis check

2 participants