Skip to content

Commit

Permalink
fix: IPython.display check in list
Browse files Browse the repository at this point in the history
  • Loading branch information
Yazawazi committed Feb 28, 2024
1 parent 3cac765 commit a7761a0
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions backend/funix/decorator/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,34 +543,42 @@ def anal_function_result(
call_result = [get_dataframe_json(call_result[0])]
if return_type_parsed in supported_basic_file_types:
if isinstance(call_result[0], list):
call_result = [
[
handle_ipython_audio_image_video(single)
if __ipython_use:
call_result = [
[
handle_ipython_audio_image_video(single)
if isinstance(
single,
(
__ipython_display.Audio,
__ipython_display.Video,
__ipython_display.Image,
),
)
else get_static_uri(single)
for single in call_result[0]
]
]
else:
call_result = [
[get_static_uri(single) for single in call_result[0]]
]
else:
if __ipython_use:
call_result = [
handle_ipython_audio_image_video(call_result[0])
if isinstance(
single,
call_result[0],
(
__ipython_display.Audio,
__ipython_display.Video,
__ipython_display.Image,
),
)
else get_static_uri(single)
for single in call_result[0]
else get_static_uri(call_result[0])
]
]
else:
call_result = [
handle_ipython_audio_image_video(call_result[0])
if isinstance(
call_result[0],
(
__ipython_display.Audio,
__ipython_display.Video,
__ipython_display.Image,
),
)
else get_static_uri(call_result[0])
]
else:
call_result = [get_static_uri(call_result[0])]
return call_result
return call_result

Expand Down

0 comments on commit a7761a0

Please sign in to comment.