Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add num dpus parameter to query offline API #638

Merged
merged 5 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions fennel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Changelog
## [1.5.78] - 2024-11-12
- Add support for num_dpus parameter in offline query

## [1.5.77] - 2025-02-13
- Revert join on optional fields in LHS
Expand Down
8 changes: 7 additions & 1 deletion 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 @@ -615,7 +619,7 @@ def query_offline(
]
)

req = {
req: dict[str, Any] = {
"input_features": input_feature_names,
"output_features": output_feature_names,
"input": extract_historical_input,
Expand All @@ -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 @@ -312,6 +312,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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fennel-ai"
version = "1.5.77"
version = "1.5.78"
description = "The modern realtime feature engineering platform"
authors = ["Fennel AI <[email protected]>"]
packages = [{ include = "fennel" }]
Expand Down
Loading