23
23
FeatureGroup ,
24
24
Feature ,
25
25
)
26
- from google .cloud .aiplatform import initializer
26
+ from google .cloud .aiplatform import initializer , __version__
27
27
28
28
from . import _offline_store_impl as impl
29
29
@@ -149,7 +149,6 @@ def fetch_historical_feature_values(
149
149
# TODO: Add support for feature_age_threshold
150
150
feature_age_threshold : Optional [datetime .timedelta ] = None ,
151
151
dry_run : bool = False ,
152
- session : "Optional[bigframes.session.Session]" = None ,
153
152
project : Optional [str ] = None ,
154
153
location : Optional [str ] = None ,
155
154
) -> "Union[bigframes.pandas.DataFrame, None]" :
@@ -180,19 +179,14 @@ def fetch_historical_feature_values(
180
179
dry_run:
181
180
Build the Point-In-Time Lookup (PITL) query but don't run it. The PITL
182
181
query will be printed to stdout.
183
- session:
184
- The bigframes session to use for converting `pd.DataFrame` to
185
- `bigframes.pandas.DataFrame` (if necessary) and running the
186
- Point-In-Time Lookup (PITL) query in Bigframes/BigQuery. If unset, a new
187
- session will be created based on `project` and `location`.
188
182
project:
189
183
The project to use for feature lookup and running the Point-In-Time
190
184
Lookup (PITL) query in BigQuery. If unset, the project set in
191
- aiplatform.init will be used. Unused if `session` is provided.
185
+ aiplatform.init will be used.
192
186
location:
193
187
The location to use for feature lookup and running the Point-In-Time
194
188
Lookup (PITL) query in BigQuery. If unset, the project set in
195
- aiplatform.init will be used. Unused if `session` is provided.
189
+ aiplatform.init will be used.
196
190
197
191
Returns:
198
192
A `bigframes.pandas.DataFrame` with the historical feature values. `None`
@@ -202,9 +196,15 @@ def fetch_historical_feature_values(
202
196
bigframes = _try_import_bigframes ()
203
197
project = project or initializer .global_config .project
204
198
location = location or initializer .global_config .location
205
- if session is None :
206
- session_options = bigframes .BigQueryOptions (project = project , location = location )
207
- session = bigframes .connect (session_options )
199
+ application_name = (
200
+ f"vertexai-offline-store/{ __version__ } +fetch-historical-feature-values"
201
+ )
202
+ session_options = bigframes .BigQueryOptions (
203
+ project = project ,
204
+ location = location ,
205
+ application_name = application_name ,
206
+ )
207
+ session = bigframes .connect (session_options )
208
208
209
209
if feature_age_threshold is not None :
210
210
raise NotImplementedError ("feature_age_threshold is not yet supported." )
0 commit comments