Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use proper type hint for griffe 0.22 compatibility #1313

Merged
merged 3 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions optimade/filtertransformers/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import copy
import warnings
import itertools
from typing import Dict, List, Any
from typing import Dict, List, Any, Union
from lark import v_args, Token
from optimade.filtertransformers.base_transformer import BaseTransformer, Quantity
from optimade.server.exceptions import BadRequest
Expand Down Expand Up @@ -566,14 +566,14 @@ def replace_str_date_with_datetime(subdict, prop, expr):
)


def recursive_postprocessing(filter_, condition, replacement):
def recursive_postprocessing(filter_: Union[Dict, List], condition, replacement):
"""Recursively descend into the query, checking each dictionary
(contained in a list, or as an entry in another dictionary) for
the condition passed. If the condition is true, apply the
replacement to the dictionary.

Parameters:
filter_ (list/dict): the filter_ to process.
filter_ : the filter_ to process.
condition (callable): a function that returns True if the
replacement function should be applied. It should take
as arguments the property and expression from the filter_,
Expand Down
1 change: 0 additions & 1 deletion requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
griffe==0.21 # Currently mkdocstrings-python does not pin a griffe version, but it is quite flaky...
mike==1.1.2
mkdocs==1.3.1
mkdocs-awesome-pages-plugin==2.8.0
Expand Down