fsspec / fsspec/filesystem_spec
Simplify AbstractFileSystem.__init__
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 490
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 38
Description
I'd like to simplify AbstractFileSystem.__init__ in a few ways.
- Remove dynamically modifed docstrings
See https://github.com/intake/filesystem_spec/pull/177.
- Remove dynamically added methods.
Right now we dynamically add methods for the aliases. I think we should either move those to an AliasMixin class, or just make them part of the interface. Is there anybody using add_aliases=False?
- Rework
_transactionandtransaction. - Remove the
_singletonlist - (maybe) Switch to using a metaclass for caching instances of AbstractFileSystem. Right now, the classes
__init__method is always run, even if we're returning the cached version. I need to investigate this further.
Items 2, 3, and 4 create circular references to instances of AbstractFileSystem, so that they're never actually deleted unless the cache is manually emptied.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading AbstractFileSystem.init and the linked pull request 177, then trace the alias methods, transaction handling, singleton list, and instance caching described in the issue. The work is done when the proposed initialization and lifecycle simplifications are resolved without the reported circular references, with the relevant existing behavior preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100