Skip to content

v1.3.2 - #240

Merged
yedidyakfir merged 99 commits into
mainfrom
develop
May 20, 2026
Merged

v1.3.2#240
yedidyakfir merged 99 commits into
mainfrom
develop

Conversation

@yedidyakfir

@yedidyakfir yedidyakfir commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added RedisSet special field type for unordered, unique-member set operations with async/sync methods including add, remove, clear, contains, members, size, and set algebra (union, intersect, difference).
  • Bug Fixes

    • Fixed special-field key generation for nested fields.
    • Improved special-field batching for generic type support.
  • Documentation

    • Added comprehensive Redis Set API reference and usage guide.
    • Updated CHANGELOG with v1.3.2 release notes.
  • Breaking Changes

    • mark_actions now uses MarkVersion enum (defaults to V2).
    • Modified exclude=True field handling behavior.

…ck excluded field are not converting to redis types
…ated a list of all the sub fields that contains sf to load
…ate aget model - if there are sf fields, we load with pipeline
…ck if atmoic model needs to be updated as contains sf
…apply additional data in the inejct function
YedidyaHKfir and others added 22 commits May 19, 2026 15:43
…ed tests to see that when we manipulate local changes, it doesn't raises an error for redis action
…ed test for sync methods - check they act normally for no pipeline
…ed test that sync action raise normally when we not in redis context
…reign-keys-atomic-models] - ensure deepcopy of datetime fields
…reign-keys-atomic-models] - type is the same as factory
…reign-keys-atomic-models] - update the action groups
…reign-keys-atomic-models] - added tests to check 2 sf fields in the same model
…reign-keys-atomic-models] - we send full path for sf key
…reign-keys-atomic-models] - update change log
…edisset-data-structure-as-a-special-field-type

Add RedisSet special field type (closes #236)
name: str = "test"
secret: str = Field(default="hidden", exclude=True)

model = ModelWithExcludedField(name="my_model", secret="should_not_appear")
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1cf38c33-d26a-4ce1-94a6-12dae35f2353

📥 Commits

Reviewing files that changed from the base of the PR and between 0898c02 and e537755.

📒 Files selected for processing (74)
  • CHANGELOG.md
  • benchmarks/models.py
  • benchmarks/test_pipeline.py
  • benchmarks/test_pipeline_multi_model.py
  • benchmarks/test_redis_set.py
  • docs/api/redis-set.md
  • docs/documentation/special-fields/redis-set.md
  • mkdocs.yml
  • rapyer/actions.py
  • rapyer/base.py
  • rapyer/errors/__init__.py
  • rapyer/errors/base.py
  • rapyer/types/__init__.py
  • rapyer/types/base.py
  • rapyer/types/byte.py
  • rapyer/types/convert.py
  • rapyer/types/datetime.py
  • rapyer/types/dct.py
  • rapyer/types/float.py
  • rapyer/types/generic.py
  • rapyer/types/init.py
  • rapyer/types/integer.py
  • rapyer/types/lst.py
  • rapyer/types/priority_queue.py
  • rapyer/types/redis_set.py
  • rapyer/types/special.py
  • rapyer/types/string.py
  • rapyer/utils/pythonic.py
  • rapyer/utils/redis.py
  • tests/action_groups.py
  • tests/conftest.py
  • tests/coverage_helpers.py
  • tests/integration/actions/async_action.py
  • tests/integration/actions/atomic/test_delete.py
  • tests/integration/actions/atomic/test_duplicate.py
  • tests/integration/actions/atomic/test_find.py
  • tests/integration/actions/atomic/test_insert.py
  • tests/integration/actions/atomic/test_pipeline.py
  • tests/integration/actions/atomic/test_refresh_ttl.py
  • tests/integration/actions/atomic/test_save.py
  • tests/integration/actions/atomic/test_set_ttl.py
  • tests/integration/actions/atomic/test_update.py
  • tests/integration/actions/base.py
  • tests/integration/actions/comprehensive.py
  • tests/integration/actions/create.py
  • tests/integration/actions/read.py
  • tests/integration/actions/redis_types/test_bytes.py
  • tests/integration/actions/redis_types/test_datetime.py
  • tests/integration/actions/redis_types/test_dict.py
  • tests/integration/actions/redis_types/test_float.py
  • tests/integration/actions/redis_types/test_int.py
  • tests/integration/actions/redis_types/test_list.py
  • tests/integration/actions/redis_types/test_pq.py
  • tests/integration/actions/redis_types/test_set.py
  • tests/integration/actions/redis_types/test_str.py
  • tests/integration/actions/sync_action.py
  • tests/integration/actions/ttl.py
  • tests/integration/actions/two_model_delete.py
  • tests/integration/actions/update.py
  • tests/integration/functioninality/assertions.py
  • tests/integration/functioninality/test_comprehensive_model_roundtrip.py
  • tests/integration/special_types/adapters.py
  • tests/integration/special_types/test_nested_same_name_pq.py
  • tests/integration/special_types/test_priority_queue_model_actions.py
  • tests/integration/special_types/test_redis_set.py
  • tests/models/collection_types.py
  • tests/models/pickle_types.py
  • tests/models/registry.py
  • tests/models/special_types.py
  • tests/unit/mark_actions/conftest.py
  • tests/unit/mark_actions/test_sync_passthrough.py
  • tests/unit/models/test_model_dump.py
  • tests/unit/types/simple_types/test_initialization.py
  • tests/unit/types/test_special_types.py

📝 Walkthrough

Walkthrough

Implements RedisSet special field with docs/tests; refactors AtomicRedisModel loads/deletes for nested special fields; introduces MarkVersion enum with v2 default and updates decorators; revises Pydantic conversion/generic handling; broad test infra changes; new benchmarks; changelog and mkdocs updates.

Changes

Core: SF-aware loading, keying, and MarkVersion

Layer / File(s) Summary
Action marking: MarkVersion enum and v2 default
rapyer/actions.py
Adds MarkVersion and defaults mark_actions to V2, updating docs and conditionals.
AtomicRedisModel SF-aware load/find/delete
rapyer/base.py
Tracks contained SFs, plans/executes pipeline loads, injects SF data, expands deletions, adds adelete().
Special-field keying, errors, and utilities
rapyer/types/special.py, rapyer/errors/*, rapyer/utils/*
Moves key builder into SpecialFieldType, adds errors, and provides inject_at_paths and SF-load helpers.

RedisSet special field and nested SFs

Layer / File(s) Summary
RedisSet implementation and Pydantic integration
rapyer/types/redis_set.py, rapyer/types/{__init__,init}.py
Implements RedisSet[T] with sync/async ops, schema integration, lifecycle, and registration.
Docs and navigation for RedisSet
docs/api/redis-set.md, docs/documentation/special-fields/redis-set.md, mkdocs.yml
Adds API and usage docs; links in site navigation.
Benchmarks for RedisSet operations
benchmarks/test_redis_set.py
Benchmarks add/remove/contains/size/members/clear and set algebra across TTL modes.
Integration tests for RedisSet and optional mapping
tests/integration/actions/redis_types/test_set.py
Covers async and sync behaviors, optional/auto-mapped fields, TTL, and algebra.
Model fields and registry for RedisSet
tests/models/*, tests/integration/special_types/adapters.py
Adds labels: RedisSet[str], adapters, and registers test models.
PriorityQueue serialization + nested key path tests
rapyer/types/priority_queue.py, tests/integration/special_types/*
Switches PQ serialization via adapters and validates nested special_key paths.

Decorator metadata migration across types

Layer / File(s) Summary
Bytes, Int, Float decorator updates
rapyer/types/{byte,integer,float}.py
Removes version="v2" from decorators; logic unchanged.
Datetime and String in-place ops marking
rapyer/types/{datetime,string}.py
Updates decorators for in-place arithmetic/append.
List/Dict decorators and tolerant deletes
rapyer/types/{lst,dct}.py
Standardizes decorators; dict local deletions now tolerant; list apop marked as READ.

Pydantic conversion and GenericRedisType

Layer / File(s) Summary
RedisConverter changes and new GenericRedisType
rapyer/types/{convert,generic,base}.py
Preserves generics, always sets adapters, adds GenericRedisType with dual-schema strategy.

Test infra, coverage, and bases

Layer / File(s) Summary
Coverage markers and method collection
tests/{coverage_helpers,action_groups,conftest}.py
Adds COVER_* markers and refactors discovery to include sync/async knobs.
Async/Sync action test bases and read/ttl/update/create scaffolds
tests/integration/actions/*base.py,read.py,ttl.py,update.py,create.py
Adds Async/Sync bases, stale-mirror pipeline test, clobber hooks, and expected-output helpers.
Unit tests for mark_actions and model/type init/dump
tests/unit/*
Migrates to MarkVersion enum, adds exclude=True conversion/dump tests, and updates PQ dump expectation.

Integration tests across actions and Redis types

Layer / File(s) Summary
Atomic insert/delete/duplicate/find/pipeline/save/ttl/update
tests/integration/actions/atomic/*
Shifts to async bases, adds skip markers, and helper hooks across suites.
Redis types: bytes/datetime/dict/float/int/list/str/PQ
tests/integration/actions/redis_types/*
Adds SyncActionTestBase, native-apply and corruption hooks, and skip markers across type tests.

Benchmark model and pipeline updates

Layer / File(s) Summary
Benchmark models and TTL variants
benchmarks/models.py
Adds BenchmarkPipelineModel and TTL variant; set-model TTL wrappers.
Switch pipeline tests to benchmark model
benchmarks/test_pipeline*.py
Replaces comprehensive models with benchmark models and adds special-field pipeline case.

Changelog and release notes

Layer / File(s) Summary
CHANGELOG 1.3.2
CHANGELOG.md
Documents RedisSet, MarkVersion default, SF key fix, and nested SF improvements.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant AtomicRedisModel
  participant RedisUtils
  participant RedisPipeline
  participant Redis

  Client->>AtomicRedisModel: aload(keys)
  AtomicRedisModel->>RedisUtils: contains_sf_field()?
  alt has special fields
    RedisUtils->>RedisPipeline: execute_load_pipeline(classes, keys)
    RedisPipeline->>Redis: JSON.MGET(keys)
    RedisPipeline->>Redis: queue SMEMBERS for planned SF paths
    Redis-->>RedisPipeline: dumps + sf_raw
    RedisPipeline-->>RedisUtils: dumps, plans_per_key, sf_raw
    RedisUtils->>AtomicRedisModel: build_models_from_dumps(...)
    AtomicRedisModel-->>Client: instances
  else no special fields
    RedisUtils->>Redis: JSON.MGET(keys)
    Redis-->>RedisUtils: dumps
    RedisUtils->>AtomicRedisModel: build_models_from_dumps(...)
    AtomicRedisModel-->>Client: instances
  end
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related issues

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

@yedidyakfir
yedidyakfir merged commit e2cf804 into main May 20, 2026
66 of 68 checks passed
@codspeed-hq

codspeed-hq Bot commented May 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚡ 16 improved benchmarks
❌ 6 regressed benchmarks
✅ 115 untouched benchmarks
🆕 24 new benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_benchmark 2.6 ms 2.3 ms +12.92%
🆕 WallTime test_benchmark N/A 2.7 ms N/A
🆕 WallTime test_benchmark_with_ttl N/A 3.8 ms N/A
WallTime test_benchmark_with_ttl 159.4 ms 141.6 ms +12.57%
WallTime test_benchmark 163.9 ms 141.7 ms +15.71%
WallTime test_benchmark_with_ttl 163.6 ms 142.6 ms +14.73%
WallTime test_benchmark 165.1 ms 143 ms +15.47%
WallTime test_benchmark_with_ttl 165.5 ms 143.9 ms +15.02%
WallTime test_benchmark 164.5 ms 141.9 ms +15.94%
WallTime test_benchmark_with_ttl 164.9 ms 142.7 ms +15.54%
WallTime test_benchmark 165 ms 142.2 ms +16.06%
WallTime test_benchmark_with_ttl 165.2 ms 142.8 ms +15.7%
WallTime test_benchmark 165.3 ms 142 ms +16.38%
WallTime test_benchmark_with_ttl 166 ms 143.2 ms +15.9%
WallTime test_benchmark 165.5 ms 142.6 ms +16.07%
WallTime test_benchmark_with_ttl 166.3 ms 143.4 ms +15.94%
WallTime test_benchmark 169 ms 145.9 ms +15.84%
WallTime test_benchmark_with_ttl 169.2 ms 147 ms +15.11%
🆕 WallTime test_benchmark N/A 8.5 ms N/A
🆕 WallTime test_benchmark_with_ttl N/A 9.4 ms N/A
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing develop (e537755) with main (0898c02)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (e537755) during the generation of this report, so 0898c02 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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.

3 participants