feat: pull gcp token from env variables#3583
Conversation
|
ACTION NEEDED The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. For details on the error please inspect the "PR Title Check" action. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3583 +/- ##
==========================================
- Coverage 78.77% 78.67% -0.10%
==========================================
Files 254 258 +4
Lines 95451 96817 +1366
Branches 95451 96817 +1366
==========================================
+ Hits 75188 76172 +984
- Misses 17156 17578 +422
+ Partials 3107 3067 -40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
wjones127
left a comment
There was a problem hiding this comment.
Have you tested this? I'm confused as to why this would work if it's not parseable from GoogleConfigKey?
@wjones127 Yea, we tested it by setting the environment variable of "google_storage_token", not passing in storage options, and making sure that datasets can be created and read. For clarification, this PR address the fact that "google_storage_token" is not in the GoogleConfigKey enums, as arrow does not yet support token-based auth for GCP (I filed an issue here apache/arrow-rs-object-store#300). We're using token-based auth for our case and need the environment variable to be picked up and set in storage_options, so we're adding a special case check for it to get picked up if it exists, despite not being a parseable from GoogleConfigKey |
If ObjectStore doesn't support using that kind of authentication, then how is it working? Doesn't object store need to use the token in order for the GCS to accept connections from object stores?
It sounds like you are using some sort of workaround here where you are manually constructing the store yourself. Does this mean you are just using |
Because object store doesn't support that kind of auth in it's methods, we made the change (https://github.com/lancedb/lance/pull/3511/files) to lance to directly instantiate the credential provider on lance side when parsing storage options. Because objectstore doesn't have the token providing fully built in, that means it doesn't work with
Your statement is pretty correct, it is effectively a temporary place to hold the key until we hit the code from the PR above where we directly build the credentials. When object-store adds the direct access-token support, both this and the previous PR should be able to be reverted. Let me know if that makes sense! |
wjones127
left a comment
There was a problem hiding this comment.
Thanks for explaining the context.
|
It looks like you have a few simple lint fixes you'll need to make before we can merge. |
after lance-format#3511, we discovered that we also needed support for setting the token through environment variables, so this sets storage options with the "google_storage_token" env variable --------- Co-authored-by: Alexandra Li <alexandra.li@databricks.com>
after #3511, we discovered that we also needed support for setting the token through environment variables, so this sets storage options with the "google_storage_token" env variable