|
| 1 | +test_name: test_recipe_writer_path |
| 2 | +test_filename: test_recipe_writer.py |
| 3 | +docstring: |
| 4 | + Test generating recipes by traversing the semantic graph. |
| 5 | +--- |
| 6 | +Path Dunder Name Recipe |
| 7 | +--------------------------------- -------------------------------------- --------------------------------------------------------------------------------------- |
| 8 | +Measure(booking_count) metric_time__quarter AttributeRecipe( |
| 9 | +-> MetricTime indexed_dunder_name=('metric_time', 'quarter'), |
| 10 | +-> TimeEntity joined_model_ids=(bookings_source,), |
| 11 | +-> TimeAttribute(quarter) element_properties={METRIC_TIME}, |
| 12 | + element_type=TIME_DIMENSION, |
| 13 | + source_time_grain=QUARTER, |
| 14 | + recipe_time_grain=ExpandedTimeGranularity(name='quarter', base_granularity=QUARTER), |
| 15 | + ) |
| 16 | +Measure(booking_count) metric_time__year AttributeRecipe( |
| 17 | +-> MetricTime indexed_dunder_name=('metric_time', 'year'), |
| 18 | +-> TimeEntity joined_model_ids=(bookings_source,), |
| 19 | +-> TimeAttribute(year) element_properties={METRIC_TIME}, |
| 20 | + element_type=TIME_DIMENSION, |
| 21 | + source_time_grain=QUARTER, |
| 22 | + recipe_time_grain=ExpandedTimeGranularity(name='year', base_granularity=YEAR), |
| 23 | + ) |
| 24 | +Measure(booking_count) metric_time__extract_year AttributeRecipe( |
| 25 | +-> MetricTime indexed_dunder_name=('metric_time', 'extract_year'), |
| 26 | +-> TimeEntity joined_model_ids=(bookings_source,), |
| 27 | +-> TimeAttribute(extract_year) element_properties={METRIC_TIME, DATE_PART}, |
| 28 | + element_type=TIME_DIMENSION, |
| 29 | + source_time_grain=QUARTER, |
| 30 | + recipe_date_part=YEAR, |
| 31 | + ) |
| 32 | +Measure(booking_count) metric_time__extract_quarter AttributeRecipe( |
| 33 | +-> MetricTime indexed_dunder_name=('metric_time', 'extract_quarter'), |
| 34 | +-> TimeEntity joined_model_ids=(bookings_source,), |
| 35 | +-> TimeAttribute(extract_quarter) element_properties={METRIC_TIME, DATE_PART}, |
| 36 | + element_type=TIME_DIMENSION, |
| 37 | + source_time_grain=QUARTER, |
| 38 | + recipe_date_part=QUARTER, |
| 39 | + ) |
| 40 | +Measure(booking_count) metric_time__custom_year AttributeRecipe( |
| 41 | +-> MetricTime indexed_dunder_name=('metric_time', 'custom_year'), |
| 42 | +-> TimeEntity joined_model_ids=(bookings_source,), |
| 43 | +-> TimeAttribute(custom_year) element_properties={METRIC_TIME, DERIVED_TIME_GRANULARITY}, |
| 44 | + element_type=TIME_DIMENSION, |
| 45 | + source_time_grain=QUARTER, |
| 46 | + recipe_time_grain=ExpandedTimeGranularity(name='custom_year', base_granularity=YEAR), |
| 47 | + ) |
| 48 | +Measure(booking_count) booking AttributeRecipe( |
| 49 | +-> LocalModel(bookings_source) indexed_dunder_name=('booking',), |
| 50 | +-> KeyAttribute(booking) joined_model_ids=(bookings_source,), |
| 51 | + element_properties={ENTITY}, |
| 52 | + element_type=ENTITY, |
| 53 | + ) |
| 54 | +Measure(booking_count) listing AttributeRecipe( |
| 55 | +-> LocalModel(bookings_source) indexed_dunder_name=('listing',), |
| 56 | +-> KeyAttribute(listing) joined_model_ids=(bookings_source,), |
| 57 | + element_properties={ENTITY}, |
| 58 | + element_type=ENTITY, |
| 59 | + ) |
| 60 | +Measure(booking_count) listing__country_latest AttributeRecipe( |
| 61 | +-> LocalModel(bookings_source) indexed_dunder_name=('listing', 'country_latest'), |
| 62 | +-> listings_source.listing joined_model_ids=(bookings_source, listings_source), |
| 63 | +-> JoinedModel(listings_source) entity_link_names=('listing',), |
| 64 | +-> Dimension(country_latest) element_type=DIMENSION, |
| 65 | + ) |
| 66 | +Measure(booking_count) booking__listing AttributeRecipe( |
| 67 | +-> LocalModel(bookings_source) indexed_dunder_name=('booking', 'listing'), |
| 68 | +-> bookings_source.booking joined_model_ids=(bookings_source,), |
| 69 | +-> JoinedModel(bookings_source) element_properties={ENTITY}, |
| 70 | +-> KeyAttribute(listing) entity_link_names=('booking',), |
| 71 | + element_type=ENTITY, |
| 72 | + ) |
| 73 | +Measure(booking_count) booking__booking_time__quarter AttributeRecipe( |
| 74 | +-> LocalModel(bookings_source) indexed_dunder_name=('booking', 'booking_time', 'quarter'), |
| 75 | +-> bookings_source.booking joined_model_ids=(bookings_source,), |
| 76 | +-> JoinedModel(bookings_source) entity_link_names=('booking',), |
| 77 | +-> TimeDimension(booking_time) element_type=TIME_DIMENSION, |
| 78 | +-> TimeEntity source_time_grain=QUARTER, |
| 79 | +-> TimeAttribute(quarter) recipe_time_grain=ExpandedTimeGranularity(name='quarter', base_granularity=QUARTER), |
| 80 | + ) |
| 81 | +Measure(booking_count) booking__booking_time__year AttributeRecipe( |
| 82 | +-> LocalModel(bookings_source) indexed_dunder_name=('booking', 'booking_time', 'year'), |
| 83 | +-> bookings_source.booking joined_model_ids=(bookings_source,), |
| 84 | +-> JoinedModel(bookings_source) entity_link_names=('booking',), |
| 85 | +-> TimeDimension(booking_time) element_type=TIME_DIMENSION, |
| 86 | +-> TimeEntity source_time_grain=QUARTER, |
| 87 | +-> TimeAttribute(year) recipe_time_grain=ExpandedTimeGranularity(name='year', base_granularity=YEAR), |
| 88 | + ) |
| 89 | +Measure(booking_count) booking__booking_time__extract_year AttributeRecipe( |
| 90 | +-> LocalModel(bookings_source) indexed_dunder_name=('booking', 'booking_time', 'extract_year'), |
| 91 | +-> bookings_source.booking joined_model_ids=(bookings_source,), |
| 92 | +-> JoinedModel(bookings_source) element_properties={DATE_PART}, |
| 93 | +-> TimeDimension(booking_time) entity_link_names=('booking',), |
| 94 | +-> TimeEntity element_type=TIME_DIMENSION, |
| 95 | +-> TimeAttribute(extract_year) source_time_grain=QUARTER, |
| 96 | + recipe_date_part=YEAR, |
| 97 | + ) |
| 98 | +Measure(booking_count) booking__booking_time__extract_quarter AttributeRecipe( |
| 99 | +-> LocalModel(bookings_source) indexed_dunder_name=('booking', 'booking_time', 'extract_quarter'), |
| 100 | +-> bookings_source.booking joined_model_ids=(bookings_source,), |
| 101 | +-> JoinedModel(bookings_source) element_properties={DATE_PART}, |
| 102 | +-> TimeDimension(booking_time) entity_link_names=('booking',), |
| 103 | +-> TimeEntity element_type=TIME_DIMENSION, |
| 104 | +-> TimeAttribute(extract_quarter) source_time_grain=QUARTER, |
| 105 | + recipe_date_part=QUARTER, |
| 106 | + ) |
| 107 | +Measure(booking_count) booking__booking_time__custom_year AttributeRecipe( |
| 108 | +-> LocalModel(bookings_source) indexed_dunder_name=('booking', 'booking_time', 'custom_year'), |
| 109 | +-> bookings_source.booking joined_model_ids=(bookings_source,), |
| 110 | +-> JoinedModel(bookings_source) element_properties={DERIVED_TIME_GRANULARITY}, |
| 111 | +-> TimeDimension(booking_time) entity_link_names=('booking',), |
| 112 | +-> TimeEntity element_type=TIME_DIMENSION, |
| 113 | +-> TimeAttribute(custom_year) source_time_grain=QUARTER, |
| 114 | + recipe_time_grain=ExpandedTimeGranularity(name='custom_year', base_granularity=YEAR), |
| 115 | + ) |
0 commit comments