def do_connect(self): """Establish connection object.""" token = lib.auth( tenant_id=self.tenant_id, client_id=self.client_id, client_secret=self.client_secret, ) self.azure_fs = AzureDLFileSystem(token=token, store_name=self.store_name)
def second_azure(): from azure.datalake.store import AzureDLFileSystem fs = AzureDLFileSystem(token=settings.TOKEN, store_name=settings.STORE_NAME) # Clear filesystem cache to ensure we capture all requests from a test fs.invalidate_cache() yield fs
def __init__(self, tenant_id, client_id, client_secret, store_name, metadata=None): token = lib.auth(tenant_id=tenant_id, client_id=client_id, client_secret=client_secret) self.adl = AzureDLFileSystem(store_name=store_name, token=token) super(WritableTextFilesADLSource, self).__init__(metadata=metadata)
def __init__(self, tenant_id=None, client_id=None, client_secret=None, **kwargs): self.tenant_id = tenant_id self.client_id = client_id self.client_secret = client_secret self.kwargs = kwargs # self.kwargs['store_name'] = kwargs['host'] token = lib.auth( tenant_id=self.tenant_id, client_id=self.client_id, client_secret=self.client_secret, ) self.kwargs["token"] = token self.fs = AzureDLFileSystem(**self.kwargs)
def setup_env(request): home = working_dir() fs = AzureDLFileSystem(store_name=settings.STORE_NAME, token=settings.TOKEN) if settings.RECORD_MODE != 'none': if not fs.exists(home): fs.mkdir(home)