Skip to content

Conversation

@LinoGiger
Copy link
Collaborator

No description provided.

@LinoGiger LinoGiger merged commit 96ccc1b into main Jan 26, 2026
2 checks passed
@LinoGiger LinoGiger deleted the feat/RAPID-6780-rename-private-metadata branch January 26, 2026 13:48
@claude
Copy link

claude bot commented Jan 26, 2026

Pull Request Review - PR #453: Rename private_tags to private_metadata

Summary

This PR performs a systematic rename of the private_tags parameter to private_metadata across the codebase. The change affects 6 files with 53 additions and 53 deletions, maintaining a clean 1:1 replacement pattern.


Positive Aspects ✓

  1. Consistent Renaming: The rename is applied consistently across all affected files including:

    • Model definitions (_datapoint.py)
    • Uploader logic (_datapoint_uploader.py)
    • Validators (_datapoints_validator.py)
    • Job managers (job_definition.py, job_manager.py)
    • Order managers (rapidata_order_manager.py)
  2. API Model Already Updated: The generated API client model (create_datapoint_model.py) already uses private_metadata with the correct camelCase alias privateMetadata, indicating backend alignment.

  3. Improved Naming: The new name private_metadata is more descriptive and accurately reflects that this parameter accepts key-value pairs of metadata rather than simple tags.

  4. Documentation Updated: Error messages and docstrings have been appropriately updated (e.g., "Number of private metadata entries must match number of datapoints").


Issues Found 🔴

Critical: Variable Naming Inconsistency

Location: src/rapidata/rapidata_client/datapoints/_datapoints_validator.py:56-73

There's a variable naming inconsistency in the map_datapoints method. While the parameter is correctly renamed to private_metadata, the loop variable is still called private_tag:

# Line 56
private_metadata=private_tag,  # ❌ Inconsistent naming
# Line 59
for asset, context, media_context, sentence, private_tag, group in cast(  # ❌ Should be private_metadata

Recommendation: The loop variable should be renamed from private_tag to private_metadata_item or similar to maintain consistency:

private_metadata=private_metadata_item,
# ...
for asset, context, media_context, sentence, private_metadata_item, group in cast(

Recommendations 📋

1. Missing Test Coverage

  • No test files were modified in this PR
  • Consider adding or updating tests to verify the parameter rename works correctly
  • Verify that existing integration tests still pass with the new parameter name

2. Backwards Compatibility Consideration

Since this is a public API change that affects all job and order creation methods, consider:

  • Breaking Change Documentation: This should be documented in release notes or migration guide as a breaking change
  • Deprecation Period: Alternatively, consider supporting both parameter names temporarily with a deprecation warning for private_tags
  • Version Bump: This warrants at least a minor version bump (or major if following strict semver)

3. Documentation Updates

While docstrings were updated, verify that:

  • User-facing documentation mentions the new parameter name
  • Any example code in docs or README uses private_metadata
  • Migration guide includes this change if creating a new version

Security & Performance ✓

  • No security concerns: This is a pure rename with no logic changes
  • No performance impact: No algorithmic changes introduced
  • Type safety maintained: All type hints remain consistent

Summary

This is a well-executed rename that improves API clarity. The main issue is the inconsistent variable naming in _datapoints_validator.py that should be addressed. Additionally, since this is a breaking API change affecting all public methods, proper version management and migration documentation are essential.

Recommendation: Address the variable naming inconsistency before merging. Consider the backwards compatibility implications for your users.

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.

2 participants