Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the loop attribute is now broken on newer versions of fsspec #197

Closed
isidentical opened this issue Mar 19, 2021 · 2 comments · Fixed by #198
Closed

Setting the loop attribute is now broken on newer versions of fsspec #197

isidentical opened this issue Mar 19, 2021 · 2 comments · Fixed by #198

Comments

@isidentical
Copy link
Member

Please see fsspec/filesystem_spec#572 for details but simply the problem is loop on AsyncFileSystem is now a property without a setter so adlfs can't simply set it (reproducer would be just caling AzureBlobFileSystem()) and fails wit the following error;

    def __init__(
        self,
        account_name: str = None,
        account_key: str = None,
        connection_string: str = None,
        credential: str = None,
        sas_token: str = None,
        request_session=None,
        socket_timeout: int = None,
        blocksize: int = create_configuration(storage_sdk="blob").max_block_size,
        client_id: str = None,
        client_secret: str = None,
        tenant_id: str = None,
        loop=None,
        asynchronous: bool = False,
        default_fill_cache: bool = True,
        default_cache_type: str = "bytes",
        **kwargs,
    ):
        super_kwargs = {
            k: kwargs.pop(k)
            for k in ["use_listings_cache", "listings_expiry_time", "max_paths"]
            if k in kwargs
        }  # pass on to fsspec superclass
        super().__init__(asynchronous=asynchronous, **super_kwargs)
        self.account_name = account_name or os.getenv("AZURE_STORAGE_ACCOUNT_NAME")
        self.account_key = account_key or os.getenv("AZURE_STORAGE_ACCOUNT_KEY")
        self.connection_string = connection_string or os.getenv(
            "AZURE_STORAGE_CONNECTION_STRING"
        )
        self.sas_token = sas_token or os.getenv("AZURE_STORAGE_SAS_TOKEN")
        self.client_id = client_id or os.getenv("AZURE_STORAGE_CLIENT_ID")
        self.client_secret = client_secret or os.getenv("AZURE_STORAGE_CLIENT_SECRET")
        self.tenant_id = tenant_id or os.getenv("AZURE_STORAGE_TENANT_ID")
        self.credential = credential
        self.request_session = request_session
        self.socket_timeout = socket_timeout
        self.blocksize = blocksize
>       self.loop = loop or get_loop()
E       AttributeError: can't set attribute

/home/isidentical/.venv38/lib/python3.8/site-packages/adlfs/spec.py:388: AttributeError
@hayesgb
Copy link
Collaborator

hayesgb commented Mar 22, 2021

Does this need to be pinned to a specific version of fsspec, or is it backward compatible?

@isidentical
Copy link
Member Author

It is always good to fix dependencies, though I think my patch should work on all versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants