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

Small fixes for fsspec backend, Enable fsspec tests for s3fs and smb #247

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

painebot
Copy link
Contributor

@painebot painebot commented Feb 22, 2025

#238 (comment)

Fixes a few small things, I suspect all of these were because i started from the fsspec implementation that had bitrotted a bit (due to our slowness in getting to it).

@@ -85,7 +85,7 @@ jobs:

- name: Test
run: make coverage
if: matrix.os == 'ubuntu-latest'
if: matrix.os != 'windows-latest'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runs local filesystem tests on mac, I validated docker tests (samba and s3) locally but unfortunately no more docker support on mac arm on GHA due to licensing issues.

# Fix any differences due to root markers
path = path.replace("//", "/")

# TODO better carveouts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should consider a more rigorous mechanism for determining backend-specific behavior. i didn't want to just check s3:// because theoretically there could be other registered s3 backends that are not s3fs.

if PurePosixPath(path).name.startswith("."):
return True

# TODO PyFilesystem implementation does more, perhaps we should as well
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO inline

if self._fs.__class__.__name__.startswith("S3"):
# need to make a file temporarily
# use the convention of a hidden file
self._fs.touch(f"{path}/.s3fskeep")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

folders aren't real in s3, i adopted the convention many s3 backends do which is to force the creation of a "directory" by creating a file. e.g. on backblaze its called .bzEmpty.

@@ -23,7 +25,8 @@

test_root_osfs = "osfs_local"

test_url_s3 = "http://127.0.0.1/"
# test_url_s3 = "http://127.0.0.1/"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was a reason for this at some point, but i validated this against s3 tests on my local mac.



@pytest.mark.skipif(which("docker") is None, reason="requires docker")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see note above, tested locally on mac against docker but cannot use docker in arm macs on GHA.

@timkpaine timkpaine merged commit ca5ec71 into jpmorganchase:main Feb 22, 2025
3 checks passed
@timkpaine timkpaine mentioned this pull request Feb 22, 2025
3 tasks
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 this pull request may close these issues.

2 participants