Coverage for libs/sdc_etl_libs/sdc_data_exchange/SDCDataExchangeEndpoint.py : 47%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
2from abc import ABCMeta, abstractmethod
3from sdc_etl_libs.sdc_credentials.sdc_endpoint_credentials import SDCEndpointCredentials
6class SDCDataExchangeEndpoint(metaclass=ABCMeta):
8 def create_exchange_endpoint(self):
9 raise Exception("Do not use base class implementation of create_exchange_endpoint.")
11 def get_data_as_file_object(self):
12 raise Exception("Do not use base class implementation of get_data_as_file_object.")
14 def write_file(self, file_name_, file_object_):
15 raise Exception("Do not use base class implementation of write_file.")
17 def write_dataframe(self, sdcdf_, **kwargs):
18 raise Exception("Do not use base class implementation of write_dataframe.")
20 def grab_credentials(self) -> dict:
21 """
22 Checks for credentials store information in the class's endpoint schema and triggers the proper
23 method for grabbing credentials.
24 :return: Dict or None. Credentials (if available and accessible).
25 """
27 creds = None
28 if "credentials" in self.endpoint_schema["info"]["access"]:
29 if self.endpoint_schema["info"]["access"]["credentials"] is not None:
30 creds = SDCEndpointCredentials.get_credentials(self.endpoint_schema["info"]["access"]["credentials"])
31 return creds