Skip to content

Commit

Permalink
[Event Hubs] Fix a bug that sets owner level 0 (#11172)
Browse files Browse the repository at this point in the history
  • Loading branch information
YijunXieMS authored May 1, 2020
1 parent c62ccaa commit 505f7fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ def __init__(
self._partition_close_handler = kwargs.get(
"on_partition_close", None
) # type: Optional[Callable[[PartitionContext, CloseReason], None]]
self._checkpoint_store = kwargs.get(
"checkpoint_store"
) or InMemoryCheckpointStore() # type: Optional[CheckpointStore]
checkpoint_store = kwargs.get("checkpoint_store") # type: Optional[CheckpointStore]
self._checkpoint_store = checkpoint_store or InMemoryCheckpointStore()
self._initial_event_position = kwargs.get(
"initial_event_position", "@latest"
) # type: Union[str, int, datetime, Dict[str, Any]]
Expand All @@ -93,7 +92,7 @@ def __init__(

# Receive parameters
self._owner_level = kwargs.get("owner_level", None) # type: Optional[int]
if "checkpoint_store" in kwargs and self._owner_level is None:
if checkpoint_store and self._owner_level is None:
self._owner_level = 0
self._prefetch = kwargs.get("prefetch", None) # type: Optional[int]
self._track_last_enqueued_event_properties = kwargs.get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def test_client_secret_credential(aad_credential, live_eventhub):
try:
from azure.identity import EnvironmentCredential
except ImportError as e:
except:
pytest.skip("No azure identity library")
credential = EnvironmentCredential()
producer_client = EventHubProducerClient(fully_qualified_namespace=live_eventhub['hostname'],
Expand Down

0 comments on commit 505f7fe

Please sign in to comment.