@@ -62,7 +62,9 @@ class RetrievalJob(ABC):
6262 """A RetrievalJob manages the execution of a query to retrieve data from the offline store."""
6363
6464 def to_df (
65- self , validation_reference : Optional ["ValidationReference" ] = None
65+ self ,
66+ validation_reference : Optional ["ValidationReference" ] = None ,
67+ timeout : Optional [int ] = None ,
6668 ) -> pd .DataFrame :
6769 """
6870 Synchronously executes the underlying query and returns the result as a pandas dataframe.
@@ -72,8 +74,9 @@ def to_df(
7274
7375 Args:
7476 validation_reference (optional): The validation to apply against the retrieved dataframe.
77+ timeout (optional): The query timeout if applicable.
7578 """
76- features_df = self ._to_df_internal ()
79+ features_df = self ._to_df_internal (timeout = timeout )
7780
7881 if self .on_demand_feature_views :
7982 # TODO(adchia): Fix requirement to specify dependent feature views in feature_refs
@@ -101,7 +104,9 @@ def to_df(
101104 return features_df
102105
103106 def to_arrow (
104- self , validation_reference : Optional ["ValidationReference" ] = None
107+ self ,
108+ validation_reference : Optional ["ValidationReference" ] = None ,
109+ timeout : Optional [int ] = None ,
105110 ) -> pyarrow .Table :
106111 """
107112 Synchronously executes the underlying query and returns the result as an arrow table.
@@ -111,11 +116,12 @@ def to_arrow(
111116
112117 Args:
113118 validation_reference (optional): The validation to apply against the retrieved dataframe.
119+ timeout (optional): The query timeout if applicable.
114120 """
115121 if not self .on_demand_feature_views and not validation_reference :
116- return self ._to_arrow_internal ()
122+ return self ._to_arrow_internal (timeout = timeout )
117123
118- features_df = self ._to_df_internal ()
124+ features_df = self ._to_df_internal (timeout = timeout )
119125 if self .on_demand_feature_views :
120126 for odfv in self .on_demand_feature_views :
121127 features_df = features_df .join (
@@ -147,20 +153,24 @@ def to_sql(self) -> str:
147153 pass
148154
149155 @abstractmethod
150- def _to_df_internal (self ) -> pd .DataFrame :
156+ def _to_df_internal (self , timeout : Optional [ int ] = None ) -> pd .DataFrame :
151157 """
152158 Synchronously executes the underlying query and returns the result as a pandas dataframe.
153159
160+ timeout: RetreivalJob implementations may implement a timeout.
161+
154162 Does not handle on demand transformations or dataset validation. For either of those,
155163 `to_df` should be used.
156164 """
157165 pass
158166
159167 @abstractmethod
160- def _to_arrow_internal (self ) -> pyarrow .Table :
168+ def _to_arrow_internal (self , timeout : Optional [ int ] = None ) -> pyarrow .Table :
161169 """
162170 Synchronously executes the underlying query and returns the result as an arrow table.
163171
172+ timeout: RetreivalJob implementations may implement a timeout.
173+
164174 Does not handle on demand transformations or dataset validation. For either of those,
165175 `to_arrow` should be used.
166176 """
0 commit comments