@@ -363,10 +363,7 @@ def stream_stderr_updates(
363363 raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
364364
365365 default_headers = {'Accept' : 'text/event-stream' }
366- if extra_headers :
367- merged_headers = {** default_headers , ** extra_headers }
368- else :
369- merged_headers = default_headers
366+ merged_headers = default_headers if extra_headers is None else {** default_headers , ** extra_headers }
370367
371368 if merged_headers and merged_headers .get (RAW_RESPONSE_HEADER ):
372369 return self ._get (
@@ -450,10 +447,7 @@ def stream_stdout_updates(
450447 raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
451448
452449 default_headers = {'Accept' : 'text/event-stream' }
453- if extra_headers :
454- merged_headers = {** default_headers , ** extra_headers }
455- else :
456- merged_headers = default_headers
450+ merged_headers = default_headers if extra_headers is None else {** default_headers , ** extra_headers }
457451
458452 if merged_headers and merged_headers .get (RAW_RESPONSE_HEADER ):
459453 return self ._get (
@@ -821,10 +815,7 @@ async def stream_stderr_updates(
821815 raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
822816
823817 default_headers = {'Accept' : 'text/event-stream' }
824- if extra_headers :
825- merged_headers = {** default_headers , ** extra_headers }
826- else :
827- merged_headers = default_headers
818+ merged_headers = default_headers if extra_headers is None else {** default_headers , ** extra_headers }
828819
829820 if merged_headers and merged_headers .get (RAW_RESPONSE_HEADER ):
830821 return await self ._get (
@@ -908,10 +899,8 @@ async def stream_stdout_updates(
908899 raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
909900
910901 default_headers = {'Accept' : 'text/event-stream' }
911- if extra_headers :
912- merged_headers = {** default_headers , ** extra_headers }
913- else :
914- merged_headers = default_headers
902+ merged_headers = default_headers if extra_headers is None else {** default_headers , ** extra_headers }
903+
915904
916905 # If caller requested a raw or streaming response wrapper, return the underlying stream as-is
917906 if merged_headers and merged_headers .get (RAW_RESPONSE_HEADER ):
0 commit comments