From 45d1ee8e81cb48a2533f952d2a965b3ed80adef9 Mon Sep 17 00:00:00 2001 From: pevner-p2 Date: Mon, 27 Nov 2023 20:05:22 -0500 Subject: [PATCH 1/3] Empty parens are no longer supported --- monday/query_joins.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/monday/query_joins.py b/monday/query_joins.py index 010923e..e02179e 100644 --- a/monday/query_joins.py +++ b/monday/query_joins.py @@ -357,13 +357,13 @@ def get_tags_query(tags): def get_board_items_query(board_id: Union[str, int], limit: Optional[int] = None, page: Optional[int] = None) -> str: raw_params = locals().items() item_params = gather_params(raw_params, exclusion_list=["board_id", "item_ids"]) - joined_params = ', '.join(item_params) + joined_params = f"({', '.join(item_params)})" if item_params else "" query = '''query{ boards(ids: %s){ name - items_page (){ - items(%s) { + items_page { + items %s { group { id title @@ -393,12 +393,12 @@ def get_boards_query(limit: int = None, page: int = None, ids: List[int] = None, value = v if isinstance(v, Enum): value = v.value - query_params.append("%s: %s" % (k, value)) + joined_params = f"({', '.join(query_params)})" if query_params else "" query = '''query { - boards (%s) { + boards %s { id name permissions @@ -416,7 +416,7 @@ def get_boards_query(limit: int = None, page: int = None, ids: List[int] = None, type } } - }''' % ', '.join(query_params) + }''' % joined_params return query @@ -486,9 +486,10 @@ def create_board_by_workspace_query(board_name: str, board_kind: BoardKind, work # USER RESOURCE QUERIES def get_users_query(**kwargs): + joined_params = f"({', '.join(['%s: %s' % (arg, kwargs.get(arg)) for arg in kwargs])})" if kwargs else "" query = '''query { - users (%s) { + users %s { id name email @@ -498,7 +499,7 @@ def get_users_query(**kwargs): name } } - }''' % ', '.join(["%s: %s" % (arg, kwargs.get(arg)) for arg in kwargs]) + }''' % joined_params return query From d5efd890faefff53cd245b5415b2c08f91f0ee5b Mon Sep 17 00:00:00 2001 From: pevner-p2 Date: Mon, 27 Nov 2023 20:06:48 -0500 Subject: [PATCH 2/3] Updating version --- monday/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monday/__version__.py b/monday/__version__.py index 66638b2..09f1fde 100644 --- a/monday/__version__.py +++ b/monday/__version__.py @@ -1,3 +1,3 @@ -__version__ = '2.0.0-pre' +__version__ = '2.0.0rc1' __author__ = 'Christina D\'Astolfo' __email__ = 'chdastolfo@gmail.com, lemi@prodperfect.com, pevner@prodperfect.com' From 0c936eb97b79c552c6830cbc1a388bb6329bdc51 Mon Sep 17 00:00:00 2001 From: pevner-p2 Date: Mon, 27 Nov 2023 20:09:16 -0500 Subject: [PATCH 3/3] Updating tests due to removal of empty parens and associated adjustments --- monday/tests/test_board_resource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monday/tests/test_board_resource.py b/monday/tests/test_board_resource.py index a2b4a84..c49766a 100644 --- a/monday/tests/test_board_resource.py +++ b/monday/tests/test_board_resource.py @@ -38,14 +38,14 @@ def test_get_boards_by_id_query(self): def test_get_board_items_query(self): query = get_board_items_query(board_id=self.board_id) self.assertIn(str(self.board_id), query) - items_line = 'items()' + items_line = 'items' self.assertIn(items_line, query) def test_get_board_items_query_with_limit_and_pages(self): limit = 100 page = 1 query = get_board_items_query(board_id=self.board_id, limit=limit, page=page) - items_line = f'items(limit: {limit}, page: {page})' + items_line = f'items (limit: {limit}, page: {page})' self.assertIn(items_line, query) def test_get_columns_by_board_query(self):