3
3
4
4
from datetime import datetime
5
5
from importlib .util import find_spec
6
- from typing import Optional , Union
6
+ from typing import Any , Optional , Union
7
7
8
8
from gooddata_api_client .model .inline_filter_definition_inline import InlineFilterDefinitionInline
9
9
@@ -510,10 +510,10 @@ def description(self, labels: dict[str, str], format_locale: Optional[str] = Non
510
510
class InlineFilter (Filter ):
511
511
"""Filter using a custom MAQL expression.
512
512
513
- Automatically decides, whether to create or update.
513
+ Automatically decides, whether to create or update.
514
514
515
- Args:
516
- maql (str): The MAQL expression string that defines the filter condition.
515
+ Args:
516
+ maql (str): The MAQL expression string that defines the filter condition.
517
517
518
518
Example:
519
519
```python
@@ -529,14 +529,22 @@ class InlineFilter(Filter):
529
529
```
530
530
"""
531
531
532
- def __init__ (self , maql : str ):
533
- super ().__init__ ()
532
+ def __init__ (
533
+ self , maql : str , apply_on_result : Optional [bool ] = None , local_identifier : Optional [Union [ObjId , str ]] = None
534
+ ) -> None :
535
+ super ().__init__ (apply_on_result )
534
536
535
537
self .maql = maql
538
+ self .local_identifier = local_identifier
536
539
537
540
def is_noop (self ) -> bool :
538
541
return False
539
542
540
543
def as_api_model (self ) -> afm_models .InlineFilterDefinition :
541
- body = InlineFilterDefinitionInline (self .maql )
544
+ kwargs : dict [str , Any ] = {}
545
+ if self .apply_on_result is not None :
546
+ kwargs ["apply_on_result" ] = self .apply_on_result
547
+ if self .local_identifier is not None :
548
+ kwargs ["local_identifier" ] = str (self .local_identifier )
549
+ body = InlineFilterDefinitionInline (self .maql , ** kwargs )
542
550
return afm_models .InlineFilterDefinition (body , _check_type = False )
0 commit comments