Get the number of items in the set. :return int: The number of items in the map .. seealso:: :meth:`map_add`
(self)
| 817 | return value in list_ |
| 818 | |
| 819 | async def size(self) -> int: |
| 820 | """ |
| 821 | Get the number of items in the set. |
| 822 | |
| 823 | :return int: The number of items in the map |
| 824 | |
| 825 | .. seealso:: :meth:`map_add` |
| 826 | """ |
| 827 | op_type = DatastructureOperationType.SetSize |
| 828 | async with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler: |
| 829 | ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict()) |
| 830 | kv_op_type = KeyValueOperationType.LookupIn |
| 831 | async with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler: |
| 832 | op = count('') |
| 833 | req, transcoder = self._impl.request_builder.build_lookup_in_request(self._key, |
| 834 | (op,), |
| 835 | obs_handler, |
| 836 | parent_span=ds_obs_handler.wrapped_span) # noqa: E501 |
| 837 | sd_res: LookupInResult = await self._execute_op(self._impl.lookup_in, |
| 838 | req, |
| 839 | obs_handler, |
| 840 | ds_obs_handler.wrapped_span, |
| 841 | create_type=True, |
| 842 | transcoder=transcoder) |
| 843 | return sd_res.value[0].get('value', None) |
| 844 | |
| 845 | async def clear(self) -> None: |
| 846 | """ |
nothing calls this directly
no test coverage detected