You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2025/05/08 19:28:44 UTC

(beam) branch users/damccorm/emptyOutputs created (now f4c9e57018c)

This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a change to branch users/damccorm/emptyOutputs
in repository https://gitbox.apache.org/repos/asf/beam.git


      at f4c9e57018c Add empty outputs to notebooks which can't run without help

This branch includes the following new commits:

     new f4c9e57018c Add empty outputs to notebooks which can't run without help

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(beam) 01/01: Add empty outputs to notebooks which can't run without help

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch users/damccorm/emptyOutputs
in repository https://gitbox.apache.org/repos/asf/beam.git

commit f4c9e57018c9d1232277d2ec47e1398913635909
Author: Danny McCormick <da...@google.com>
AuthorDate: Thu May 8 15:28:37 2025 -0400

    Add empty outputs to notebooks which can't run without help
---
 .../beam-ml/bigquery_enrichment_transform.ipynb    | 42 +++++++++++-----------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/examples/notebooks/beam-ml/bigquery_enrichment_transform.ipynb b/examples/notebooks/beam-ml/bigquery_enrichment_transform.ipynb
index dedaa6b65a5..62114b51cb1 100644
--- a/examples/notebooks/beam-ml/bigquery_enrichment_transform.ipynb
+++ b/examples/notebooks/beam-ml/bigquery_enrichment_transform.ipynb
@@ -7,7 +7,7 @@
         "cellView": "form",
         "id": "55h6JBJeJGqg"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "# @title ###### Licensed to the Apache Software Foundation (ASF), Version 2.0 (the \"License\")\n",
         "\n",
@@ -75,7 +75,7 @@
       "metadata": {
         "id": "oVbWf73FJSzf"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "!pip install torch\n",
         "!pip install apache_beam[interactive,gcp]==2.57.0 --quiet"
@@ -100,7 +100,7 @@
       "metadata": {
         "id": "p6bruDqFJkXE"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "import datetime\n",
         "import json\n",
@@ -146,7 +146,7 @@
       "metadata": {
         "id": "RwoBZjD1JwnD"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "PROJECT_ID = \"<PROJECT_ID>\" # @param {type:'string'}\n"
       ]
@@ -157,7 +157,7 @@
       "metadata": {
         "id": "rVAyQxoeKflB"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "from google.colab import auth\n",
         "auth.authenticate_user(project_id=PROJECT_ID)"
@@ -183,7 +183,7 @@
       "metadata": {
         "id": "UxeGFqSJu-G6"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "DATASET_ID = \"<DATASET_ID>\" # @param {type:'string'}\n",
         "\n",
@@ -206,7 +206,7 @@
       "metadata": {
         "id": "-QRZC4v0KipK"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "client = bigquery.Client(project=PROJECT_ID)\n",
         "\n",
@@ -292,7 +292,7 @@
       "metadata": {
         "id": "YoMjdqJ1KxOM"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "# Create fake training data\n",
         "data = {\n",
@@ -329,7 +329,7 @@
       "metadata": {
         "id": "P-8lKzdzLnGo"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "features = ['age', 'plan', 'contract_length', 'avg_monthly_calls', 'avg_monthly_data_usage_gb']\n",
         "target = 'churned'\n",
@@ -353,7 +353,7 @@
       "metadata": {
         "id": "YvdPNlzoMTtl"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "def build_model(n_inputs, n_outputs):\n",
         "  \"\"\"build_model builds and returns a model that takes\n",
@@ -382,7 +382,7 @@
       "metadata": {
         "id": "0XqctMiPMaim"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "model = build_model(n_inputs=5, n_outputs=1)\n",
         "\n",
@@ -414,7 +414,7 @@
       "metadata": {
         "id": "Q9WIjw53MgcR"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "STATE_DICT_PATH = './model.pth'\n",
         "torch.save(model.state_dict(), STATE_DICT_PATH)"
@@ -436,7 +436,7 @@
       "metadata": {
         "id": "0uwZz_ijyzL8"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "# Replace <TOPIC_NAME> with the name of your Pub/Sub topic.\n",
         "TOPIC = \"<TOPIC_NAME>\" # @param {type:'string'}\n",
@@ -451,7 +451,7 @@
       "metadata": {
         "id": "hIgsCWIozdDu"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "from google.api_core.exceptions import AlreadyExists\n",
         "\n",
@@ -490,7 +490,7 @@
       "metadata": {
         "id": "fOq1uNXvMku-"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "messages = [\n",
         "    {'customer_id': i}\n",
@@ -562,7 +562,7 @@
       "metadata": {
         "id": "C8XLmBDeMyrB"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "user_data_handler = BigQueryEnrichmentHandler(\n",
         "    project=PROJECT_ID,\n",
@@ -633,7 +633,7 @@
       "metadata": {
         "id": "XgPontIVP0Cv"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "def convert_row_to_tensor(customer_data):\n",
         "    import pandas as pd\n",
@@ -663,7 +663,7 @@
       "metadata": {
         "id": "NMj0V5VyQukk"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "class PostProcessor(beam.DoFn):\n",
         "  def process(self, element, *args, **kwargs):\n",
@@ -687,7 +687,7 @@
       "metadata": {
         "id": "rgJeV-jWQ4wo"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "options = pipeline_options.PipelineOptions()\n",
         "options.view_as(pipeline_options.StandardOptions).streaming = True # Streaming mode is set True"
@@ -708,7 +708,7 @@
       "metadata": {
         "id": "Bb-e3yjtQ2iU"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "class DecodeBytes(beam.DoFn):\n",
         "  \"\"\"\n",
@@ -738,7 +738,7 @@
       "metadata": {
         "id": "y6HBH8yoRFp2"
       },
-      "outputs": [],
+      "outputs": [{"output_type": "stream", "name": "stdout", "text": ["\n"]}],
       "source": [
         "with beam.Pipeline(options=options) as p:\n",
         "  _ = (p\n",