Skip to content

Commit

Permalink
REF: Simplify default args for originators
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Jun 4, 2024
1 parent 02cf1e0 commit 6c489e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions octue/cloud/emulators/_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,10 @@ def ask(
question["input_manifest"] = input_manifest.to_primitive()

# If the originator question UUID isn't provided, assume that this question is the originator.
if originator_question_uuid is None:
originator_question_uuid = question_uuid
originator_question_uuid = originator_question_uuid or question_uuid

# If the originator isn't provided, assume that this service revision is the originator.
if originator is None:
originator = self.id
originator = originator or self.id

try:
self.children[service_id].answer(
Expand Down
6 changes: 2 additions & 4 deletions octue/cloud/pub_sub/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,10 @@ def ask(
question_uuid = question_uuid or str(uuid.uuid4())

# If the originator question UUID isn't provided, assume that this question is the originator question.
if originator_question_uuid is None:
originator_question_uuid = question_uuid
originator_question_uuid = originator_question_uuid or question_uuid

# If the originator isn't provided, assume that this service revision is the originator.
if originator is None:
originator = self.id
originator = originator or self.id

if asynchronous and not push_endpoint:
answer_subscription = None
Expand Down

0 comments on commit 6c489e0

Please sign in to comment.