CONNECT WITH US
eCommerce

eCommerce

Google adds Cloud Logging for BigQuery Python UDFs

Ecommerce News India logo

Published on

Add as a preferred source on Google
Google adds Cloud Logging for BigQuery Python UDFs

Google has added a logging feature for Python User-Defined Functions in BigQuery, sending structured logs from Python UDFs to Cloud Logging.

Developers can use Python's standard logging library inside BigQuery UDFs without external plugins or custom connectors. Google framed the addition around operational monitoring and debugging, including data pipeline checks that can continue running when individual records fail validation.

It illustrated the feature with an eCommerce event ingestion workflow in which a Python UDF parses incoming JSON payloads and checks for required fields. Valid records move to a destination table, while malformed or incomplete rows are logged and return null values so the wider query does not fail.

In the example, a function called safe_parse_json uses Python code within BigQuery to inspect each payload. If the payload is empty, syntactically invalid or missing a required key, the function writes a structured error entry through the logging library and returns no result for that row.

This allows a query to complete while excluding problematic records from the clean output table. In Google's sample dataset, valid events were written for records containing user identifiers and event names, while corrupted JSON and a payload missing the user_id field were sent to logging output.

Google described the workflow in three stages. First, the UDF performs inline validation. Second, Cloud Monitoring provides real-time alerting through a log-based metric that notifies teams when error levels pass a set threshold. Third, engineers use SQL-based triage and replay by querying logged records through BigQuery Log Analytics and reprocessing data after fixing the underlying issue.


Source link

Disclaimer

We strive to uphold the highest ethical standards in all of our reporting and coverage. We TheMorningPulse.fyi want to be transparent with our readers about any potential conflicts of interest that may arise in our work. It's possible that some of the investors we feature may have connections to other businesses, including competitors or companies we write about. However, we want to assure our readers that this will not have any impact on the integrity or impartiality of our reporting. We are committed to delivering accurate, unbiased news and information to our audience, and we will continue to uphold our ethics and principles in all of our work. Thank you for your trust and support.