Ë
    Ìi“$  ã                  ó,  — d dl mZ d dlmZ d dlmZmZmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZmZ d dlmZmZmZmZ  G d	„ d
e«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)é    )Úannotations)Úabstractmethod)ÚOptionalÚProtocolÚSequence)ÚSemanticLayerElementConfig)ÚMetadata)ÚWhereFilterIntersection)ÚMeasureReferenceÚMetricReference)ÚConversionCalculationTypeÚ
MetricTypeÚPeriodAggregationÚTimeGranularityc                  óÔ   — e Zd ZdZeed
d„«       «       Zeedd„«       «       Zeedd„«       «       Zeedd„«       «       Z	eedd„«       «       Z
eedd„«       «       Zeedd„«       «       Zy	)ÚMetricInputMeasurezàProvides a pointer to a measure along with metric-specific processing directives.

    If an alias is set, this will be used as the string name reference for this measure after the aggregation
    phase in the SQL plan.
    c                 ó   — y ©N© ©Úselfs    úi/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/dbt_semantic_interfaces/protocols/metric.pyÚnamezMetricInputMeasure.name   ó   € ð 	ó    c                 ó   — y)zKReturn the set of filters to apply prior to aggregating this input measure.Nr   r   s    r   ÚfilterzMetricInputMeasure.filter   ó   € ð 	r   c                 ó   — y r   r   r   s    r   ÚaliaszMetricInputMeasure.alias$   r   r   c                 ó   — y)zXProperty accessor to get the MeasureReference associated with this metric input measure.Nr   r   s    r   Úmeasure_referencez$MetricInputMeasure.measure_reference)   ó   € ð 	r   c                 ó   — y)zTProperty accessor to get the MeasureReference with the aliased name, if appropriate.Nr   r   s    r   Ú"post_aggregation_measure_referencez5MetricInputMeasure.post_aggregation_measure_reference/   r#   r   c                 ó   — y)z1If the measure should be joined to the timespine.Nr   r   s    r   Újoin_to_timespinez$MetricInputMeasure.join_to_timespine5   r   r   c                 ó   — y)z.What null values should be filled with if set.Nr   r   s    r   Úfill_nulls_withz"MetricInputMeasure.fill_nulls_with;   r   r   N©ÚreturnÚstr©r+   z!Optional[WhereFilterIntersection]©r+   zOptional[str])r+   r   ©r+   Úbool)r+   zOptional[int])Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr   r   r   r    r"   r%   r'   r)   r   r   r   r   r      sË   „ ñð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ñr   r   c                  ó€   — e Zd ZdZeedd„«       «       Zeedd„«       «       Zeedd„«       «       Zeed	d„«       «       Z	y)
ÚMetricTimeWindowzbDescribes the window of time the metric should be accumulated over, e.g., '1 day', '2 weeks', etc.c                 ó   — y r   r   r   s    r   ÚcountzMetricTimeWindow.countE   r   r   c                 ó   — y r   r   r   s    r   ÚgranularityzMetricTimeWindow.granularityJ   r   r   c                 ó   — y r   r   r   s    r   Úwindow_stringzMetricTimeWindow.window_stringO   r   r   c                 ó   — y r   r   r   s    r   Úis_standard_granularityz(MetricTimeWindow.is_standard_granularityT   r   r   N)r+   Úintr*   r/   )
r1   r2   r3   r4   r5   r   r9   r;   r=   r?   r   r   r   r7   r7   B   ss   „ ÙlàØòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ñr   r7   c                  óÔ   — e Zd ZdZeed
d„«       «       Zeedd„«       «       Zeedd„«       «       Zeedd„«       «       Z	eedd„«       «       Z
eedd„«       «       Zeedd„«       «       Zy	)ÚMetricInputzXProvides a pointer to a metric along with the additional properties used on that metric.c                 ó   — y r   r   r   s    r   r   zMetricInput.name]   r   r   c                 ó   — y)zJReturn the set of filters to apply prior to calculating this input metric.Nr   r   s    r   r   zMetricInput.filterb   r   r   c                 ó   — y r   r   r   s    r   r    zMetricInput.aliash   r   r   c                 ó   — y r   r   r   s    r   Úoffset_windowzMetricInput.offset_windowm   r   r   c                 ó   — y r   r   r   s    r   Úoffset_to_grainzMetricInput.offset_to_grainr   r   r   c                 ó   — y)zOProperty accessor to get the MetricReference associated with this metric input.Nr   r   s    r   Úas_referencezMetricInput.as_referencew   r#   r   c                 ó   — y)zSProperty accessor to get the MetricReference with the aliased name, if appropriate.Nr   r   s    r   Úpost_aggregation_referencez&MetricInput.post_aggregation_reference}   r   r   Nr*   r-   r.   ©r+   zOptional[MetricTimeWindow])r+   r   )r1   r2   r3   r4   r5   r   r   r   r    rG   rI   rK   rM   r   r   r   rB   rB   Z   sÇ   „ ÙbàØòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ñr   rB   c                  óH   — e Zd ZdZeedd„«       «       Zeedd„«       «       Zy)ÚConstantPropertyInputaH  Provides the constant property set for conversion metrics.

    Constant properties are additional elements linking a base event to a conversion event.
    The specified properties will typically be a reference to a dimension or entity, and will be used
    to join the base event to the final conversion event. Typical constant properties are things like
    session keys (for services where conversions are measured within a user session), or secondary entities
    (like a user/application pair for an app platform or a user/shop pair for a retail/online storefront platform).
    c                 ó   — y r   r   r   s    r   Úbase_propertyz#ConstantPropertyInput.base_propertyŽ   r   r   c                 ó   — y r   r   r   s    r   Úconversion_propertyz)ConstantPropertyInput.conversion_property“   r   r   Nr*   )r1   r2   r3   r4   r5   r   rR   rT   r   r   r   rP   rP   „   s?   „ ñð Øòó ó ðð Øòó ó ñr   rP   c                  ó¸   — e Zd ZdZeed	d„«       «       Zeed	d„«       «       Zeed
d„«       «       Zeedd„«       «       Z	eedd„«       «       Z
eedd„«       «       Zy)ÚConversionTypeParamszAType params to provide context for conversion metrics properties.c                 ó   — y)z)Measure used to calculate the base event.Nr   r   s    r   Úbase_measurez!ConversionTypeParams.base_measureœ   r   r   c                 ó   — y)z/Measure used to calculate the conversion event.Nr   r   s    r   Úconversion_measurez'ConversionTypeParams.conversion_measure¢   r   r   c                 ó   — y)zSpecified join entity.Nr   r   s    r   ÚentityzConversionTypeParams.entity¨   r   r   c                 ó   — y)z&Type of conversion metric calculation.Nr   r   s    r   Úcalculationz ConversionTypeParams.calculation®   r   r   c                 ó   — y)z<Maximum time range for finding successive conversion events.Nr   r   s    r   ÚwindowzConversionTypeParams.window´   r   r   c                 ó   — y)z/Return the list of defined constant properties.Nr   r   s    r   Úconstant_propertiesz(ConversionTypeParams.constant_propertiesº   r   r   N)r+   r   r*   )r+   r   rN   )r+   z)Optional[Sequence[ConstantPropertyInput]])r1   r2   r3   r4   r5   r   rX   rZ   r\   r^   r`   rb   r   r   r   rV   rV   ™   s«   „ ÙKàØòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ñr   rV   c                  ód   — e Zd ZdZeedd„«       «       Zeedd„«       «       Zeedd„«       «       Zy)	ÚCumulativeTypeParamsz@Type params to provide context for cumulative metric properties.c                 ó   — y r   r   r   s    r   r`   zCumulativeTypeParams.windowÄ   r   r   c                 ó   — y r   r   r   s    r   Úgrain_to_datez"CumulativeTypeParams.grain_to_dateÉ   r   r   c                 ó   — y r   r   r   s    r   Ú
period_aggzCumulativeTypeParams.period_aggÎ   r   r   NrN   r.   )r+   zOptional[PeriodAggregation])	r1   r2   r3   r4   r5   r   r`   rg   ri   r   r   r   rd   rd   Á   sW   „ ÙJàØòó ó ðð Øòó ó ðð Øòó ó ñr   rd   c                  ó(  — e Zd ZdZeedd„«       «       Zeedd„«       «       Zeedd„«       «       Zeedd„«       «       Z	eedd„«       «       Z
eedd„«       «       Zeedd„«       «       Zeedd	„«       «       Zeedd
„«       «       Zeedd„«       «       Zy)ÚMetricTypeParamszdType params add additional context to certain metric types (the context depends on the metric type).c                 ó   — y r   r   r   s    r   ÚmeasurezMetricTypeParams.measure×   r   r   c                 ó   — y)z\Return measures needed to compute this metric (including measures needed by parent metrics).Nr   r   s    r   Úinput_measureszMetricTypeParams.input_measuresÜ   r   r   c                 ó   — y r   r   r   s    r   Ú	numeratorzMetricTypeParams.numeratorâ   r   r   c                 ó   — y r   r   r   s    r   ÚdenominatorzMetricTypeParams.denominatorç   r   r   c                 ó   — y r   r   r   s    r   ÚexprzMetricTypeParams.exprì   r   r   c                 ó   — y r   r   r   s    r   r`   zMetricTypeParams.windowñ   r   r   c                 ó   — y r   r   r   s    r   rg   zMetricTypeParams.grain_to_dateö   r   r   c                 ó   — y r   r   r   s    r   ÚmetricszMetricTypeParams.metricsû   r   r   c                 ó   — y r   r   r   s    r   Úconversion_type_paramsz'MetricTypeParams.conversion_type_params   r   r   c                 ó   — y r   r   r   s    r   Úcumulative_type_paramsz'MetricTypeParams.cumulative_type_params  r   r   N)r+   zOptional[MetricInputMeasure])r+   úSequence[MetricInputMeasure])r+   zOptional[MetricInput]r.   rN   )r+   zOptional[TimeGranularity])r+   zOptional[Sequence[MetricInput]])r+   zOptional[ConversionTypeParams])r+   zOptional[CumulativeTypeParams])r1   r2   r3   r4   r5   r   rm   ro   rq   rs   ru   r`   rg   ry   r{   r}   r   r   r   rk   rk   Ô   s  „ ÙnàØòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ñr   rk   c                  ó`  — e Zd ZdZeedd„«       «       Zeedd„«       «       Zeedd„«       «       Zeedd„«       «       Z	eedd„«       «       Z
eedd„«       «       Zeedd„«       «       Zeedd	„«       «       Zeedd
„«       «       Zeedd„«       «       Zeedd„«       «       Zeedd„«       «       Zy)ÚMetriczDescribes a metric.c                 ó   — y r   r   r   s    r   r   zMetric.name  r   r   c                 ó   — y r   r   r   s    r   ÚdescriptionzMetric.description  r   r   c                 ó   — y r   r   r   s    r   ÚtypezMetric.type  r   r   c                 ó   — y r   r   r   s    r   Útype_paramszMetric.type_params  r   r   c                 ó   — y)zDReturn the set of filters to apply prior to calculating this metric.Nr   r   s    r   r   zMetric.filter"  r   r   c                 ó   — y)zIReturn the complete list of input measure configurations for this metric.Nr   r   s    r   ro   zMetric.input_measures(  r#   r   c                 ó   — y)z_Return the measure references associated with all input measure configurations for this metric.Nr   r   s    r   Úmeasure_referenceszMetric.measure_references.  r#   r   c                 ó   — y)z4Return the associated input metrics for this metric.Nr   r   s    r   Úinput_metricszMetric.input_metrics4  r#   r   c                 ó   — y r   r   r   s    r   ÚmetadatazMetric.metadata:  r   r   c                 ó   — y r   r   r   s    r   ÚconfigzMetric.config?  r   r   c                 ó   — y)zDReturns a string representing a human readable label for the metric.Nr   r   s    r   ÚlabelzMetric.labelD  r   r   c                 ó   — y)a  Default grain used for the metric.

        This will be used in a couple of circumstances:
        - as the default grain for metric_time if no grain is specified
        - as the window function order by when reaggregating cumulative metrics for non-default grains
        Nr   r   s    r   Útime_granularityzMetric.time_granularityJ  s   € ð 	r   Nr*   r.   )r+   r   )r+   rk   r-   )r   r€   r+   r~   )r+   zSequence[MeasureReference])r+   zSequence[MetricInput])r+   zOptional[Metadata])r+   z$Optional[SemanticLayerElementConfig])r1   r2   r3   r4   r5   r   r   rƒ   r…   r‡   r   ro   r‹   r�   r�   r‘   r“   r•   r   r   r   r€   r€     sS  „ ÙàØòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ðð Øòó ó ñr   r€   N)Ú
__future__r   Úabcr   Útypingr   r   r   Ú&dbt_semantic_interfaces.protocols.metar   Ú*dbt_semantic_interfaces.protocols.metadatar	   Ú.dbt_semantic_interfaces.protocols.where_filterr
   Ú"dbt_semantic_interfaces.referencesr   r   Ú"dbt_semantic_interfaces.type_enumsr   r   r   r   r   r7   rB   rP   rV   rd   rk   r€   r   r   r   ú<module>rž      s�   ðÝ "å ß /Ñ /å MÝ ?Ý Rß P÷ó ô-˜ô -ô`�xô ô0'�(ô 'ôT˜Hô ô*%˜8ô %ôP˜8ô ô&4�xô 4ônHˆXõ Hr   