Skip to content

Commit

Permalink
draft 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ohnorobo committed Jun 7, 2023
1 parent dc8bbf5 commit 8185ceb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pipeline/beam_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,17 @@ def _get_pipeline_options(self, scan_type: str,
pipeline_options.view_as(SetupOptions).save_main_session = True
return pipeline_options

def derive_dashboard_rows(rows: beam.PCollection[schema.HyperquackRow]) -> beam.PCollection[DashboardRow]:
sql_query = open('table/queries/merge_hyperquack.sql').read()
def derive_dashboard_rows(self, rows: beam.PCollection[schema.HyperquackRow]) -> beam.PCollection[DashboardRow]:
from pprint import pprint

dash_rows = (rows | 'derive dashboard rows' >> beam.transform.sql.SqlTransform(sql_query))
sql_query = ''.join(open('table/queries/merge_hyperquack.sql').read())

pprint(sql_query)

dash_rows = (rows | 'derive dashboard rows' >> beam.transforms.sql.SqlTransform(sql_query))

pprint("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
pprint(dash_rows)

return dash_rows

Expand Down

0 comments on commit 8185ceb

Please sign in to comment.