Skip to content

find() returns empty list with nested EmbeddedJsonModel #734

@abrookins

Description

@abrookins

Problem

find() silently returns an empty list for models with EmbeddedJsonModel fields, even when matching records exist in Redis.

Example

class ExperimentMetadata(JsonModel):
    class Meta:
        embedded = True
    factors: Dict[str, Any] = Field(default_factory=dict)

class Experiment(JsonModel):
    exp_name: str = Field(index=True)
    experiment_metadata: ExperimentMetadata = Field(default_factory=ExperimentMetadata)

# This returns [] even when records exist
Experiment.find(Experiment.exp_name == "test1").all()

Impact

  • Silent failures are confusing for users
  • Users may think their data wasn't saved when it actually was
  • No error message to help diagnose the problem

Related

Investigation Needed

  • Determine why queries fail with nested models
  • Check if the index is being created correctly
  • Verify the RediSearch query syntax for nested model scenarios

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions