omni.OmniFilterSet
Helper class for generating a set of filter search parameters for an embedded dashboard. This class is designed to abstract the complexity of the Omni filters and create a simple interface for generating the filter values to be used by the OmniDashboardEmbedder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**filters |
OmniFilterDefinition
|
Arbitrary kwargs defining filter definitions. The kwarg is the name of the filter and defines the schema for the dict that should be passed to the get_filter_search_params method. The value for each kwarg is the OmniFilterDefinition object that will be used to translate the value to a viable Omni filter search param. |
{}
|
Source code in src/omni/embed.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|
filters: dict[str, OmniFilterDefinition]
property
Filters in this filter set. This defines the schema of the dict that should be passed to the
get_filter_search_params
method.
get_filter_search_params(filter_values)
Given a dictionary of filter keys and values this function returns the dictionary of expected to populate the filter_search_params kwarg when calling OmniDashboardEmbedder.build_url. This method is ideal for translating query params in the encapsulating application to Omni filter search parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filter_values |
dict[str, str | int | float]
|
Dict where the keys are the filter names and values are the values to filter on. The
list of available filters can be found in the |
required |
Returns:
Type | Description |
---|---|
dict[str, list[str]]
|
Dict to be passed as the |
Source code in src/omni/embed.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|