Skip to content

Commit

Permalink
Rename master references to table_list
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdinter committed Sep 7, 2018
1 parent 2e80904 commit 0adf9f9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions composer/workflows/bq_copy_across_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,19 @@
# --------------------------------------------------------------------------------


def read_master_file(master_file):
def read_table_list(table_list_file):
"""
Reads the master CSV file that will help in creating Airflow tasks in
the DAG dynamically.
:param master_file: (String) The file location of the master file,
:param table_list_file: (String) The file location of the master file,
e.g. '/home/airflow/framework/master.csv'
:return master_record_all: (List) List of Python dictionaries containing
the information for a single row in master CSV file.
"""
master_record_all = []
logger.info('Reading master_file from : %s' % str(master_file))
logger.info('Reading table_list_file from : %s' % str(table_list_file))
try:
with open(master_file, 'rb') as csv_file:
with open(table_list_file, 'rb') as csv_file:
csv_reader = csv.reader(csv_file)
next(csv_reader) # skip the headers
for row in csv_reader:
Expand All @@ -120,7 +120,7 @@ def read_master_file(master_file):
master_record_all.append(master_record)
return master_record_all
except IOError as e:
logger.error('Error opening master_file %s: ' % str(master_file), e)
logger.error('Error opening table_list_file %s: ' % str(table_list_file), e)


# --------------------------------------------------------------------------------
Expand All @@ -145,7 +145,7 @@ def read_master_file(master_file):
)

# Get the table list from master file
all_records = read_master_file(table_list_file_path)
all_records = read_table_list(table_list_file_path)

# Loop over each record in the 'all_records' python list to build up
# Airflow tasks
Expand Down

0 comments on commit 0adf9f9

Please sign in to comment.