Skip to content

Preview PipelineJob.run() raises TypeError: submit() got an unexpected keyword argument 'enable_preflight_validations' #7242

Open

Description

@abhishekacharya200

preview _PipelineJob.run() (google/cloud/aiplatform/preview/pipelinejob/pipeline_jobs.py) always fails with a TypeError before any request is sent:

TypeError: _PipelineJob.submit() got an unexpected keyword argument 'enable_preflight_validations'

The preview class does not override run(), so it uses the GA PipelineJob.run(), which calls self.submit(..., enable_preflight_validations=enable_preflight_validations). The preview submit() has no enable_preflight_validations parameter, so the call fails whatever value is passed. With sync=False the same error happens in the background thread and wait() raises RuntimeError: _PipelineJob resource has not been created. Resource failed with: _PipelineJob.submit() got an unexpected keyword argument 'enable_preflight_validations'.

Environment details

  • OS type and version: Linux
  • Python version: 3.11.16
  • google-cloud-aiplatform version: main (9b9f2b3)

Steps to reproduce

  1. Create a preview _PipelineJob from any pipeline spec
  2. Call run()

Code example

Sockets are blocked and only create_pipeline_job is replaced by a recorder, so nothing leaves the machine:

from google.auth.credentials import AnonymousCredentials
from google.cloud import aiplatform
from google.cloud.aiplatform.preview.pipelinejob import pipeline_jobs as preview_pipeline_jobs

aiplatform.init(project="p", location="us-central1", staging_bucket="gs://b",
                credentials=AnonymousCredentials())
job = preview_pipeline_jobs._PipelineJob(display_name="d", template_path="spec.json",
                                         pipeline_root="gs://b/root", job_id="j")
job.run(sync=True)

Stack trace

TypeError: _PipelineJob.submit() got an unexpected keyword argument 'enable_preflight_validations'

The preview __init__ already accepts enable_preflight_validations, and the v1beta1 PipelineJob has a preflight_validations field, so the fix is to accept the keyword in the preview submit() and set the field when it is True, the same way the GA submit() does.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: vertex-aiIssues related to the googleapis/python-aiplatform API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions