_register
_register ¶
Dynamic property registration for conformed properties.
This module provides utilities to automatically register conformed properties as @property methods on the DomoStream class.
register_conformed_properties ¶
register_conformed_properties(
cls, properties_registry: dict
)
Dynamically register conformed properties onto a class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cls
|
Class to register properties on (DomoStream) |
required | |
properties_registry
|
dict
|
Dict of ConformedProperty objects (CONFORMED_PROPERTIES) |
required |
Example
from .stream_configs._conformed import CONFORMED_PROPERTIES register_conformed_properties(DomoStream, CONFORMED_PROPERTIES)
Source code in src/crew_dcs/classes/DomoDataset/stream_configs/_register.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
register_conformed_property ¶
register_conformed_property(
cls,
property_name: str,
public_name: str | None = None,
docstring: str | None = None,
)
Register a single conformed property onto a class.
Decorator-based approach for adding individual properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cls
|
Class to register property on |
required | |
property_name
|
str
|
Name in CONFORMED_PROPERTIES registry |
required |
public_name
|
str | None
|
Name of the property on the class (defaults to property_name) |
None
|
docstring
|
str | None
|
Optional custom docstring |
None
|
Example
@register_conformed_property(DomoStream, "query", "sql") ... class DomoStream: ... pass
Source code in src/crew_dcs/classes/DomoDataset/stream_configs/_register.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |