Skip to content

Commit 026b120

Browse files
committed
Old Query object removed. Now we default to the new QueryBuilder object
Deprecation message removed
1 parent eff184c commit 026b120

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

O365/account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, credentials: Tuple[str, str], *,
2525
protocol = protocol or MSGraphProtocol # Defaults to Graph protocol
2626
if isinstance(protocol, type):
2727
protocol = protocol(default_resource=main_resource, **kwargs)
28-
#: The protocol to use for the account. Defaults ot MSGraphProtocol. |br| **Type:** Protocol
28+
# The protocol to use for the account. Defaults ot MSGraphProtocol. |br| **Type:** Protocol
2929
self.protocol: Protocol = protocol
3030

3131
if not isinstance(self.protocol, Protocol):

O365/utils/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
from .utils import CaseEnum, ImportanceLevel, TrackerSet
44
from .utils import Recipient, Recipients, HandleRecipientsMixin
55
from .utils import NEXT_LINK_KEYWORD, ME_RESOURCE, USERS_RESOURCE
6-
from .utils import OneDriveWellKnowFolderNames, Pagination, Query
6+
from .utils import OneDriveWellKnowFolderNames, Pagination
77
from .token import BaseTokenBackend, FileSystemTokenBackend, FirestoreBackend, AWSS3Backend, AWSSecretsBackend, EnvTokenBackend, BitwardenSecretsManagerBackend, DjangoTokenBackend
88
from .range import col_index_to_label
99
from .windows_tz import get_iana_tz, get_windows_tz
1010
from .consent import consent_input_token
1111
from .casing import to_snake_case, to_pascal_case, to_camel_case
12-
13-
from .query import QueryBuilder as ExperimentalQuery, CompositeFilter
12+
from .query import QueryBuilder, CompositeFilter

O365/utils/utils.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import datetime as dt
22
import logging
3-
import warnings
43
from collections import OrderedDict
54
from enum import Enum
65
from typing import Dict, Union
76

87
from dateutil.parser import parse
98
from zoneinfo import ZoneInfo, ZoneInfoNotFoundError
109

10+
from .query import QueryBuilder
1111
from .casing import to_snake_case
1212
from .decorators import fluent
1313
from .windows_tz import get_iana_tz, get_windows_tz
@@ -490,17 +490,14 @@ def _build_date_time_time_zone(self, date_time: dt.datetime) -> Dict[str, str]:
490490
self._cc('timeZone'): timezone
491491
}
492492

493-
def new_query(self, attribute=None):
493+
def new_query(self) -> QueryBuilder:
494494
""" Create a new query to filter results
495495
496496
:param str attribute: attribute to apply the query for
497-
:return: new Query
498-
:rtype: Query
497+
:return: new QueryBuilder
498+
:rtype: QueryBuilder
499499
"""
500-
warnings.warn('This method will be deprecated in future releases. A new Query object is finished and will be the only option in future releases. '
501-
'Use `from O365.utils import ExperimentalQuery as Query` instead to prepare for this change. '
502-
'Current docs already explain this change. See O365/utils/query.py for more details.', DeprecationWarning)
503-
return Query(attribute=attribute, protocol=self.protocol)
500+
return QueryBuilder(protocol=self.protocol)
504501

505502
q = new_query # alias for new query
506503

0 commit comments

Comments
 (0)