From 5c9fda4018f9fa37a965e42966d8e6d3b5ba1e49 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Wed, 1 Apr 2020 00:25:20 -0500 Subject: [PATCH] bug fix: CLI parameter handling (wrong reference) --- finalize.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/finalize.py b/finalize.py index a375b37..fd50d1d 100644 --- a/finalize.py +++ b/finalize.py @@ -139,7 +139,8 @@ import json # path = '../curation-prod.json' # credentials = service_account.Credentials.from_service_account_file(path) # df = pd.read_gbq("SELECT * FROM io.icd10_partial_io",credentials=credentials,dialect='standard') -f = open('config.json') +filename = 'config.json' if 'config' not in SYS_ARGS else SYS_ARGS['config'] +f = open(filename) config = json.loads(f.read()) args = config['pipeline'] f.close() @@ -152,8 +153,10 @@ if __name__ == '__main__' : """ if 'move' in SYS_ARGS : table = SYS_ARGS['from'] - contexts = [item['context'] for item in config['pipeline'] if item['from'] == args['from']] + contexts = [item['context'] for item in config['pipeline'] if item['from'] == SYS_ARGS['from']] args = dict(config,**{"private_key":"../curation-prod.json"}) args = dict(args,**SYS_ARGS) args['contexts'] = contexts - move(**args) \ No newline at end of file + move(**args) + else: + print ("NOT YET READY !") \ No newline at end of file