You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/how-to-guides/client-callback-function.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,27 +10,29 @@ A callback function is a function that is sent to another function as an argumen
10
10
11
11
## How to use callback functions
12
12
13
-
Currently the below functions in feathr client support passing a callback as an argument:
13
+
We can pass a callback function when initializing the feathr client.
14
+
15
+
```python
16
+
client = FeathrClient(config_path, callback)
17
+
```
18
+
19
+
The below functions accept an optional parameters named **params**. params is a dictionary where user can pass the arguments for the callback function.
14
20
15
21
- get_online_features
16
22
- multi_get_online_features
17
23
- get_offline_features
18
24
- monitor_features
19
25
- materialize_features
20
26
21
-
These functions accept two optional parameters named **callback** and **params**.
22
-
callback is of type function and params is a dictionary where user can pass the arguments for the callback function.
Copy file name to clipboardExpand all lines: feathr_project/feathr/client.py
+18-22Lines changed: 18 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -83,12 +83,13 @@ class FeathrClient(object):
83
83
local_workspace_dir (str, optional): set where is the local work space dir. If not set, Feathr will create a temporary folder to store local workspace related files.
84
84
credential (optional): credential to access cloud resources, most likely to be the returned result of DefaultAzureCredential(). If not set, Feathr will initialize DefaultAzureCredential() inside the __init__ function to get credentials.
85
85
project_registry_tag (Dict[str, str]): adding tags for project in Feathr registry. This might be useful if you want to tag your project as deprecated, or allow certain customizations on project leve. Default is empty
86
+
callback: an async callback function that will be called after execution of the original logic. This callback should not block the thread. This is optional.
86
87
87
88
Raises:
88
89
RuntimeError: Fail to create the client since necessary environment variables are not set for Redis
feature_query: features that are requested to add onto the observation data
439
438
output_path: output path of job, i.e. the observation data with features attached.
440
439
execution_configuratons: a dict that will be passed to spark job when the job starts up, i.e. the "spark configurations". Note that not all of the configuration will be honored since some of the configurations are managed by the Spark platform, such as Databricks or Azure Synapse. Refer to the [spark documentation](https://spark.apache.org/docs/latest/configuration.html) for a complete list of spark configurations.
441
-
callback: an async callback function that will be called after execution of the original logic. This callback should not block the thread.
442
440
params: a dictionary of parameters for the callback function
"""Create a offline job to generate statistics to monitor feature data. There is an optional
562
560
callback function and the params to extend this function's capability.For eg. cosumer of the features.
563
561
564
562
Args:
565
563
settings: Feature monitoring settings
566
564
execution_configuratons: a dict that will be passed to spark job when the job starts up, i.e. the "spark configurations". Note that not all of the configuration will be honored since some of the configurations are managed by the Spark platform, such as Databricks or Azure Synapse. Refer to the [spark documentation](https://spark.apache.org/docs/latest/configuration.html) for a complete list of spark configurations.
567
-
callback: an async callback function that will be called after execution of the original logic. This callback should not block the thread.
568
565
params: a dictionary of parameters for the callback function.
"""Materialize feature data. There is an optional callback function and the params
577
574
to extend this function's capability.For eg. cosumer of the feature store.
578
575
579
576
Args:
580
577
settings: Feature materialization settings
581
578
execution_configuratons: a dict that will be passed to spark job when the job starts up, i.e. the "spark configurations". Note that not all of the configuration will be honored since some of the configurations are managed by the Spark platform, such as Databricks or Azure Synapse. Refer to the [spark documentation](https://spark.apache.org/docs/latest/configuration.html) for a complete list of spark configurations.
582
-
callback: an async callback function that will be called after execution of the original logic. This callback should not block the thread.
583
579
params: a dictionary of parameters for the callback function
0 commit comments