| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…given create_gcs_eval_managers_from_uri() treated everything after `gs://` as the literal bucket name, so `gs://my-bucket/some/path` produced the invalid bucket name `my-bucket/some/path`, contradicting the docstring which says the bucket will be extracted if a path is provided. Fixes google#6881
| Back | FazBrowse Home | New Git URL |
Fixes #6881
Problem
create_gcs_eval_managers_from_uri()'s docstring says:
But the implementation never extracted a bucket from a path — it treated
everything after gs:// as the literal bucket name:
gs://my-bucket/some/path produced the invalid bucket name
my-bucket/some/path (slashes included), which is then passed to
GcsEvalSetsManager/GcsEvalSetResultsManager and fails later with a
misleading "bucket does not exist" error, even when my-bucket itself
exists.
Fix
Split off the first path segment so only the bucket name is used:
This matches the docstring's documented behavior for gs://<bucket name>
URIs. As noted in the issue, threading the remaining path through as a
storage prefix is a separate, larger change (the eval history/sets
directory helpers currently hard-code their paths) and is left out of this
minimal fix.
Testing plan
Added test_create_gcs_eval_managers_from_uri_extracts_bucket_from_path to
tests/unittests/cli/utils/test_evals.py, asserting that
gs://test-bucket/some/path results in GcsEvalSetsManager and
GcsEvalSetResultsManager being constructed with bucket_name='test-bucket'.
Confirmed the new test fails against the old code:
And passes with the fix, along with the full existing suite for this module:
Also verified pyink --check and isort --check are clean on both changed
files.
AI disclosure
This change was authored with the assistance of an AI coding agent (Claude),
with the diff reviewed before submission.