Well I am pretty sure that at some point in time I needed the ‘is_null’ 
method. I’ve decided to keep my implementation because I can implement a 
more efficient/specific one. I’ve started to prepend my XType so its 
implementation is used instead of XTypeTable.  (As an aside, it feels like 
XTypeTable should always be the last XType in the list.)

On Friday 23 February 2024 at 18:00:07 UTC-5 Tom Keffer wrote:

> You should not have to implement either.
>
> The implementation of has_data runs a not_null query over the aggregation 
> period. In turn not_null either consults the database or, if it's an xtype, 
> runs get_scalar() over the aggregation period. The first non-null value 
> seen causes it to return True.
>
> Of course, that's a fairly compute intensive way of checking for non-null 
> xtype values, but it will work for any xtype. One could optimize the 
> calculation with a specialized version for your type, but so far I haven't 
> heard of a case where it's needed.
>
> -tk
>
>
> On Fri, Feb 23, 2024 at 7:48 AM Karen K <kk44...@gmail.com> wrote:
>
>> Do I have to implement both the not_null and has_data aggregation in an 
>> XType extension?
>>
>>
>> Tom Keffer schrieb am Freitag, 23. Februar 2024 um 14:01:45 UTC+1:
>>
>> The aggregation not_null does not check first to see if the type exists. 
>> If you know the type exists, it's slightly faster. 
>>
>> In practice, I don't think it's very useful. I may remove it from the 
>> documentation.
>>
>> On Fri, Feb 23, 2024 at 3:48 AM Karen K <kk44...@gmail.com> wrote:
>>
>> What is the difference between the aggregation types has_data and 
>> not_null according to the documentation in 
>> http://weewx.com/docs/5.0/reference/aggtypes/.
>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "weewx-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to weewx-user+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/8abfecfb-7fe5-4e6c-aace-540ed933ea8en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/8abfecfb-7fe5-4e6c-aace-540ed933ea8en%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/a672e629-cd8c-4d29-b159-4be45961f8efn%40googlegroups.com.

Reply via email to