Skip to content

Conversation

@abrookins
Copy link
Collaborator

Fixes #488

Summary

Redis OM now honors custom TAG field separators when creating indexes. Previously, the | separator was hardcoded, ignoring any custom separator configuration.

Changes

  • Added separator parameter to Field() with default "|"
  • Updated schema generation for both HashModel and JsonModel to use the field's separator
  • Added 17 tests covering separator functionality

Usage

from aredis_om import Field, JsonModel

class Document(JsonModel, index=True):
    name: str = Field(index=True)
    tags: str = Field(index=True, separator=",")  # Use comma instead of pipe

Fixes #488 - TAG separators are now honored when creating indexes.
Users can specify custom separators via Field(separator=',')
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 929639e Previous: b2d9cea Ratio
tests/test_benchmarks.py::TestSaveBenchmarks::test_hashmodel_save 1514.5610658149646 iter/sec (stddev: 0.000029033475340073266) 1834.5447902753788 iter/sec (stddev: 0.00012480683186627813) 1.21
tests/test_benchmarks.py::TestSaveBenchmarks::test_jsonmodel_save 2132.5322746012907 iter/sec (stddev: 0.00005164869512710772) 2607.2666659856627 iter/sec (stddev: 0.00006986606486609657) 1.22
tests/test_benchmarks.py::TestGetBenchmarks::test_hashmodel_get 3241.6058292894345 iter/sec (stddev: 0.000018208804469583863) 4159.820814863618 iter/sec (stddev: 0.000021689303138884947) 1.28
tests/test_benchmarks.py::TestGetBenchmarks::test_jsonmodel_get 2771.7680456918238 iter/sec (stddev: 0.00003780957359588817) 3412.2202252527045 iter/sec (stddev: 0.00002946988605421251) 1.23
tests/test_benchmarks.py::TestQueryBenchmarks::test_hashmodel_find_by_field 2604.6418781438533 iter/sec (stddev: 0.0000429568269871859) 3348.2265799656293 iter/sec (stddev: 0.00006448534426055602) 1.29
tests/test_benchmarks.py::TestUpdateBenchmarks::test_hashmodel_update 1548.1586804433807 iter/sec (stddev: 0.00009583876582559157) 1994.5089572766312 iter/sec (stddev: 0.0000645868437082454) 1.29
tests/test_benchmarks.py::TestUpdateBenchmarks::test_jsonmodel_update 2399.5103655103294 iter/sec (stddev: 0.000034563893448722606) 3052.543492194109 iter/sec (stddev: 0.000024030857967661033) 1.27

This comment was automatically generated by workflow using github-action-benchmark.

@abrookins
Copy link
Collaborator Author

Hmm, these benchmark stats are going to be hard with CI's variability! Let's see where it goes though.

@abrookins abrookins merged commit 419f5ca into main Jan 30, 2026
27 of 28 checks passed
@abrookins abrookins deleted the fix/issue-488-tag-separator branch January 30, 2026 00:13
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.

Tags separators are not copied when OM rebuilds the index

2 participants