Skip to content

Commit ebcfaef

Browse files
committed
test
1 parent 774a031 commit ebcfaef

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

.github/workflows/check-contracts-and-assets.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
# Can either be specified as a space separated list ('event1.proto event2.proto'), or
129129
# a multiline string
130130
data-asset-options: |
131-
--project-root ../../pyspark \
132-
--spark-job-entrypoint "job.py --final_output_table pnw_bookings_30_days" \
133-
--csv-schema-file ../../pyspark/schemas.csv
131+
--source-type pyspark \
132+
--project-root ./pyspark \
133+
--spark-job-entrypoint job.py \
134+
--csv-schema-file ./pyspark/schemas.csv

pyspark/job.py

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
import argparse
1+
from script import run_job
2+
23
from pyspark.sql import SparkSession
34
from pyspark.sql.functions import *
45
from pyspark.sql.types import *
56

6-
from script import run_job
7-
8-
def parse_arguments(argv=None):
9-
ap = argparse.ArgumentParser()
10-
ap.add_argument("--final_output_table")
11-
return ap.parse_args(argv)
12-
13-
147
if __name__ == "__main__":
15-
# Parse args
16-
args_main = parse_arguments()
17-
final_output_table = args_main.final_output_table
8+
final_output_table = "pnw_bookings_30_days"
189
print(f"final_output_table: {final_output_table}")
1910

2011
spark = SparkSession.builder.getOrCreate()

pyspark/script.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def run_job(spark, final_output_table):
1818
timestamp(date_trunc(b.confirm_time, 'DD')) AS "booking_date",
1919
b.earning_adjustment_commission_rate AS "commission_rate",
2020
b.receipt_payment_type AS "payment_type",
21+
b.reward_id AS "reward_id",
2122
c.*,
2223
FROM
2324
bookings_30_days b

0 commit comments

Comments
 (0)