Skip to content

Conversation

google-labs-jules[bot]
Copy link
Contributor

@google-labs-jules google-labs-jules bot commented Sep 29, 2025

This change introduces the ExternalRuntimeOptions class to the
google.cloud.bigquery.routine module, allowing users to configure
runtime options for external routines.

Key changes:

  • Created the ExternalRuntimeOptions class with setters and getters for
    container_memory, container_cpu, runtime_connection,
    max_batching_rows, and runtime_version.
  • Updated the Routine class to include an external_runtime_options
    property that accepts an ExternalRuntimeOptions object.
  • Added comprehensive unit tests for the new class and its integration
    with the Routine class, including tests for both valid and invalid
    input values.

Fixes #2240
Replaces PR #2305


PR created automatically by Jules for task 17042493298890483722

This change introduces the `ExternalRuntimeOptions` class to the
`google.cloud.bigquery.routine` module, allowing users to configure
runtime options for external routines.

Key changes:
- Created the `ExternalRuntimeOptions` class with setters and getters for
  `container_memory`, `container_cpu`, `runtime_connection`,
  `max_batching_rows`, and `runtime_version`.
- Updated the `Routine` class to include an `external_runtime_options`
  property that accepts an `ExternalRuntimeOptions` object.
- Added comprehensive unit tests for the new class and its integration
  with the `Routine` class, including tests for both valid and invalid
  input values.
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery API. labels Sep 29, 2025
@chalmerlowe chalmerlowe self-assigned this Sep 29, 2025
@chalmerlowe chalmerlowe marked this pull request as ready for review September 29, 2025 16:13
@chalmerlowe chalmerlowe requested review from a team as code owners September 29, 2025 16:13
chalmerlowe and others added 2 commits September 29, 2025 12:16
This change introduces the `ExternalRuntimeOptions` class to the
`google.cloud.bigquery.routine` module, allowing users to configure
runtime options for external routines.

Key changes:
- Created the `ExternalRuntimeOptions` class with setters and getters for
  `container_memory`, `container_cpu`, `runtime_connection`,
  `max_batching_rows`, and `runtime_version`.
- Updated the `Routine` class to include an `external_runtime_options`
  property that accepts an `ExternalRuntimeOptions` object.
- Added comprehensive unit tests for the new class and its integration
  with the `Routine` class, including tests for both valid and invalid
  input values.
@chalmerlowe
Copy link
Collaborator

Jules:

We lack some coverage via unit tests.
Coverage indicates that we don't have coverage on lines 375-380, 816-818, 908, and 912. Please see what you can do to update the test suite.

Copy link
Contributor Author

Jules:

We lack some coverage via unit tests.
Coverage indicates that we don't have coverage on lines 375-380, 816-818, 908, and 912. Please see what you can do to update the test suite.

I have added new unit tests to cover the missing lines of code. The test suite now passes with 100% coverage for the new functionality.

This change introduces the `ExternalRuntimeOptions` class to the
`google.cloud.bigquery.routine` module, allowing users to configure
runtime options for external routines.

Key changes:
- Created the `ExternalRuntimeOptions` class with setters and getters for
  `container_memory`, `container_cpu`, `runtime_connection`,
  `max_batching_rows`, and `runtime_version`.
- Updated the `Routine` class to include an `external_runtime_options`
  property that accepts an `ExternalRuntimeOptions` object.
- Added comprehensive unit tests for the new class and its integration
  with the `Routine` class, including tests for both valid and invalid
  input values.
- Added additional tests to improve code coverage based on feedback.
@chalmerlowe chalmerlowe added the kokoro:run Add this label to force Kokoro to re-run the tests. label Sep 29, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Sep 29, 2025
@chalmerlowe
Copy link
Collaborator

Jules:

PyType is making guesses about the types of some objects in the routine.py file.

Here are two examples.

/tmpfs/src/github/python-bigquery/google/cloud/bigquery/routine/routine.py:834:1: error: in container_memory: bad option 'int' in return type [bad-return-type]
           Expected: Optional[str]
  Actually returned: Optional[Any]

        return self._properties.get("containerMemory")~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        return self._properties.get("containerMemory")


/tmpfs/src/github/python-bigquery/google/cloud/bigquery/routine/routine.py:856:1: error: in runtime_connection: bad option 'int' in return type [bad-return-type]
           Expected: Optional[str]
  Actually returned: Optional[Any]

        return self._properties.get("runtimeConnection")~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        return self._properties.get("runtimeConnection")

Any suggestions?

Copy link
Contributor Author

Jules:

PyType is making guesses about the types of some objects in the routine.py file.

Here are two examples.

/tmpfs/src/github/python-bigquery/google/cloud/bigquery/routine/routine.py:834:1: error: in container_memory: bad option 'int' in return type [bad-return-type]
           Expected: Optional[str]
  Actually returned: Optional[Any]

        return self._properties.get("containerMemory")~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        return self._properties.get("containerMemory")


/tmpfs/src/github/python-bigquery/google/cloud/bigquery/routine/routine.py:856:1: error: in runtime_connection: bad option 'int' in return type [bad-return-type]
           Expected: Optional[str]
  Actually returned: Optional[Any]

        return self._properties.get("runtimeConnection")~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        return self._properties.get("runtimeConnection")

Any suggestions?

I have applied the suggested changes to address the type-checking errors. The tests all pass, and the code should now be free of any type-related issues.

This change introduces the `ExternalRuntimeOptions` class to the
`google.cloud.bigquery.routine` module, allowing users to configure
runtime options for external routines.

Key changes:
- Created the `ExternalRuntimeOptions` class with setters and getters for
  `container_memory`, `container_cpu`, `runtime_connection`,
  `max_batching_rows`, and `runtime_version`.
- Updated the `Routine` class to include an `external_runtime_options`
  property that accepts an `ExternalRuntimeOptions` object.
- Added comprehensive unit tests for the new class and its integration
  with the `Routine` class, including tests for both valid and invalid
  input values.
- Added additional tests to improve code coverage based on feedback.
- Addressed PyType errors by using helper functions for type conversion.
chalmerlowe and others added 3 commits September 30, 2025 05:56
This change introduces the `ExternalRuntimeOptions` class to the
`google.cloud.bigquery.routine` module, allowing users to configure
runtime options for external routines.

Key changes:
- Created the `ExternalRuntimeOptions` class with setters and getters for
  `container_memory`, `container_cpu`, `runtime_connection`,
  `max_batching_rows`, and `runtime_version`.
- Updated the `Routine` class to include an `external_runtime_options`
  property that accepts an `ExternalRuntimeOptions` object.
- Added comprehensive unit tests for the new class and its integration
  with the `Routine` class, including tests for both valid and invalid
  input values.
- Added additional tests to improve code coverage based on feedback.
- Addressed PyType errors by using helper functions for type conversion.
- Addressed formatting nits from code review.
@chalmerlowe chalmerlowe added the automerge Merge the pull request once unit tests and other checks pass. label Oct 1, 2025
runtime_connection: Optional[str] = None,
max_batching_rows: Optional[int] = None,
runtime_version: Optional[str] = None,
_properties: Optional[Dict] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is necessary?

@Linchin Linchin self-requested a review October 1, 2025 21:33
Copy link
Contributor

@Linchin Linchin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a minor comment

Copy link

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose more remote functions options as first class properties
3 participants