Skip to content

Commit

Permalink
Add num dpus parameter to query offline API
Browse files Browse the repository at this point in the history
  • Loading branch information
saiharshavellanki committed Feb 13, 2025
1 parent aa5e6cf commit 958a2db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fennel/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ def query_offline(
feature_to_column_map: Optional[Dict[Feature, str]] = None,
workflow: Optional[str] = None,
use_v2: bool = True,
num_dpus: Optional[int] = None
) -> Dict[str, Any]:
"""Extract point in time correct values of output features.
Expand Down Expand Up @@ -498,6 +499,9 @@ def query_offline(
workflow param is equivalent to tagging (ex: fraud, finance etc.).
If not provided, the "default" value will be used.
num_dpus (Optional[int]): Number of glue DPUs to use while executing the offline query.
We do not retry the job if it fails with the given DPUs
Returns: Dict[str, Any]:
----------
A dictionary containing the request_id, the output s3 bucket and prefix,
Expand Down Expand Up @@ -625,6 +629,8 @@ def query_offline(
}
if workflow is not None:
req["workflow"] = workflow
if num_dpus is not None:
req["num_dpus"] = num_dpus
response = self._post_json(
"{}/query_offline".format(
V1_API,
Expand Down
1 change: 1 addition & 0 deletions fennel/testing/mock_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ def query_offline(
feature_to_column_map: Optional[Dict[Feature, str]] = None,
workflow: Optional[str] = "default",
use_v2: bool = False,
num_dpus: Optional[int] = None,
) -> Union[pd.DataFrame, pd.Series]:
if input_dataframe is None:
raise ValueError(
Expand Down

0 comments on commit 958a2db

Please sign in to comment.