1515import dataclasses
1616import typing
1717
18- from bigframes import dtypes
1918from bigframes .operations import base_ops
2019
2120
@@ -31,17 +30,10 @@ def expensive(self) -> bool:
3130
3231 def output_type (self , * input_types ):
3332 # This property should be set to a valid Dtype by the @remote_function decorator or read_gbq_function method
34- if hasattr (self .func , "output_dtype" ):
35- if dtypes .is_array_like (self .func .output_dtype ):
36- # TODO(b/284515241): remove this special handling to support
37- # array output types once BQ remote functions support ARRAY.
38- # Until then, use json serialized strings at the remote function
39- # level, and parse that to the intended output type at the
40- # bigframes level.
41- return dtypes .STRING_DTYPE
42- return self .func .output_dtype
33+ if hasattr (self .func , "bigframes_bigquery_function_output_dtype" ):
34+ return self .func .bigframes_bigquery_function_output_dtype
4335 else :
44- raise AttributeError ("output_dtype not defined" )
36+ raise AttributeError ("bigframes_bigquery_function_output_dtype not defined" )
4537
4638
4739@dataclasses .dataclass (frozen = True )
@@ -55,17 +47,10 @@ def expensive(self) -> bool:
5547
5648 def output_type (self , * input_types ):
5749 # This property should be set to a valid Dtype by the @remote_function decorator or read_gbq_function method
58- if hasattr (self .func , "output_dtype" ):
59- if dtypes .is_array_like (self .func .output_dtype ):
60- # TODO(b/284515241): remove this special handling to support
61- # array output types once BQ remote functions support ARRAY.
62- # Until then, use json serialized strings at the remote function
63- # level, and parse that to the intended output type at the
64- # bigframes level.
65- return dtypes .STRING_DTYPE
66- return self .func .output_dtype
50+ if hasattr (self .func , "bigframes_bigquery_function_output_dtype" ):
51+ return self .func .bigframes_bigquery_function_output_dtype
6752 else :
68- raise AttributeError ("output_dtype not defined" )
53+ raise AttributeError ("bigframes_bigquery_function_output_dtype not defined" )
6954
7055
7156@dataclasses .dataclass (frozen = True )
@@ -79,14 +64,7 @@ def expensive(self) -> bool:
7964
8065 def output_type (self , * input_types ):
8166 # This property should be set to a valid Dtype by the @remote_function decorator or read_gbq_function method
82- if hasattr (self .func , "output_dtype" ):
83- if dtypes .is_array_like (self .func .output_dtype ):
84- # TODO(b/284515241): remove this special handling to support
85- # array output types once BQ remote functions support ARRAY.
86- # Until then, use json serialized strings at the remote function
87- # level, and parse that to the intended output type at the
88- # bigframes level.
89- return dtypes .STRING_DTYPE
90- return self .func .output_dtype
67+ if hasattr (self .func , "bigframes_bigquery_function_output_dtype" ):
68+ return self .func .bigframes_bigquery_function_output_dtype
9169 else :
92- raise AttributeError ("output_dtype not defined" )
70+ raise AttributeError ("bigframes_bigquery_function_output_dtype not defined" )
0 commit comments