From 1d65705793c37140049b73d6d6c37f815e0a95a6 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Tue, 8 Aug 2023 14:27:27 -0700 Subject: [PATCH 1/4] Create py.typed for use with mypy Create type stubs file to allow `mypy` and other type checkers to run on user's pipelines. --- sdks/python/apache_beam/py.typed | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sdks/python/apache_beam/py.typed diff --git a/sdks/python/apache_beam/py.typed b/sdks/python/apache_beam/py.typed new file mode 100644 index 000000000000..0617f6a9a0d6 --- /dev/null +++ b/sdks/python/apache_beam/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The apache-beam package uses inline types. From 942187f13637a3545c7bd760110e9973f6cf29d0 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Wed, 9 Aug 2023 15:23:14 -0700 Subject: [PATCH 2/4] Added py.typed --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index c13f6f70f5cb..c46e86643372 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -76,6 +76,7 @@ * Vertex AI Model Handler for RunInference now supports private endpoints ([#27696](https://github.com/apache/beam/pull/27696)) * MLTransform transform added with support for common ML pre/postprocessing operations ([#26795](https://github.com/apache/beam/pull/26795)) * Upgraded the Kryo extension for the Java SDK to Kryo 5.5.0. This brings in bug fixes, performance improvements, and serialization of Java 14 records. ([#27635](https://github.com/apache/beam/issues/27635)) +* Add `py.typed` to support running `mypy` on user pipelines ([#27906](https://github.com/apache/beam/issues/27906)) ## Breaking Changes From f9abc21e4a87d4874b2d71c29f5e8e70921e6754 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Thu, 10 Aug 2023 14:27:21 -0700 Subject: [PATCH 3/4] Update sdks/python/apache_beam/py.typed Co-authored-by: Jack McCluskey <34928439+jrmccluskey@users.noreply.github.com> --- sdks/python/apache_beam/py.typed | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sdks/python/apache_beam/py.typed b/sdks/python/apache_beam/py.typed index 0617f6a9a0d6..1aea47b9e7dd 100644 --- a/sdks/python/apache_beam/py.typed +++ b/sdks/python/apache_beam/py.typed @@ -1,2 +1,19 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + # Marker file for PEP 561. # The apache-beam package uses inline types. From 32b3dbe7719e3e5112183f658e712760414782b9 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Tue, 19 Sep 2023 16:02:50 -0700 Subject: [PATCH 4/4] Update CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index e2dea3c32667..bbe9d539531b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -68,6 +68,7 @@ * In Python, [RunInference](https://beam.apache.org/documentation/sdks/python-machine-learning/#why-use-the-runinference-api) now supports loading many models in the same transform using a [KeyedModelHandler](https://beam.apache.org/documentation/sdks/python-machine-learning/#use-a-keyed-modelhandler) ([#27628](https://github.com/apache/beam/issues/27628)). * In Python, the [VertexAIModelHandlerJSON](https://beam.apache.org/releases/pydoc/current/apache_beam.ml.inference.vertex_ai_inference.html#apache_beam.ml.inference.vertex_ai_inference.VertexAIModelHandlerJSON) now supports passing in inference_args. These will be passed through to the Vertex endpoint as parameters. +* Added support to run `mypy` on user pipelines ([#27906](https://github.com/apache/beam/issues/27906)) ## Breaking Changes @@ -127,7 +128,6 @@ * Transform service controller container. * Spark3 job server container. * Added support for batched writes to AWS SQS for improved throughput (Java, AWS 2).([#21429](https://github.com/apache/beam/issues/21429)) -* Added support to run `mypy` on user pipelines ([#27906](https://github.com/apache/beam/issues/27906)) ## Breaking Changes