Skip to content

feature: Add dataset fetch retry and update tests with new word sets references#64

Merged
pbadillatorrealba merged 2 commits intodevelopfrom
chore/fix_tests
Jul 29, 2025
Merged

feature: Add dataset fetch retry and update tests with new word sets references#64
pbadillatorrealba merged 2 commits intodevelopfrom
chore/fix_tests

Conversation

@pbadillatorrealba
Copy link
Member

@pbadillatorrealba pbadillatorrealba commented Jul 29, 2025

This pull request updates several queries and tests to replace the unpleasant_5 word set with a new unpleasant_5a word set. Additionally, it introduces a new _retry_request function with comprehensive test coverage for retrying network requests. Below is a breakdown of the most important changes grouped by theme:

Query Updates:

  • Updated multiple queries in docs/user_guide/measurement_user_guide.rst and docs/user_guide/mitigation_user_guide.rst to use unpleasant_5a instead of unpleasant_5 for bias measurements. [1] [2] [3] [4]

Test Updates:

  • Updated test fixtures in tests/debias/conftest.py and tests/metrics/conftest.py to reflect the change from unpleasant_5 to unpleasant_5a in various queries. [1] [2] [3] [4]
  • Updated test cases in tests/debias and tests/test_preprocessing.py to ensure compatibility with the new unpleasant_5a word set. [1] [2] [3] [4]

New Retry Functionality:

  • Added _retry_request function in tests/test_datasets.py to handle retries for network requests, including support for exponential backoff and handling specific exceptions like HTTP 429 (rate limit) and timeout errors.
  • Added a comprehensive suite of tests for _retry_request to validate its behavior under various scenarios, such as success on first attempt, rate limit errors, timeout errors, and non-retryable HTTP errors.

Dataset Updates:

  • Updated dataset-related tests in tests/test_datasets.py to include the new unpleasant_5a and unpleasant_5b word sets for validation.

These changes ensure consistency across the codebase for the updated word set and enhance the robustness of network request handling.

@pbadillatorrealba pbadillatorrealba self-assigned this Jul 29, 2025
@pbadillatorrealba pbadillatorrealba added the bug Something isn't working label Jul 29, 2025
Copy link

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 PR updates word set references from unpleasant_5 to unpleasant_5a throughout the codebase to maintain consistency with updated word sets.

Key Changes:

  • Replaced all references to unpleasant_5 with unpleasant_5a across test files, documentation, and utility functions
  • Updated query definitions in test fixtures and conftest files
  • Modified documentation examples to use the new word set reference

Reviewed Changes

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

Show a summary per file
File Description
tests/test_utils.py Updated query definitions to use unpleasant_5a
tests/test_query.py Updated test cases and query objects to reference unpleasant_5a
tests/test_preprocessing.py Updated query fixtures and test functions to use unpleasant_5a
tests/test_datasets.py Updated expected word set list to include unpleasant_5a
tests/metrics/conftest.py Updated query fixtures to use unpleasant_5a
tests/debias/test_multiclass_hard_debias.py Updated attribute list to use unpleasant_5a
tests/debias/test_hard_debias.py Updated attribute list to use unpleasant_5a
tests/debias/test_half_sibling_regression.py Updated attribute list to use unpleasant_5a
tests/debias/test_double_hard_debias.py Updated commented code to use unpleasant_5a
tests/debias/conftest.py Updated query fixtures and labels to use unpleasant_5a
docs/user_guide/mitigation_user_guide.rst Updated documentation examples to use unpleasant_5a
docs/user_guide/measurement_user_guide.rst Updated documentation examples to use unpleasant_5a

@pbadillatorrealba pbadillatorrealba changed the title chore: update test with new word sets references feature: Add dataset fetch retry and update tests with new word sets references Jul 29, 2025
@pbadillatorrealba pbadillatorrealba merged commit 64203b6 into develop Jul 29, 2025
4 checks passed
@pbadillatorrealba pbadillatorrealba deleted the chore/fix_tests branch July 29, 2025 02:40
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.

2 participants