@@ -303,6 +303,7 @@ def get_runtime_json_str(
303
303
def exif (
304
304
self ,
305
305
* ,
306
+ engine : Literal [None , "pillow" ] = None ,
306
307
connection : Optional [str ] = None ,
307
308
max_batching_rows : int = 8192 ,
308
309
container_cpu : Union [float , int ] = 0.33 ,
@@ -311,6 +312,7 @@ def exif(
311
312
"""Extract EXIF data. Now only support image types.
312
313
313
314
Args:
315
+ engine ('pillow' or None, default None): The engine (bigquery or third party library) used for the function. The value must be specified.
314
316
connection (str or None, default None): BQ connection used for function internet transactions, and the output blob if "dst" is str. If None, uses default connection of the session.
315
317
max_batching_rows (int, default 8,192): Max number of rows per batch send to cloud run to execute the function.
316
318
container_cpu (int or float, default 0.33): number of container CPUs. Possible values are [0.33, 8]. Floats larger than 1 are cast to intergers.
@@ -319,6 +321,8 @@ def exif(
319
321
Returns:
320
322
bigframes.series.Series: JSON series of key-value pairs.
321
323
"""
324
+ if engine is None or engine .casefold () != "pillow" :
325
+ raise ValueError ("Must specify the engine, supported value is 'pillow'." )
322
326
323
327
import bigframes .bigquery as bbq
324
328
import bigframes .blob ._functions as blob_func
@@ -344,6 +348,7 @@ def image_blur(
344
348
self ,
345
349
ksize : tuple [int , int ],
346
350
* ,
351
+ engine : Literal [None , "opencv" ] = None ,
347
352
dst : Optional [Union [str , bigframes .series .Series ]] = None ,
348
353
connection : Optional [str ] = None ,
349
354
max_batching_rows : int = 8192 ,
@@ -354,6 +359,7 @@ def image_blur(
354
359
355
360
Args:
356
361
ksize (tuple(int, int)): Kernel size.
362
+ engine ('opencv' or None, default None): The engine (bigquery or third party library) used for the function. The value must be specified.
357
363
dst (str or bigframes.series.Series or None, default None): Output destination. Can be one of:
358
364
str: GCS folder str. The output filenames are the same as the input files.
359
365
blob Series: The output file paths are determined by the uris of the blob Series.
@@ -367,6 +373,9 @@ def image_blur(
367
373
Returns:
368
374
bigframes.series.Series: blob Series if destination is GCS. Or bytes Series if destination is BQ.
369
375
"""
376
+ if engine is None or engine .casefold () != "opencv" :
377
+ raise ValueError ("Must specify the engine, supported value is 'opencv'." )
378
+
370
379
import bigframes .blob ._functions as blob_func
371
380
372
381
connection = self ._resolve_connection (connection )
@@ -424,6 +433,7 @@ def image_resize(
424
433
self ,
425
434
dsize : tuple [int , int ] = (0 , 0 ),
426
435
* ,
436
+ engine : Literal [None , "opencv" ] = None ,
427
437
fx : float = 0.0 ,
428
438
fy : float = 0.0 ,
429
439
dst : Optional [Union [str , bigframes .series .Series ]] = None ,
@@ -436,6 +446,7 @@ def image_resize(
436
446
437
447
Args:
438
448
dsize (tuple(int, int), default (0, 0)): Destination size. If set to 0, fx and fy parameters determine the size.
449
+ engine ('opencv' or None, default None): The engine (bigquery or third party library) used for the function. The value must be specified.
439
450
fx (float, default 0.0): scale factor along the horizontal axis. If set to 0.0, dsize parameter determines the output size.
440
451
fy (float, defalut 0.0): scale factor along the vertical axis. If set to 0.0, dsize parameter determines the output size.
441
452
dst (str or bigframes.series.Series or None, default None): Output destination. Can be one of:
@@ -451,6 +462,9 @@ def image_resize(
451
462
Returns:
452
463
bigframes.series.Series: blob Series if destination is GCS. Or bytes Series if destination is BQ.
453
464
"""
465
+ if engine is None or engine .casefold () != "opencv" :
466
+ raise ValueError ("Must specify the engine, supported value is 'opencv'." )
467
+
454
468
dsize_set = dsize [0 ] > 0 and dsize [1 ] > 0
455
469
fsize_set = fx > 0.0 and fy > 0.0
456
470
if not dsize_set ^ fsize_set :
@@ -516,6 +530,7 @@ def image_resize(
516
530
def image_normalize (
517
531
self ,
518
532
* ,
533
+ engine : Literal [None , "opencv" ] = None ,
519
534
alpha : float = 1.0 ,
520
535
beta : float = 0.0 ,
521
536
norm_type : str = "l2" ,
@@ -528,6 +543,7 @@ def image_normalize(
528
543
"""Normalize images.
529
544
530
545
Args:
546
+ engine ('opencv' or None, default None): The engine (bigquery or third party library) used for the function. The value must be specified.
531
547
alpha (float, default 1.0): Norm value to normalize to or the lower range boundary in case of the range normalization.
532
548
beta (float, default 0.0): Upper range boundary in case of the range normalization; it is not used for the norm normalization.
533
549
norm_type (str, default "l2"): Normalization type. Accepted values are "inf", "l1", "l2" and "minmax".
@@ -544,6 +560,9 @@ def image_normalize(
544
560
Returns:
545
561
bigframes.series.Series: blob Series if destination is GCS. Or bytes Series if destination is BQ.
546
562
"""
563
+ if engine is None or engine .casefold () != "opencv" :
564
+ raise ValueError ("Must specify the engine, supported value is 'opencv'." )
565
+
547
566
import bigframes .blob ._functions as blob_func
548
567
549
568
connection = self ._resolve_connection (connection )
@@ -604,6 +623,7 @@ def image_normalize(
604
623
def pdf_extract (
605
624
self ,
606
625
* ,
626
+ engine : Literal [None , "pypdf" ] = None ,
607
627
connection : Optional [str ] = None ,
608
628
max_batching_rows : int = 1 ,
609
629
container_cpu : Union [float , int ] = 2 ,
@@ -613,6 +633,7 @@ def pdf_extract(
613
633
"""Extracts text from PDF URLs and saves the text as string.
614
634
615
635
Args:
636
+ engine ('pypdf' or None, default None): The engine (bigquery or third party library) used for the function. The value must be specified.
616
637
connection (str or None, default None): BQ connection used for
617
638
function internet transactions, and the output blob if "dst"
618
639
is str. If None, uses default connection of the session.
@@ -631,6 +652,9 @@ def pdf_extract(
631
652
Contains the extracted text from the PDF file.
632
653
Includes error messages if verbosity is enabled.
633
654
"""
655
+ if engine is None or engine .casefold () != "pypdf" :
656
+ raise ValueError ("Must specify the engine, supported value is 'pypdf'." )
657
+
634
658
import bigframes .bigquery as bbq
635
659
import bigframes .blob ._functions as blob_func
636
660
import bigframes .pandas as bpd
@@ -663,6 +687,7 @@ def pdf_extract(
663
687
def pdf_chunk (
664
688
self ,
665
689
* ,
690
+ engine : Literal [None , "pypdf" ] = None ,
666
691
connection : Optional [str ] = None ,
667
692
chunk_size : int = 2000 ,
668
693
overlap_size : int = 200 ,
@@ -675,6 +700,7 @@ def pdf_chunk(
675
700
arrays of strings.
676
701
677
702
Args:
703
+ engine ('pypdf' or None, default None): The engine (bigquery or third party library) used for the function. The value must be specified.
678
704
connection (str or None, default None): BQ connection used for
679
705
function internet transactions, and the output blob if "dst"
680
706
is str. If None, uses default connection of the session.
@@ -698,6 +724,8 @@ def pdf_chunk(
698
724
where each string is a chunk of text extracted from PDF.
699
725
Includes error messages if verbosity is enabled.
700
726
"""
727
+ if engine is None or engine .casefold () != "pypdf" :
728
+ raise ValueError ("Must specify the engine, supported value is 'pypdf'." )
701
729
702
730
import bigframes .bigquery as bbq
703
731
import bigframes .blob ._functions as blob_func
@@ -740,6 +768,7 @@ def pdf_chunk(
740
768
def audio_transcribe (
741
769
self ,
742
770
* ,
771
+ engine : Literal ["bigquery" ] = "bigquery" ,
743
772
connection : Optional [str ] = None ,
744
773
model_name : Optional [
745
774
Literal [
@@ -753,6 +782,7 @@ def audio_transcribe(
753
782
Transcribe audio content using a Gemini multimodal model.
754
783
755
784
Args:
785
+ engine ('bigquery'): The engine (bigquery or third party library) used for the function.
756
786
connection (str or None, default None): BQ connection used for
757
787
function internet transactions, and the output blob if "dst"
758
788
is str. If None, uses default connection of the session.
@@ -770,6 +800,9 @@ def audio_transcribe(
770
800
Contains the transcribed text from the audio file.
771
801
Includes error messages if verbosity is enabled.
772
802
"""
803
+ if engine .casefold () != "bigquery" :
804
+ raise ValueError ("Must specify the engine, supported value is 'bigquery'." )
805
+
773
806
import bigframes .bigquery as bbq
774
807
import bigframes .ml .llm as llm
775
808
import bigframes .pandas as bpd
0 commit comments