This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import libraries | |
from datetime import datetime, timedelta | |
from airflow import DAG | |
from airflow.operators.python_operator import PythonOperator | |
from airflow.operators.bash_operator import BashOperator | |
# the default parameters for each operation/task | |
default_args = { | |
'owner': 'big_data_guy', | |
'depends_on_past': False, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sum_of_two_numbers(first_number, second_number): | |
return first_number + second_number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sum_of_two_numbers(a, b): | |
""" | |
The function to calculates the sum of two numbers | |
Parameters: | |
a: integer -> the first number | |
b: integer -> the second number | |
Return: | |
sum: integer -> the result which is the sum of a and b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: add a fix later on. The use of this value is temporary | |
system_stability_rate = 0.4581345 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculate_pay(hourly_pay_rate, work_hours, | |
overtime_pay_rate, overtime_work_hours, | |
is_eligible_overtime_rate): | |
total_pay = 0 | |
totay_pay = hourly_pay_rate * work_hours | |
if is_eligible_overtime_rate: | |
total_pay = total_pay + overtime_pay_rate * overtime_work_hours | |
else: | |
total_pay = total_pay + hourly_pay_rate * overtime_work_hours | |
return total_pay |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculate_pay(r, h, ovt, ovh, e): | |
""" | |
Function to calculate pay of a specific employee | |
Parameters: | |
r: the hourly pay rate | |
h: the work hours | |
ovt: the overtime pay rate | |
ovh: the overtime work hours | |
e: indicate if employee is eligible for overtime pay | |
Return: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"visitorId": 1, | |
"visitTimestamp": 1734239123, | |
"utcDay": "2020-04-01T15:24:25Z", | |
"siteActivities": { | |
"pageViews": 2, | |
"buttonClicks": 1, | |
"newVisit": true, | |
"timeOnScreen": 12 | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"visitorId": "1", | |
"visitId": "1501583974", | |
"visitStartTime": "1501583974", | |
"date": "20170801", | |
"totals": { | |
"visits": "1", | |
"pageviews": "1", | |
"timeOnSite": null, // -> a lot of NULL values | |
"bounces": "1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source code reference: https://developers.google.com/protocol-buffers/docs/javatutorial | |
syntax = "proto2"; | |
package tutorial; | |
option java_package = "com.example.tutorial"; | |
option java_outer_classname = "AddressBookProtos"; | |
message Person { | |
required string name = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"people": [ | |
{ | |
"name": "John Doe", | |
"id": 1, | |
"email": "[email protected]", | |
"phoneType": "Mobile", | |
"phoneNumbers": [ | |
{ | |
"number": "1-541-754-3010", |