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 <kk4468...@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+unsubscr...@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/CAPq0zEAGi1sLuP_23WvoXMc3F1eusA1LK45OMVCtgxCRq39rPQ%40mail.gmail.com.

Reply via email to