Skip to content

Fix t_file_name truncating dashed file names - #3433

Open
Sun-Wukhan wants to merge 1 commit into
googleapis:mainfrom
Sun-Wukhan:fix/t-file-name-dashed-uri
Open

Sun-Wukhan wants to merge 1 commit into
googleapis:mainfrom
Sun-Wukhan:fix/t-file-name-dashed-uri

Conversation

@Sun-Wukhan

Copy link
Copy Markdown

Fixes #3431

t_file_name's https branch matched the file name with [a-z0-9]+, so a file URI containing dashes was truncated at the first dash (files/my-doc became my), and a delete could target the wrong file. This widens the pattern to [a-z0-9-]+.

Adds google/genai/tests/transformers/test_t_file_name.py with regression coverage for dashed names; the existing terminator behaviour (abc123:download?alt=media -> abc123) is covered too. The new tests fail on the old code and pass with the fix.

This branch has not been deployed

No deployments
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.

files.get, files.delete and files.download truncate a file URI at the first dash

1 participant