-
Notifications
You must be signed in to change notification settings - Fork 1
/
facts.py
110 lines (96 loc) · 2.88 KB
/
facts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
from pygrametl.tables import FactTable
"""
This module contains factory parameters for various pygrametl FactTable
instances. These will be used to do the heavy lifting
within the ETL pipeline.
"""
pygram_product_sale_fact_factory = {
"class": FactTable,
"name": 'product_sale_fact',
"measures": ['extended_sales_amount',
'transaction_fee',
'extended_discount_amount',
'seller_unit_price',
'quantity',
'sale_datetime'],
"timestamp_field": 'sale_datetime',
"keyrefs": ['date_fk',
'flashnotes_date_fk',
'product_fk',
'school_fk',
'course_fk',
'seller_fk',
'buyer_fk',
'payment_source_fk',
'seller_disability_program_fk',
'buyer_disability_program_fk',
'site_fk',
'bundle_purchased_fk',
'affiliate_fk'],
}
pygram_product_upload_fact_factory = {
"class": FactTable,
"name": 'product_upload_fact',
"measures": ['upload_datetime'],
"timestamp_field": 'upload_datetime',
"keyrefs": ['date_fk',
'flashnotes_date_fk',
'product_fk',
'school_fk',
'course_fk',
'seller_fk',
'seller_disability_program_fk',
'site_fk',
'affiliate_fk'],
}
pygram_account_registration_fact_factory = {
"class": FactTable,
"name": 'account_registration_fact',
"measures": [],
"keyrefs": ['date_fk',
'user_fk',
'school_fk',
'disability_program_fk',
'site_fk',
'affiliate_fk'],
}
pygram_credit_redemption_fact_factory = {
"class": FactTable,
"name": 'credit_redemption_fact',
"measures": ['amount'],
"keyrefs": ['date_fk',
'buyer_fk',
'site_fk',
'credit_campaign_fk'],
}
pygram_disability_enrollment_fact_factory = {
"class": FactTable,
"name": 'disability_enrollment_fact',
"measures": [],
"keyrefs": ['date_fk',
'user_fk',
'course_fk',
'disability_program_fk'],
}
pygram_payout_fact_factory = {
"class": FactTable,
"name": 'payout_fact',
"measures": ['payout_amount',
'sales_payout_amount',
'non_sales_payout_amount'],
"keyrefs": ['date_fk',
'user_fk',
'disability_program_fk',
'payout_method_fk'],
}
pygram_product_review_fact_factory = {
"class": FactTable,
"name": 'product_review_fact',
"measures": [],
"keyrefs": ['date_fk',
'product_fk',
'seller_fk',
'buyer_fk',
'site_fk',
'bundle_purchased_fk'],
}