diff --git a/tap_linkedin_ads/__init__.py b/tap_linkedin_ads/__init__.py index 8da87df..2d0ba27 100644 --- a/tap_linkedin_ads/__init__.py +++ b/tap_linkedin_ads/__init__.py @@ -21,7 +21,7 @@ def do_discover(client): LOGGER.info('Starting discover') - client.check_accounts(client.get_config()) + client.check_accounts(client.config) catalog = _discover() json.dump(catalog.to_dict(), sys.stdout, indent=2) LOGGER.info('Finished discover') diff --git a/tap_linkedin_ads/client.py b/tap_linkedin_ads/client.py index eff32a9..23b55ea 100644 --- a/tap_linkedin_ads/client.py +++ b/tap_linkedin_ads/client.py @@ -134,6 +134,7 @@ def __init__(self, # pylint: disable=too-many-arguments self.__client_secret = client_secret self.__refresh_token = refresh_token self.__config_path = config_path + self.config = self.get_config() self.__user_agent = user_agent self.__access_token = access_token self.__expires = None @@ -192,6 +193,7 @@ def write_access_token_to_config(self): config = json.load(file) # Set new access_token config['access_token'] = self.__access_token + self.config = config with open(self.__config_path, 'w') as file: json.dump(config, file, indent=2) diff --git a/tap_linkedin_ads/streams.py b/tap_linkedin_ads/streams.py index d998f70..9d26c67 100644 --- a/tap_linkedin_ads/streams.py +++ b/tap_linkedin_ads/streams.py @@ -315,7 +315,7 @@ def sync_endpoint(self, url_list = [] if self.tap_stream_id in NEW_PATH_STREAMS: querystring = '&'.join(['%s=%s' % (key, value) for (key, value) in endpoint_params.items()]) - config = client.get_config() + config = client.config account_list = config['accounts'].replace(" ", "").split(",") for account in account_list: url = '{}/adAccounts/{}/{}?{}'.format(BASE_URL, account, self.path, querystring) diff --git a/tap_linkedin_ads/sync.py b/tap_linkedin_ads/sync.py index b5bf329..fedf5b0 100644 --- a/tap_linkedin_ads/sync.py +++ b/tap_linkedin_ads/sync.py @@ -70,7 +70,7 @@ def sync(client, catalog, state): """ sync selected streams. """ - config = client.get_config() + config = client.config start_date = config['start_date'] page_size = get_page_size(config)