damccorm commented on code in PR #32336:
URL: https://github.com/apache/beam/pull/32336#discussion_r1742975245
##########
examples/notebooks/blog/unittests_in_beam.ipynb:
##########
@@ -0,0 +1,321 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 0,
+ "metadata": {
+ "colab": {
+ "provenance": [],
+ "authorship_tag": "ABX9TyPV6AdwSHrolFPeCbPdHkbU",
+ "include_colab_link": true
+ },
+ "kernelspec": {
+ "name": "python3",
+ "display_name": "Python 3"
+ },
+ "language_info": {
+ "name": "python"
+ }
+ },
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "view-in-github",
+ "colab_type": "text"
+ },
+ "source": [
+ "<a
href=\"https://colab.research.google.com/github/apache/beam/blob/colab_testing_example/examples/notebooks/blog/unittests_in_beam.ipynb\"
target=\"_parent\"><img
src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In
Colab\"/></a>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "id": "7DSE6TgWy7PP"
+ },
+ "outputs": [],
+ "source": [
+ "# @title ###### Licensed to the Apache Software Foundation (ASF),
Version 2.0 (the \"License\")\n",
+ "\n",
+ "# Licensed to the Apache Software Foundation (ASF) under one\n",
+ "# or more contributor license agreements. See the NOTICE file\n",
+ "# distributed with this work for additional information\n",
+ "# regarding copyright ownership. The ASF licenses this file\n",
+ "# to you under the Apache License, Version 2.0 (the\n",
+ "# \"License\"); you may not use this file except in compliance\n",
+ "# with the License. You may obtain a copy of the License at\n",
+ "#\n",
+ "# http://www.apache.org/licenses/LICENSE-2.0\n",
+ "#\n",
+ "# Unless required by applicable law or agreed to in writing,\n",
+ "# software distributed under the License is distributed on an\n",
+ "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n",
+ "# KIND, either express or implied. See the License for the\n",
+ "# specific language governing permissions and limitations\n",
+ "# under the License"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# Install the Apache Beam library\n",
+ "!pip install apache_beam[gcp] --quiet"
+ ],
+ "metadata": {
+ "id": "5W2nuV7uzlPg"
+ },
+ "execution_count": 4,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "**Example 1**"
+ ],
+ "metadata": {
+ "id": "Z8__izORM3r8"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "#The following packages are used to run the example pipelines\n",
+ "\n",
+ "import apache_beam as beam\n",
+ "from apache_beam.io import ReadFromText, WriteToText\n",
+ "from apache_beam.options.pipeline_options import PipelineOptions\n",
+ "\n",
+ "class MyDoFn(beam.DoFn):\n",
+ " def process(self,element):\n",
+ " ...\n",
Review Comment:
> I'm erring on the side of -1, just because I'm going to reference this
snippet in the blog post
Is there a reason you couldn't add this version in the notebook?
> am not convinced this would add value in the notebook, especially given it
doesn't call a real API.
It would allow you to run the test. In general, it is not a good idea to add
unrunnable cells in a notebook.
> Maybe the best course of action is to remove it from the colab altogether,
and only reference it in the blogpost?
Generally I don't think this is a huge change and is probably worth doing
(vs removing it). I'm also not going to block/spin on it though if you'd prefer
to remove it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]