Skip to content

Update stringify_path to work with legacy ParquetDatasetPiece - #630

Merged
martindurant merged 2 commits into
fsspec:masterfrom
GenevieveBuckley:stringify-path
May 13, 2021
Merged

martindurant merged 2 commits into
fsspec:masterfrom
GenevieveBuckley:stringify-path

Conversation

@GenevieveBuckley

Copy link
Copy Markdown
Contributor

Update the stringify_path method to return a string, if the object can be coerced to string.

A lot of the tests in dask/dask#7303 are currently failing. This looks like it's because the legacy pyarrow test cases in dask are trying to pass a ParquetDatasetPiece object through the stringify_path method of fsspec, which isn't converting it to a string.

When I make the change in this PR, and then re-run the dask tests for dask/dask#7303 many fewer tests fail. (There are probably some unrelated things in dask that still need to be tidied up, but I haven't looked into those test failures yet).

@GenevieveBuckley GenevieveBuckley mentioned this pull request May 7, 2021
2 of 3 tasks
Comment thread fsspec/utils.py Resolved
@martindurant

Copy link
Copy Markdown
Member

I'm doing recordings for gcsfs anyway, so this may just fix itself.

@martindurant

Copy link
Copy Markdown
Member

Nope, still fails... Does gcsfs pass for you locally with or without this change?

@GenevieveBuckley

Copy link
Copy Markdown
Contributor Author

Nope, still fails... Does gcsfs pass for you locally with or without this change?

I'm getting the same test failure on the master branch.

cd GitHub/filesystem_spec
git checkout master
conda env create -f ci/environment-py38.yml 
conda activate test_env
tox -e gcsfs

The failing test is the same as the one failing in the CI checks here.

Details:
gcsfs/gcsfs/tests/test_retry.py::test_metadata_read_permissions[existing_with_list_perms] PASSED [100%]

=================================== FAILURES ===================================
_________________________ test_GoogleCredentials_None __________________________

    @my_vcr.use_cassette(match=["all"])
    def test_GoogleCredentials_None():
>       credentials = GoogleCredentials(project=None, token=None, access="read_only")

gcsfs/gcsfs/tests/test_credentials.py:7: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gcsfs/gcsfs/credentials.py:52: in __init__
    self.connect(method=token)
gcsfs/gcsfs/credentials.py:214: in connect
    self.connect(method=meth)
gcsfs/gcsfs/credentials.py:226: in connect
    self.__getattribute__("_connect_" + method)()
gcsfs/gcsfs/credentials.py:73: in _connect_google_default
    credentials, project = gauth.default(scopes=[self.scope])
../lib/python3.9/site-packages/google/auth/_default.py:454: in default
    credentials, project_id = checker()
../lib/python3.9/site-packages/google/auth/_default.py:450: in <lambda>
    lambda: _get_gce_credentials(request),
../lib/python3.9/site-packages/google/auth/_default.py:272: in _get_gce_credentials
    if _metadata.ping(request=request):
../lib/python3.9/site-packages/google/auth/compute_engine/_metadata.py:85: in ping
    response = request(
../lib/python3.9/site-packages/google/auth/transport/_http_client.py:107: in __call__
    response = connection.getresponse()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <vcr.patch.VCRHTTPConnection/home/genevieve/GitHub/filesystem_spec/.tox/gcsfs/tmp/gcsfs/gcsfs/tests/recordings/test_GoogleCredentials_None.yaml object at 0x7fbf0a2333d0>
_ = False, kwargs = {}

    def getresponse(self, _=False, **kwargs):
        """Retrieve the response"""
        # Check to see if the cassette has a response for this request. If so,
        # then return it
        if self.cassette.can_play_response_for(self._vcr_request):
            log.info("Playing response for {} from cassette".format(self._vcr_request))
            response = self.cassette.play_response(self._vcr_request)
            return VCRHTTPResponse(response)
        else:
            if self.cassette.write_protected and self.cassette.filter_request(self._vcr_request):
>               raise CannotOverwriteExistingCassetteException(
                    cassette=self.cassette, failed_request=self._vcr_request
                )
E               vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('/home/genevieve/GitHub/filesystem_spec/.tox/gcsfs/tmp/gcsfs/gcsfs/tests/recordings/test_GoogleCredentials_None.yaml') in your current record mode ('none').
E               No match for the request (<Request (GET) http://169.254.169.254>) was found.
E               No similar requests, that have not been played, found.

../lib/python3.9/site-packages/vcr/stubs/__init__.py:231: CannotOverwriteExistingCassetteException
=========================== short test summary info ============================
FAILED gcsfs/gcsfs/tests/test_credentials.py::test_GoogleCredentials_None - v...
= 1 failed, 92 passed, 10 skipped, 1 deselected, 1 xfailed, 1 xpassed in 37.15s =
ERROR conda.cli.main_run:execute(33): Subprocess for 'conda run ['/home/genevieve/GitHub/filesystem_spec/.tox/gcsfs/bin/py.test', '-vv', 'gcsfs/gcsfs', '-k', 'not fuse']' command failed.  (See above for error)
ERROR: InvocationError for command /home/genevieve/GitHub/filesystem_spec/.tox/gcsfs/bin/py.test -vv gcsfs/gcsfs -k 'not fuse' (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   gcsfs: commands failed

@martindurant

Copy link
Copy Markdown
Member

OK, so I'll merge this and figure out how to get the gcsfs test to pass separately

@martindurant
martindurant merged commit aa46bf1 into fsspec:master May 13, 2021
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