-
Notifications
You must be signed in to change notification settings - Fork 0
/
Extractor.py
44 lines (32 loc) · 980 Bytes
/
Extractor.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
# Databricks notebook source
# MAGIC %run "./reader_factory"
# COMMAND ----------
class Extractor:
"""
Abstract class
"""
def __init__(self):
pass
def extract(self):
pass
class AirpodsAfterIphoneExtractor(Extractor):
def extract(self):
"""
Implementing steps to extract or read data
"""
transactionInputDF=get_data_source(
data_type="csv",
file_path="dbfs:/FileStore/apple-sales-analysis/Transaction_Updated.csv"
).get_data_frame()
transactionInputDF.orderBy("customer_id","transaction_date").show()
customerInputDF=get_data_source(
data_type="delta",
file_path="default.customer_delta_table"
).get_data_frame()
customerInputDF.show()
inputDFs={
"transactionInputDF":transactionInputDF,
"customerInputDF":customerInputDF
}
return inputDFs
# COMMAND ----------