Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
annie-mac committed Aug 18, 2024
1 parent fcafa35 commit 63ea375
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 744 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from typing import Dict, Any, List

from azure.cosmos import http_constants, exceptions
from azure.cosmos._change_feed.aio.change_feed_state import ChangeFeedStateV1, ChangeFeedStateV2
from azure.cosmos._change_feed.change_feed_state import ChangeFeedStateV1, ChangeFeedStateV2
from azure.cosmos.aio import _retry_utility_async
from azure.cosmos.exceptions import CosmosHttpResponseError

Expand Down Expand Up @@ -114,7 +114,7 @@ def __init__(
self._client = client
self._feed_options = feed_options

self._change_feed_state = self._feed_options.pop("changeFeedState")
self._change_feed_state: ChangeFeedStateV2 = self._feed_options.pop("changeFeedState")
if not isinstance(self._change_feed_state, ChangeFeedStateV2):
raise ValueError(f"ChangeFeedFetcherV2 can not handle change feed state version {type(self._change_feed_state)}")

Expand All @@ -139,7 +139,7 @@ async def callback():
except CosmosHttpResponseError as e:
if exceptions._partition_range_is_gone(e) or exceptions._is_partition_split_or_merge(e):
# refresh change feed state
await self._change_feed_state.handle_feed_range_gone(
await self._change_feed_state.handle_feed_range_gone_async(
self._client._routing_map_provider,
self._resource_link)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

from azure.cosmos import PartitionKey
from azure.cosmos._change_feed.aio.change_feed_fetcher import ChangeFeedFetcherV1, ChangeFeedFetcherV2
from azure.cosmos._change_feed.aio.change_feed_state import ChangeFeedStateV1, ChangeFeedState
from azure.cosmos._change_feed.change_feed_state import ChangeFeedState, ChangeFeedStateV1
from azure.cosmos._utils import is_base64_encoded, is_key_exists_and_not_none

# pylint: disable=protected-access
Expand Down

This file was deleted.

Loading

0 comments on commit 63ea375

Please sign in to comment.