Skip to content

fix: bulk data hash generation is broken#12

Merged
AKrantzPS merged 1 commit into
mainfrom
fix/bulk_hash_generation_fails_including_the_lc_id_accidentially
Jun 26, 2026
Merged

fix: bulk data hash generation is broken#12
AKrantzPS merged 1 commit into
mainfrom
fix/bulk_hash_generation_fails_including_the_lc_id_accidentially

Conversation

@AKrantzPS

Copy link
Copy Markdown
Collaborator

This pull request improves the robustness and test coverage of the bulk data collection logic in the Collector class, specifically focusing on how bulk hashes are computed for local columns. The main changes include making the hash calculation ignore the id attribute, handling missing attributes and HTTP errors gracefully, and adding comprehensive tests to cover these scenarios.

FIX: Do not add AoLocalColumn.id to hash generation any more. The Hash generation was broken since the start and should work now.

Bulk hash calculation improvements:

  • The bulk hash computation in _collect_bulk_data now dynamically determines which attributes to include and explicitly skips the id attribute in the hash, ensuring that only relevant data changes affect the hash.

Error handling enhancements:

  • The method now checks for missing required attributes (id or values) and skips hash calculation for those cases, logging a warning instead of failing.
  • HTTP errors during data retrieval are caught and logged, and an error marker is set in the lookup dictionary to indicate the failure.

Test coverage improvements:

  • Multiple new tests are added to test_collect.py to verify:
    • Bulk hash is unaffected by changes to the id field.
    • Bulk hash computation works as expected with valid data.
    • The function properly skips or handles cases with missing attributes or HTTP errors.
    • The hash remains stable when only the id field changes.

Testing utilities:

  • Helper methods and mocking are introduced to simplify the creation of test fixtures and simulate various scenarios for the Collector class. [1] [2]

@AKrantzPS AKrantzPS self-assigned this Jun 26, 2026
@AKrantzPS AKrantzPS added the bug Something isn't working label Jun 26, 2026
@AKrantzPS AKrantzPS merged commit 00ec02d into main Jun 26, 2026
4 checks passed
@AKrantzPS AKrantzPS deleted the fix/bulk_hash_generation_fails_including_the_lc_id_accidentially branch June 26, 2026 10:43
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.

AoLocalColumn values,flags,generation_parameters are not compared correctly

1 participant