(self, attr_type)
| 147 | self._fspec.append_dense(type_name == "float") |
| 148 | |
| 149 | def parse(self, attr_type): |
| 150 | if isinstance(attr_type, tuple) or isinstance(attr_type, list): |
| 151 | type_name = attr_type[0] |
| 152 | bucket_size = attr_type[1] if len(attr_type) >= 2 else None |
| 153 | is_multival = attr_type[2] if len(attr_type) >= 3 else False |
| 154 | else: |
| 155 | type_name = attr_type |
| 156 | bucket_size = None |
| 157 | is_multival = False |
| 158 | |
| 159 | assert type_name in {"int", "float", "string"} |
| 160 | |
| 161 | if is_multival and type_name != "string": |
| 162 | raise ValueError("multi-value attribute must be string type.") |
| 163 | return type_name, bucket_size, is_multival |
| 164 | |
| 165 | @property |
| 166 | def weighted(self): |
no outgoing calls
no test coverage detected