fix(ingest/vertexai): pass credentials to project discovery client#18135
Open
eylulyr wants to merge 1 commit into
Open
fix(ingest/vertexai): pass credentials to project discovery client#18135eylulyr wants to merge 1 commit into
eylulyr wants to merge 1 commit into
Conversation
Contributor
|
Linear: ING-2950 Thanks for your contribution! We have created an internal ticket to track this PR. A member of the core DataHub team will be assigned to review it within the next few business days - you will get a follow-up comment once a reviewer is assigned. |
VertexAI project resolution built a credential-less ProjectsClient, so project_id_pattern / project_labels discovery fell back to Application Default Credentials. On executors without ambient ADC (e.g. the managed remote executor) this raised DefaultCredentialsError and aborted ingestion before any extraction, even when a service-account credential block was configured in the recipe. Thread self._credentials into ProjectsClient in _resolve_target_projects, matching the Dataplex source. resolve_gcp_projects already accepts an optional projects_client; VertexAI simply wasn't supplying one. Add a regression test asserting the discovery client is built with the source's credentials and handed to resolve_gcp_projects. Co-authored-by: Claude <noreply@anthropic.com>
15d97a8 to
9c8b9b7
Compare
sgomezvillamor
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VertexAI ingestion using project_id_pattern or project_labels fails at startup with DefaultCredentialsError, even when a service account credential block is configured in the recipe. Project discovery builds its Cloud Resource Manager client without credentials, so it falls back to Application Default Credentials, which are not present on the executor.
This PR threads the source's configured credentials into the discovery client,
matching the Dataplex source.
Root cause
VertexAISource._resolve_target_projects() called resolve_gcp_projects(filter_cfg, self.report) without a projects_client, so the helper constructed a bare ProjectsClient() that uses ADC. The configured credentials (already used for aiplatform.init() and MetadataServiceClient) were never applied to project discovery. The failure happens in init, before any extraction.
Fix
Pass a credentialed ProjectsClient to resolve_gcp_projects, built only when discovery is actually needed (project_ids is empty).
This is exactly what the Dataplex source already does in its
_project_idsresolution, and consistent with BigQuery passing explicit credentials to its GCP
clients. Only the VertexAI caller was missing it.
Testing
Two unit tests in tests/unit/vertexai/test_vertexai_source.py:
Full VertexAI source suite passes (20 tests).
Checklist
required IAM permissions are unchanged)