Git Product home page Git Product logo

monggregate's People

Contributors

marcus-24 avatar olivierlegrand avatar thomasaboutard avatar vianneymi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

monggregate's Issues

join follow up

  • Allow hybrid (SQL/NoSQL) joins by passing name in join (i.e allow storing matches in an array as in regular Mongo Lookup)
  • In SQL tabular mode, prevent key names collision

improve support for SortByCount

SortByCount only takes str (field path) as of now when it could take expressions
Ex :

{ $sortByCount: { lname: "$employee.last", fname: "$employee.first" } }

bug with validation of ascending and descending parameters in sort stage

This breaks

pipeline = Pipeline(collection="movies")
pipeline.match(
    query={
        "title":"A Star Is Born"
    }
).sort(
    by="year",
    ascending=True
)

while it shouldn't.

It is because a branch is missing validates_boolens:

elif descending is None and isinstance(ascending, bool):
    descending = not ascending

move away from root_validator

  • Move away from using a root_validator, instead use individual or compound validator on field or set of fields, leverage full direct capabilities of pydantic this will allow to make statement private again
  • Make statement private again

core changes to package

  • alias generator #40
  • remove automatic transformation of objects to statement
  • improve transformation of objects to statement (deeply nested cases)
  • improve expressions
  • Make collection really optional in pipeline
  • Simplify double mode EXPORT vs RUN
  • pipeline list #25
  • Improve package structure

Fix pymongo dependency

pymongo should be required only for pipeline to directly executable.
Currently instantiating a pipeline in a environment that does not contain pymongo crashes

create a common ancestor for operators and stages

This will allow to build more complex aggregation by referencing other interface objects that will automatically be translated into statements.
E.g. passing a pipeline instance to a lookup statement, or a an accumulator operator to a group statement

Add test on requirements and build

Make sure that the requirements really capture the package requirements and that the package can be built in newly environments with packages respecting the ranges or set versions described in requirements

ease snake_case - camelCase transformations

  • Define alias generator in BaseClass
  • Deprecate aliases defined manually using pydantic.Field
  • Check that nothing break
  • Whenever possible use .dict() or future serialize() function to generate statements

Create an expression class

  • To be distinct from current expression type
  • This expression class should overload python operators ...
  • ... but this overloading should be optional and controlled through the config class

default types for expressions

For attributes that are typed as being expressions, we should provide an alternative type for simple cases and to enforce validation.
Ex:

class Limit(BaseModel):
   value : Expression = 0

cannot have a constraint on value because of the Expression type
however, this should work

class Limit(BaseModel):
   value : int | Expression = Field(gt=0) 

lookup query always lead to a validation error

The check of combination of arguments is wrong

        # Check combination of arguments
        if right and left_on and right_on and \
            not(let or pipeline is None):
            # in a subquery to select all on the foreign collection
            # pipeline can be an empty list which is falsy
            type_ = "simple"

        elif let and pipeline is not None and not(left_on or right_on):
            type_ =  "uncorrelated"

        elif let and pipeline is None and left_on and right_on:
            type_ = "correlated"

        else:
            raise TypeError("Incompatible combination of arguments")

        return type_

test

This is for testing pull requests on GitHub

search 2.0

  • Rename current operators function in Search class so that its clear that they are constructors
  • Create alternative/mirror functions pipelinizable functions inside Search class. That is functions that at the end return self so that they can be chained. Those functions should insert clauses in a compound operator
  • #85

Industrialization

  • Search for contributors
  • #79
  • Create changelog
  • Create GitHub releases
  • #80
  • Perform thorough code reviews
  • Create a dedicated doc website

fix autocompletion

pydantic v2 broke autocompletion in the package because of the way BaseModel is imported now

expressions and operators upgrades

  • Interface a couple more operators
  • Clarify how expressions can and should be used
  • Create a class hosting all operators (sort of equivalent of pipeline with stages but for operators)
  • default types for expressions #27
  • create a type alias for statements #29

Improve typing

Setup package so that mypy understands that it is typed.

Exemple:

image

.filter should be recognized in the above screenshot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.