Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
391 changes: 167 additions & 224 deletions src/monggregate/search/operators/compound.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/tests_legacy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for legacy functionality."""
1 change: 1 addition & 0 deletions tests/tests_legacy/tests_search/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for legacy search functionality."""
8 changes: 7 additions & 1 deletion tests/tests_monggregate/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
"""Tests for the monggregate package."""
"""Tests for `monggregate` package."""

from monggregate.base import BaseModel, Expression, Singleton, express, isbasemodel

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.base.BaseModel imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.base.Expression imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.base.Singleton imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.base.express imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.base.isbasemodel imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.dollar import (AggregationVariableEnum,Dollar,DollarDollar,CLUSTER_TIME,NOW,ROOT,CURRENT,REMOVE,DESCEND,PRUNE,KEEP,CONSTANTS,S,SS,)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.dollar import (AggregationVariableEnum,Dollar,DollarDollar,CLUSTER_TIME,NOW,ROOT,CURRENT,REMOVE,DESCEND,PRUNE,KEEP,CONSTANTS,S,SS,)
from monggregate.dollar import (
AggregationVariableEnum,
Dollar,
DollarDollar,
CLUSTER_TIME,
NOW,
ROOT,
CURRENT,
REMOVE,
DESCEND,
PRUNE,
KEEP,
CONSTANTS,
S,
SS,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.AggregationVariableEnum imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.Dollar imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.DollarDollar imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.CLUSTER_TIME imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.NOW imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.ROOT imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.CURRENT imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.REMOVE imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.DESCEND imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.PRUNE imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.KEEP imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.CONSTANTS imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.S imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.dollar.SS imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.fields import FieldName, FieldPath, Variable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.fields.FieldName imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.fields.FieldPath imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.fields.Variable imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.pipeline import Pipeline, Match, Project

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.pipeline.Pipeline imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.pipeline.Match imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.pipeline.Project imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.utils import (to_unique_list,validate_field_path,validate_field_paths,StrEnum,)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.utils import (to_unique_list,validate_field_path,validate_field_paths,StrEnum,)
from monggregate.utils import (
to_unique_list,
validate_field_path,
validate_field_paths,
StrEnum,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.utils.to_unique_list imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.utils.validate_field_path imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.utils.validate_field_paths imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.utils.StrEnum imported but unused; consider removing, adding to __all__, or using a redundant alias

3 changes: 3 additions & 0 deletions tests/tests_monggregate/tests_operators/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators` subpackage."""

from monggregate.operators.operator import Operator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.operator import Operator
from monggregate.operators.operator import Operator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.operator.Operator imported but unused; consider removing, adding to __all__, or using a redundant alias

3 changes: 3 additions & 0 deletions tests/tests_monggregate/tests_operators/test_operator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators.operator`."""

# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Tests for `monggregate.operators.accumulators` subpackage."""

from monggregate.operators.accumulators.accumulator import Accumulator, AccumulatorEnum

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.accumulator.Accumulator imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.accumulator.AccumulatorEnum imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.accumulators.avg import Average, avg

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.avg.Average imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.avg.avg imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.accumulators.count import Count, count

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.count.Count imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.count.count imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.accumulators.first import First, first

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.first.First imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.first.first imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.accumulators.last import Last, last

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.last.Last imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.last.last imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.accumulators.max import Max, max

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.max.Max imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.max.max imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.accumulators.min import Min, min

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.min.Min imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.min.min imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.accumulators.push import Push, push

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.push.Push imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.push.push imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.accumulators.sum import Sum, sum

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.accumulators.sum import Sum, sum
from monggregate.operators.accumulators.sum import Sum, sum

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.sum.Sum imported but unused; consider removing, adding to __all__, or using a redundant alias

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.accumulators.sum.sum imported but unused; consider removing, adding to __all__, or using a redundant alias

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Tests for `monggregate.operators.arithmetic` subpackage."""

from monggregate.operators.arithmetic.add import Add

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.arithmetic.add.Add imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.arithmetic.arithmetic import ArithmeticOperatorEnum

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.arithmetic.arithmetic.ArithmeticOperatorEnum imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.arithmetic.divide import Divide

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.arithmetic.divide.Divide imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.arithmetic.multiply import Multiply

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.arithmetic.multiply.Multiply imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.arithmetic.pow import Pow

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.arithmetic.pow.Pow imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.arithmetic.subtract import Subtract

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.arithmetic.subtract import Subtract
from monggregate.operators.arithmetic.subtract import Subtract

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.arithmetic.subtract.Subtract imported but unused; consider removing, adding to __all__, or using a redundant alias

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators.arithmetic.arithmetic`."""

# TODO
13 changes: 13 additions & 0 deletions tests/tests_monggregate/tests_operators/tests_array/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Tests for `monggregate.operators.array` subpackage."""

from monggregate.operators.array.array_to_object import ArrayToObject

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.array_to_object.ArrayToObject imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.array.array import Operator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.array.Operator imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.array.filter import Filter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.filter.Filter imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.array.first import First

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.first.First imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.array.in_ import In

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.in_.In imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.array.is_array import IsArray

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.is_array.IsArray imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.array.last import Last

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.last.Last imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.array.max_n import MaxN

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.max_n.MaxN imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.array.min_n import MinN

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.min_n.MinN imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.array.size import Size

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.size.Size imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.array.sort_array import SortArray

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.array.sort_array import SortArray
from monggregate.operators.array.sort_array import SortArray

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.array.sort_array.SortArray imported but unused; consider removing, adding to __all__, or using a redundant alias

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators.array.array`."""

# TODO
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
"""Tests for `monggregate.operators.array.first` module."""

from monggregate.operators.array.first import First
from monggregate.operators.array.first import First, first

from monggregate.operators.array.first import First

def test_first_expression():
def test_first_expression() -> None:
# Setup
array = [10, 20, 30]
expected_expression = {"$first": array}

# Act
first_op = First(operand=array)
first_op = first(array=array)
result_expression = first_op.expression

# Assert
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Tests for `monggregate.operators.boolean` subpackage."""

from monggregate.operators.boolean.and_ import And

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.boolean.and_.And imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.boolean.boolean import BooleanOperator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.boolean.boolean.BooleanOperator imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.boolean.not_ import Not

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.boolean.not_.Not imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.boolean.or_ import Or

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.boolean.or_ import Or
from monggregate.operators.boolean.or_ import Or

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.boolean.or_.Or imported but unused; consider removing, adding to __all__, or using a redundant alias

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Tests for `monggregate.operators.boolean.boolean`."""


# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Tests for `monggregate.operators.comparison` subpackage."""

from monggregate.operators.comparison.cmp import Compare

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.comparison.cmp.Compare imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.comparison.comparator import Comparator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.comparison.comparator.Comparator imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.comparison.eq import Equal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.comparison.eq.Equal imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.comparison.gt import GreatherThan

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.comparison.gt.GreatherThan imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.comparison.gte import GreatherThanOrEqual

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.comparison.gte.GreatherThanOrEqual imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.comparison.lt import LowerThan

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.comparison.lt.LowerThan imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.comparison.lte import LowerThanOrEqual

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.comparison.lte.LowerThanOrEqual imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.comparison.ne import NotEqual

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.comparison.ne import NotEqual
from monggregate.operators.comparison.ne import NotEqual

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.comparison.ne.NotEqual imported but unused; consider removing, adding to __all__, or using a redundant alias

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators.comparison`."""

# TODO
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from monggregate.operators.comparison.gte import GreatherThanOrEqual

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change

from monggregate.operators.comparison.gte import GreatherThanOrEqual

def test_greather_than_or_equal_expression():
# Setup
left = "$field"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from monggregate.operators.comparison.lt import LowerThan

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change

from monggregate.operators.comparison.lt import LowerThan

def test_lower_than_expression():
# Setup
left = "$field"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Tests for `monggregate.operators.conditional` subpackage."""

from monggregate.operators.conditional.cond import Cond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.conditional.cond.Cond imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.conditional.conditional import ConditionalOperator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.conditional.conditional.ConditionalOperator imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.conditional.if_null import IfNull

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.conditional.if_null.IfNull imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.conditional.switch import Switch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.conditional.switch import Switch
from monggregate.operators.conditional.switch import Switch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.conditional.switch.Switch imported but unused; consider removing, adding to __all__, or using a redundant alias

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators.conditional.conditional`."""

# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Tests for `monggregate.operators.custom.custom`."""

from monggregate.operators.custom.custom import CustomOperator
# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators.custom.custom`."""

# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators.data_size`."""

from monggregate.operators.data_size.data_size import DataSizeOperator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.data_size.data_size import DataSizeOperator
from monggregate.operators.data_size.data_size import DataSizeOperator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.data_size.data_size.DataSizeOperator imported but unused; consider removing, adding to __all__, or using a redundant alias

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators.data_size.data_size`."""

# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Tests for `monggregate.operators.date` subpackage."""

from monggregate.operators.date.date import DateOperator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.date.date.DateOperator imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.date.millisecond import Millisecond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.date.millisecond import Millisecond
from monggregate.operators.date.millisecond import Millisecond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.date.millisecond.Millisecond imported but unused; consider removing, adding to __all__, or using a redundant alias

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators.date.date`."""

# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Tests for `monggregate.operators.objects` subpackage."""

from monggregate.operators.objects.merge_objects import MergeObjects

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.objects.merge_objects.MergeObjects imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.objects.object_ import ObjectOperator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.objects.object_.ObjectOperator imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.objects.object_to_array import ObjectToArray

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.objects.object_to_array import ObjectToArray
from monggregate.operators.objects.object_to_array import ObjectToArray

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.objects.object_to_array.ObjectToArray imported but unused; consider removing, adding to __all__, or using a redundant alias

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Tests for `monggregate.operators.objects.objects`."""


# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Tests for `monggregate.operators.strings` subpackage."""

from monggregate.operators.strings.concat import Concat

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.strings.concat.Concat imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.strings.date_from_string import DateFromString

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.strings.date_from_string.DateFromString imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.strings.date_to_string import DateToString

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Ruff] reported by reviewdog 🐶
F401 monggregate.operators.strings.date_to_string.DateToString imported but unused; consider removing, adding to __all__, or using a redundant alias

from monggregate.operators.strings.string import StringOperator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.strings.string import StringOperator
from monggregate.operators.strings.string import StringOperator

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Tests for `monggregate.operators.strings.string`."""

# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Test for 'monggregate.operators.type_.type_'"""

from monggregate.operators.type_.type_ import Type_

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.operators.type_.type_ import Type_
from monggregate.operators.type_.type_ import Type_

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for `monggregate.search.collectors`"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
"""Tests for `monggregate.search.collectors`"""
"""Tests for `monggregate.search.collectors`"""

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO
13 changes: 13 additions & 0 deletions tests/tests_monggregate/tests_search/tests_operators/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Tests for `monggregate.search.operators` subpackage."""

from monggregate.search.operators.autocomplete import Autocomplete
from monggregate.search.operators.clause import Clause
from monggregate.search.operators.compound import Compound
from monggregate.search.operators.equals import Equals
from monggregate.search.operators.exists import Exists
from monggregate.search.operators.more_like_this import MoreLikeThis
from monggregate.search.operators.operator import SearchOperator
from monggregate.search.operators.range import Range
from monggregate.search.operators.regex import Regex
from monggregate.search.operators.text import Text
from monggregate.search.operators.wildcard import Wildcard

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
from monggregate.search.operators.wildcard import Wildcard
from monggregate.search.operators.wildcard import Wildcard

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import pytest
from monggregate.search.operators.autocomplete import Autocomplete
from monggregate.search.commons import FuzzyOptions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change

def test_autocomplete_expression():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [mypy] reported by reviewdog 🐶
Function is missing a return type annotation [no-untyped-def]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [mypy] reported by reviewdog 🐶
Use "-> None" if function does not return a value

# Setup
query = "test"
path = "field"
fuzzy_options = FuzzyOptions(maxEdits=1, prefixLength=1, maxExpansions=10)

autocomplete = Autocomplete(
query=query,
path=path,
token_order="any",
fuzzy=fuzzy_options,
score={"boost": 2}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
score={"boost": 2}
score={"boost": 2},

)

expected_expression = {
"autocomplete": {
"query": query,
"path": path,
"tokenOrder": "any",
"fuzzy": {
"maxEdits": 1,
"prefixLength": 1,
"maxExpansions": 10
},
"score": {"boost": 2}
Comment on lines +24 to +29

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
"fuzzy": {
"maxEdits": 1,
"prefixLength": 1,
"maxExpansions": 10
},
"score": {"boost": 2}
"fuzzy": {"maxEdits": 1, "prefixLength": 1, "maxExpansions": 10},
"score": {"boost": 2},

}
}

# Act
actual_expression = autocomplete.expression

# Assert
assert actual_expression == expected_expression

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
assert actual_expression == expected_expression
assert actual_expression == expected_expression

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Tests for `monggregate.search.operators.clause` module."""

from monggregate.search.operators.clause import Clause
from monggregate.search.operators.compound import Compound
from monggregate.search.operators import OperatorMap


def test_consistency_with_operator_map() -> None:
"""Tests that all operators are present in the clause type."""

# Setup
operators_in_clause = set(Clause.__args__) | {Compound}
# Compoound should be in Clause but it seems complex to implement right now
# TODO : Fix this when fully migrating to pydantic v2.
operators_in_operator_map = set(OperatorMap.values())

# Act
missing_operators_in_clause = operators_in_operator_map - operators_in_clause
missing_operators_in_operator_map = operators_in_clause - operators_in_operator_map

# Assert
assert not missing_operators_in_clause, (
f"Operators in operator map but not in clause: {missing_operators_in_clause}"
)
assert not missing_operators_in_operator_map, (
f"Operators in clause but not in operator map: {missing_operators_in_operator_map}"
)
Comment on lines +22 to +27

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
assert not missing_operators_in_clause, (
f"Operators in operator map but not in clause: {missing_operators_in_clause}"
)
assert not missing_operators_in_operator_map, (
f"Operators in clause but not in operator map: {missing_operators_in_operator_map}"
)
assert (
not missing_operators_in_clause
), f"Operators in operator map but not in clause: {missing_operators_in_clause}"
assert (
not missing_operators_in_operator_map
), f"Operators in clause but not in operator map: {missing_operators_in_operator_map}"

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Tests for `monggregate.search.operators.compound` module."""

from monggregate.search.operators.compound import Compound


def test_compound_expression_with_must_equals() -> None:
"""Tests that the compound expression is correct when using the must equals operator."""

# Setup
compound = Compound()
path = "field"
value = "test"
compound.equals("must", path=path, value=value)

expected_expression = {
"compound": {
"must": [{"equals": {"path": path, "score": None, "value": value}}]
}
}

# Act
actual_expression = compound.expression

# Assert
assert actual_expression == expected_expression
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import pytest
from monggregate.search.operators.equals import Equals

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change

def test_equals_expression():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [mypy] reported by reviewdog 🐶
Function is missing a return type annotation [no-untyped-def]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [mypy] reported by reviewdog 🐶
Use "-> None" if function does not return a value

# Setup
path = "status"
value = True
score = {"boost": 3}

equals_op = Equals(path=path, value=value, score=score)

expected_expression = {
"equals": {
"path": path,
"value": value,
"score": score
}
}
Comment on lines +12 to +18

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
expected_expression = {
"equals": {
"path": path,
"value": value,
"score": score
}
}
expected_expression = {"equals": {"path": path, "value": value, "score": score}}


# Act
actual_expression = equals_op.expression

# Assert
assert actual_expression == expected_expression
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from monggregate.search.operators.exists import Exists

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change

def test_exists_expression():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [mypy] reported by reviewdog 🐶
Function is missing a return type annotation [no-untyped-def]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [mypy] reported by reviewdog 🐶
Use "-> None" if function does not return a value

# Setup
path = "email"

exists_op = Exists(path=path)

expected_expression = {
"exists": {
"path": path
}
}
Comment on lines +9 to +13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
expected_expression = {
"exists": {
"path": path
}
}
expected_expression = {"exists": {"path": path}}


# Act
actual_expression = exists_op.expression

# Assert
assert actual_expression == expected_expression

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
assert actual_expression == expected_expression
assert actual_expression == expected_expression

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from monggregate.search.operators.more_like_this import MoreLikeThis

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change

def test_more_like_this_expression():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [mypy] reported by reviewdog 🐶
Function is missing a return type annotation [no-untyped-def]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [mypy] reported by reviewdog 🐶
Use "-> None" if function does not return a value

# Setup
like_docs = [{"title": "Introduction to MongoDB"}, {"title": "Advanced MongoDB Usage"}]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
like_docs = [{"title": "Introduction to MongoDB"}, {"title": "Advanced MongoDB Usage"}]
like_docs = [
{"title": "Introduction to MongoDB"},
{"title": "Advanced MongoDB Usage"},
]


more_like_this = MoreLikeThis(like=like_docs)

expected_expression = {
"moreLikeThis": {
"like": like_docs
}
}
Comment on lines +9 to +13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
expected_expression = {
"moreLikeThis": {
"like": like_docs
}
}
expected_expression = {"moreLikeThis": {"like": like_docs}}


# Act
actual_expression = more_like_this.expression

# Assert
assert actual_expression == expected_expression

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[black-format] reported by reviewdog 🐶

Suggested change
assert actual_expression == expected_expression
assert actual_expression == expected_expression

Loading