Skip to content

Commit cde2a61

Browse files
committed
Fix: Correctly handle destination blob series in image transformation functions
1 parent 0ca87c1 commit cde2a61

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

bigframes/operations/blob.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -472,15 +472,13 @@ def image_blur(
472472
blurred_status_series = res._apply_unary_op(
473473
ops.JSONValue(json_path="$.status")
474474
)
475-
content_series = res._apply_unary_op(ops.JSONValue(json_path="$.content"))
476-
dst_blobs = content_series.str.to_blob(connection=connection)
477475
results_df = bpd.DataFrame(
478-
{"status": blurred_status_series, "content": dst_blobs}
476+
{"status": blurred_status_series, "content": dst}
479477
)
480478
results_struct = bbq.struct(results_df).rename("blurred_results")
481479
return results_struct
482480
else:
483-
return res.str.to_blob(connection=connection)
481+
return dst
484482

485483
def image_resize(
486484
self,
@@ -608,15 +606,13 @@ def image_resize(
608606
resized_status_series = res._apply_unary_op(
609607
ops.JSONValue(json_path="$.status")
610608
)
611-
content_series = res._apply_unary_op(ops.JSONValue(json_path="$.content"))
612-
dst_blobs = content_series.str.to_blob(connection=connection)
613609
results_df = bpd.DataFrame(
614-
{"status": resized_status_series, "content": dst_blobs}
610+
{"status": resized_status_series, "content": dst}
615611
)
616612
results_struct = bbq.struct(results_df).rename("resized_results")
617613
return results_struct
618614
else:
619-
return res.str.to_blob(connection=connection)
615+
return dst
620616

621617
def image_normalize(
622618
self,
@@ -738,18 +734,16 @@ def image_normalize(
738734
normalized_status_series = res._apply_unary_op(
739735
ops.JSONValue(json_path="$.status")
740736
)
741-
content_series = res._apply_unary_op(ops.JSONValue(json_path="$.content"))
742-
dst_blobs = content_series.str.to_blob(connection=connection)
743737
results_df = bpd.DataFrame(
744738
{
745739
"status": normalized_status_series,
746-
"content": dst_blobs,
740+
"content": dst,
747741
}
748742
)
749743
results_struct = bbq.struct(results_df).rename("normalized_results")
750744
return results_struct
751745
else:
752-
return res.str.to_blob(connection=connection)
746+
return dst
753747

754748
def pdf_extract(
755749
self,

0 commit comments

Comments
 (0)