Skip to content

Commit

Permalink
[Python] get options outside of DoFn context in bigquery(#27662)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedabu98 authored Jul 25, 2023
1 parent 1b79c57 commit 1273d22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdks/python/apache_beam/io/gcp/bigquery_read_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,16 @@ def __init__(self, side_input=None):
self.side_input = side_input

def expand(self, input):
pipeline_options = input.pipeline.options

class PassThrough(beam.DoFn):
def process(self, element):
yield element

class CleanUpProjects(beam.DoFn):
def process(self, unused_element, unused_signal, pipeline_details):
bq = bigquery_tools.BigQueryWrapper.from_pipeline_options(
input.pipeline.options)
pipeline_options)
pipeline_details = pipeline_details[0]
if 'temp_table_ref' in pipeline_details.keys():
temp_table_ref = pipeline_details['temp_table_ref']
Expand Down

0 comments on commit 1273d22

Please sign in to comment.