fsspec / fsspec/gcsfs

Why doesn't gcsfs allow projects different from the default project in google_default?

Open
#483 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
398
Forks
181
Avg merge
2d 10h
Merged PRs (30d)
36

Description

With account which has $ gcloud config get-value project # => project-a,

fs = gcsfs.GCSFileSystem(project='project-b')

raise validation error:

ValueError: User-provided project 'project-b' does not match the google default project 'project-a'. Either

  1. Accept the google-default project by not passing a `project` to GCSFileSystem
  2. Configure the default project to match the user-provided project (gcloud config set project)
  3. Use an authorization method other than 'google_default' by providing 'token=...'

However, I do want to use another project. Why gcsfs doesn't allow this?

My google_default account has correct permission to access project-b so it's no problem to access from the account. (I believe the account's default project doesn't matter.)

For option2, I use multiple fs objects for multiple projects with single google_default account, so I can't switch default project (gcloud config set project) to match.

For option3, I would like to use the Application Default Credential mechanism to make it work conveniently both on cloud and local.

Contributor guide

Open the contributing guide

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 by reproducing the GCSFileSystem(project='project-b') case with google_default while gcloud config uses project-a. Trace the google_default validation that rejects the mismatch and verify how Application Default Credentials are selected. Done means separate filesystem objects can target different projects without changing the gcloud default, with regression coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud, python
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.