|
| 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 | +{ |
| 7 | + 'metric_time__quarter': AttributeRecipe( |
| 8 | + indexed_dunder_name=('metric_time', 'quarter'), |
| 9 | + joined_model_ids=(bookings_source,), |
| 10 | + element_properties={METRIC_TIME}, |
| 11 | + element_type=TIME_DIMENSION, |
| 12 | + source_time_grain=QUARTER, |
| 13 | + recipe_time_grain=ExpandedTimeGranularity(name='quarter', base_granularity=QUARTER), |
| 14 | + ), |
| 15 | + 'metric_time__year': AttributeRecipe( |
| 16 | + indexed_dunder_name=('metric_time', 'year'), |
| 17 | + joined_model_ids=(bookings_source,), |
| 18 | + element_properties={METRIC_TIME}, |
| 19 | + element_type=TIME_DIMENSION, |
| 20 | + source_time_grain=QUARTER, |
| 21 | + recipe_time_grain=ExpandedTimeGranularity(name='year', base_granularity=YEAR), |
| 22 | + ), |
| 23 | + 'metric_time__extract_year': AttributeRecipe( |
| 24 | + indexed_dunder_name=('metric_time', 'extract_year'), |
| 25 | + joined_model_ids=(bookings_source,), |
| 26 | + element_properties={METRIC_TIME, DATE_PART}, |
| 27 | + element_type=TIME_DIMENSION, |
| 28 | + source_time_grain=QUARTER, |
| 29 | + recipe_date_part=YEAR, |
| 30 | + ), |
| 31 | + 'metric_time__extract_quarter': AttributeRecipe( |
| 32 | + indexed_dunder_name=('metric_time', 'extract_quarter'), |
| 33 | + joined_model_ids=(bookings_source,), |
| 34 | + element_properties={METRIC_TIME, DATE_PART}, |
| 35 | + element_type=TIME_DIMENSION, |
| 36 | + source_time_grain=QUARTER, |
| 37 | + recipe_date_part=QUARTER, |
| 38 | + ), |
| 39 | + 'metric_time__custom_year': AttributeRecipe( |
| 40 | + indexed_dunder_name=('metric_time', 'custom_year'), |
| 41 | + joined_model_ids=(bookings_source,), |
| 42 | + element_properties={METRIC_TIME, DERIVED_TIME_GRANULARITY}, |
| 43 | + element_type=TIME_DIMENSION, |
| 44 | + source_time_grain=QUARTER, |
| 45 | + recipe_time_grain=ExpandedTimeGranularity(name='custom_year', base_granularity=YEAR), |
| 46 | + ), |
| 47 | + 'booking': AttributeRecipe( |
| 48 | + indexed_dunder_name=('booking',), |
| 49 | + joined_model_ids=(bookings_source,), |
| 50 | + element_properties={ENTITY}, |
| 51 | + element_type=ENTITY, |
| 52 | + ), |
| 53 | + 'listing': AttributeRecipe( |
| 54 | + indexed_dunder_name=('listing',), |
| 55 | + joined_model_ids=(bookings_source,), |
| 56 | + element_properties={ENTITY}, |
| 57 | + element_type=ENTITY, |
| 58 | + ), |
| 59 | + 'listing__country_latest': AttributeRecipe( |
| 60 | + indexed_dunder_name=('listing', 'country_latest'), |
| 61 | + joined_model_ids=(bookings_source, listings_source), |
| 62 | + entity_link_names=('listing',), |
| 63 | + element_type=DIMENSION, |
| 64 | + ), |
| 65 | + 'booking__listing': AttributeRecipe( |
| 66 | + indexed_dunder_name=('booking', 'listing'), |
| 67 | + joined_model_ids=(bookings_source,), |
| 68 | + element_properties={ENTITY}, |
| 69 | + entity_link_names=('booking',), |
| 70 | + element_type=ENTITY, |
| 71 | + ), |
| 72 | + 'booking__booking_time__quarter': AttributeRecipe( |
| 73 | + indexed_dunder_name=('booking', 'booking_time', 'quarter'), |
| 74 | + joined_model_ids=(bookings_source,), |
| 75 | + entity_link_names=('booking',), |
| 76 | + element_type=TIME_DIMENSION, |
| 77 | + source_time_grain=QUARTER, |
| 78 | + recipe_time_grain=ExpandedTimeGranularity( |
| 79 | + name='quarter', |
| 80 | + base_granularity=QUARTER, |
| 81 | + ), |
| 82 | + ), |
| 83 | + 'booking__booking_time__year': AttributeRecipe( |
| 84 | + indexed_dunder_name=('booking', 'booking_time', 'year'), |
| 85 | + joined_model_ids=(bookings_source,), |
| 86 | + entity_link_names=('booking',), |
| 87 | + element_type=TIME_DIMENSION, |
| 88 | + source_time_grain=QUARTER, |
| 89 | + recipe_time_grain=ExpandedTimeGranularity(name='year', base_granularity=YEAR), |
| 90 | + ), |
| 91 | + 'booking__booking_time__extract_year': AttributeRecipe( |
| 92 | + indexed_dunder_name=('booking', 'booking_time', 'extract_year'), |
| 93 | + joined_model_ids=(bookings_source,), |
| 94 | + element_properties={DATE_PART}, |
| 95 | + entity_link_names=('booking',), |
| 96 | + element_type=TIME_DIMENSION, |
| 97 | + source_time_grain=QUARTER, |
| 98 | + recipe_date_part=YEAR, |
| 99 | + ), |
| 100 | + 'booking__booking_time__extract_quarter': AttributeRecipe( |
| 101 | + indexed_dunder_name=('booking', 'booking_time', 'extract_quarter'), |
| 102 | + joined_model_ids=(bookings_source,), |
| 103 | + element_properties={DATE_PART}, |
| 104 | + entity_link_names=('booking',), |
| 105 | + element_type=TIME_DIMENSION, |
| 106 | + source_time_grain=QUARTER, |
| 107 | + recipe_date_part=QUARTER, |
| 108 | + ), |
| 109 | + 'booking__booking_time__custom_year': AttributeRecipe( |
| 110 | + indexed_dunder_name=('booking', 'booking_time', 'custom_year'), |
| 111 | + joined_model_ids=(bookings_source,), |
| 112 | + element_properties={DERIVED_TIME_GRANULARITY}, |
| 113 | + entity_link_names=('booking',), |
| 114 | + element_type=TIME_DIMENSION, |
| 115 | + source_time_grain=QUARTER, |
| 116 | + recipe_time_grain=ExpandedTimeGranularity( |
| 117 | + name='custom_year', |
| 118 | + base_granularity=YEAR, |
| 119 | + ), |
| 120 | + ), |
| 121 | +} |
0 commit comments