fsspec / fsspec/filesystem_spec

Add support for nested transactions

Open
#685 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

fsspec.transaction.Transaction() context manager should support nested transactions.
example usage:

def func1():
    fs = fsspec.filesystem('file')
    with fs.transaction:
        #write some files
        ...
        func2(fs)

def func2(fs):
    #this function does not know if the caller function already started a transaction on fs or not
    with fs.transaction:
        #write some other files
        ...

in the current implementation the transaction will complete (commit) once the with block in func2() completes

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with fsspec.transaction.Transaction and trace how entering and exiting the context manager currently commits. Define the behavior for an inner transaction and an outer transaction, then verify that the example keeps the transaction open until the outer with block exits.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.