You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2021/12/14 17:04:03 UTC

[incubator-ponymail-foal] branch master updated (f0ae2e6 -> 87dbacc)

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git.


    from f0ae2e6  Update version
     new e94ab27  Add type hints
     new 87dbacc  Update version

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 server/plugins/messages.py | 12 +++++++-----
 server/server_version.py   |  2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)

[incubator-ponymail-foal] 02/02: Update version

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit 87dbacc2520cb2403922a0cf164ada882c0acea6
Author: Sebb <se...@apache.org>
AuthorDate: Tue Dec 14 17:03:54 2021 +0000

    Update version
---
 server/server_version.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/server_version.py b/server/server_version.py
index ae870d4..91730a9 100644
--- a/server/server_version.py
+++ b/server/server_version.py
@@ -1,2 +1,2 @@
 # This file is generated by server/update_version.sh
-PONYMAIL_SERVER_VERSION = '1600108'
+PONYMAIL_SERVER_VERSION = 'e94ab27'

[incubator-ponymail-foal] 01/02: Add type hints

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit e94ab274ee2f353a8fb9c349816bb0cb20bbb5d2
Author: Sebb <se...@apache.org>
AuthorDate: Tue Dec 14 17:03:40 2021 +0000

    Add type hints
---
 server/plugins/messages.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/server/plugins/messages.py b/server/plugins/messages.py
index cbf93c3..07c5358 100644
--- a/server/plugins/messages.py
+++ b/server/plugins/messages.py
@@ -404,13 +404,13 @@ async def query_batch(
 
 async def query(
     session: plugins.session.SessionObject,
-    query_defuzzed,
-    query_limit=10000,
+    query_defuzzed: dict,
+    query_limit: int = 10000,
     hide_deleted: bool = True,
     metadata_only: bool = False,
     epoch_order: str = "desc",
     source_fields: typing.Optional[typing.List[str]] = None
-):
+) -> typing.List[dict]:
     """
     Advanced query and grab for stats.py
     Also called by mbox.py (using metadata_only=True)
@@ -435,7 +435,7 @@ async def query(
     return docs
 
 
-async def wordcloud(session, query_defuzzed):
+async def wordcloud(session: plugins.session.SessionObject, query_defuzzed: dict) -> dict:
     """
     Wordclouds via significant terms query in ES
     """
@@ -444,6 +444,7 @@ async def wordcloud(session, query_defuzzed):
         # Copy the query and ensure we're only looking at public content
         wc_public_query = dict(query_defuzzed)
         wc_public_query["filter"] = [{"term": {"private": False}}]
+        assert session.database, DATABASE_NOT_CONNECTED
         res = await session.database.search(
             body={
                 "size": 0,
@@ -462,12 +463,13 @@ async def wordcloud(session, query_defuzzed):
     return wc
 
 
-async def get_activity_span(session, query_defuzzed):
+async def get_activity_span(session: plugins.session.SessionObject, query_defuzzed: dict) -> typing.Tuple:
     """ Fetches the activity span of a search as well as active months within that span """
 
     # Fetch any private lists included in search results
     fuzz_private_only = dict(query_defuzzed)
     fuzz_private_only["filter"] = [{"term": {"private": True}}]
+    assert session.database, DATABASE_NOT_CONNECTED
     res = await session.database.search(
         index=session.database.dbs.db_mbox,
         size=0,