Skip to content

Commit

Permalink
use Union instead of pipe operator
Browse files Browse the repository at this point in the history
  • Loading branch information
marrony committed Mar 5, 2024
1 parent 4d0b992 commit 5012478
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fauna/client/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import timedelta
from dataclasses import dataclass
from typing import Any, Dict, Iterator, Mapping, Optional, List
from typing import Any, Dict, Iterator, Mapping, Optional, List, Union
from contextlib import contextmanager

import fauna
Expand Down Expand Up @@ -378,7 +378,7 @@ def _query(
schema_version=schema_version,
)

def stream(self, fql: StreamToken | Query) -> "StreamIterator":
def stream(self, fql: Union[StreamToken, Query]) -> "StreamIterator":
if isinstance(fql, Query):
token = self.query(fql).data
else:
Expand All @@ -390,7 +390,7 @@ def stream(self, fql: StreamToken | Query) -> "StreamIterator":

return StreamIterator(self, token)

def _stream(self, token: StreamToken, start_ts: int | None):
def _stream(self, token: StreamToken, start_ts: Optional[int]):
headers = self._headers.copy()
headers[_Header.Format] = "tagged"
headers[_Header.Authorization] = self._auth.bearer()
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_client_with_query_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from fauna.errors.errors import ThrottlingError


def query_collection(client: Client) -> QuerySuccess | None:
def query_collection(client: Client) -> Optional[QuerySuccess]:
coll_name = os.environ.get("QUERY_LIMITS_COLL") or ""
try:
return client.query(fql("${coll}.all().paginate(50)", coll=fql(coll_name)))
Expand Down

0 comments on commit 5012478

Please sign in to comment.