Skip to content

Conversation

@tswast
Copy link
Collaborator

@tswast tswast commented Jan 13, 2026

This change introduces support for BigQuery ObjectRef functions:

  • OBJ.FETCH_METADATA
  • OBJ.GET_ACCESS_URL
  • OBJ.MAKE_REF

These are exposed via a new bigframes.bigquery.obj module.

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! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Replaces #2340
🦕

This change introduces support for BigQuery ObjectRef functions:
- `OBJ.FETCH_METADATA`
- `OBJ.GET_ACCESS_URL`
- `OBJ.MAKE_REF`

These are exposed via a new `bigframes.bigquery.obj` module.
@tswast tswast requested review from a team as code owners January 13, 2026 22:01
@tswast tswast requested a review from jialuoo January 13, 2026 22:01
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Jan 13, 2026
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. label Jan 13, 2026
Copy link
Contributor

@jialuoo jialuoo left a comment

Choose a reason for hiding this comment

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

Are these test failures related to this PR? I’ve also added Trevor as a reviewer since he probably have more context on the background of these changes than I do.


"""
ObjectRef functions defined from
https://cloud.google.com/bigquery/docs/reference/standard-sql/object-ref-functions
Copy link
Contributor

Choose a reason for hiding this comment

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

the link doesn't work

Copy link
Contributor

Choose a reason for hiding this comment

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

# limitations under the License.

"""This module exposes `BigQuery ObjectRef
<https://cloud.google.com/bigquery/docs/object-table-object-ref-functions>`_ functions.
Copy link
Contributor

Choose a reason for hiding this comment

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

link doesn't work.

SELECT
*,
OBJ.GET_ACCESS_URL(`bfcol_4`) AS `bfcol_7`
OBJ.GET_ACCESS_URL(`bfcol_4`, 'R') AS `bfcol_7`
Copy link
Contributor

Choose a reason for hiding this comment

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

We may still need minimum system tests. Otherwise we may fail to catch errors like this. WDYT?


@log_adapter.method_logger(custom_base_name="bigquery_obj")
def make_ref(
uri_or_json: series.Series,
Copy link
Contributor

Choose a reason for hiding this comment

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

It can also be a single value in SQL. E.g. OBJ.MAKE_REF("gs://something", "us.my_connection"). It can be useful in local experiments. Do we want to support the case?

def fetch_metadata(
objectref: series.Series,
) -> series.Series:
"""The OBJ.FETCH_METADATA function returns Cloud Storage metadata for a partially populated ObjectRef value.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should add the preview disclaimer.

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-dataframes API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants