Skip to content

fix(feature_store): safely parse bq:// URIs using removeprefix#6771

Open
mrishi wants to merge 4 commits into
googleapis:mainfrom
mrishi:fix-bq-uri-parsing
Open

fix(feature_store): safely parse bq:// URIs using removeprefix#6771
mrishi wants to merge 4 commits into
googleapis:mainfrom
mrishi:fix-bq-uri-parsing

Conversation

@mrishi

@mrishi mrishi commented May 12, 2026

Copy link
Copy Markdown

Description:
Fixed a bug in fetch_historical_feature_values where bq_uri.lstrip("bq://") was greedily stripping valid characters (such as 'b' or 'q') from the beginning of Google Cloud Project IDs.

Replaced lstrip with removeprefix to safely and explicitly remove only the protocol string without inadvertently mutating the project ID.

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! (Note: Submitting this straightforward bug fix directly, but happy to open an issue retroactively if required!)
  • Ensure the tests and linter pass (Relying on CI checks for this 1-line change)
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary) (N/A - bug fix)
  • Get the necessary approvals
  • Once the last commit on the PR has been approved, add the "ready to pull" label to the Pull Request

Note: do not merge your PR from GitHub. Adding the "ready to pull" label is the final step in the review process.
After approvals, the changes in your PR will be committed to the main branch and this PR will be closed.

The previous implementation used `.lstrip("bq://")`, which greedily
dropped valid characters (like 'b' or 'q') from the beginning of
Google Cloud Project IDs.

Replaced `lstrip` with `removeprefix` to explicitly remove only
the protocol string without mutating the project ID.
@mrishi mrishi requested a review from a team as a code owner May 12, 2026 07:03
@product-auto-label product-auto-label Bot added size: xs Pull request size is extra small. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels May 12, 2026
@google-cla

google-cla Bot commented May 12, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@matthew29tang

Copy link
Copy Markdown
Contributor

Can you sign the CLA?

@matthew29tang matthew29tang self-assigned this Jun 11, 2026
@mrishi

mrishi commented Jun 11, 2026

Copy link
Copy Markdown
Author

Can you sign the CLA?

Thanks, I had already signed the CLA. A re-scan was pending. Done now.

@matthew29tang

matthew29tang commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Thanks, it looks like we lstrip bq in a few other places. Could you also make the change for those files?

aiplatform/preview/datasets.py

agentplatform/resources/preview/feature_store/offline_store.py

@mrishi

mrishi commented Jun 11, 2026

Copy link
Copy Markdown
Author

Thanks, it looks like we lstrip bq in a few other places. Could you also make the change for those files?

aiplatform/preview/datasets.py

agentplatform/resources/preview/feature_store/offline_store.py

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. size: xs Pull request size is extra small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants