Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions website/www/site/content/en/documentation/programming-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4229,6 +4229,15 @@ output_pc = input_pc | beam.Select(post_code=lambda item: str(item["shipping_add
Support for wildcards hasn't been developed for the Python SDK yet.
{{< /paragraph >}}

<< paragraph class="language-py" >>
Example of selecting all nested fields using wildcard:
<< /paragraph >>

<< highlight py >>
input_pc = ...
output_pc = input_pc | beam.Select("shippingAddress.*")
<< /highlight >>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The snippet immediately above this says that "Support for wildcards hasn't been developed for the Python SDK yet." - have you tried this snippet out?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks for pointing this out.

You're right — since Python SDK doesn't support wildcards yet, this example may be incorrect. I’ll verify it locally and update or remove the snippet accordingly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lets just close this PR since adding this example was the point of the PR.

Please manually verify changes before pushing them (don't just feed them into an AI tool)


{{< paragraph class="language-go">}}
Support for wildcards hasn't been developed for the Go SDK yet.
{{< /paragraph >}}
Expand All @@ -4242,12 +4251,6 @@ shipping-address fields one would write
purchases.apply(Select.fieldNames("shippingAddress.*"));
{{< /highlight >}}

<!--
{{< highlight py >}}
#TODO(https://github.com/apache/beam/issues/23275): Add support for projecting nested fields
input_pc = ... # {"user_id": ..., "shipping_address": "post_code": ..., "bank": ..., "purchase_amount": ...}
output_pc = input_pc | beam.Select("shipping_address.*"))
{{< /highlight >}} -->
##### **Arrays**

{{< paragraph class="language-java">}}
Expand All @@ -4259,6 +4262,15 @@ selected, the result is an array of the selected subfield type. For example
Support for Array fields hasn't been developed for the Python SDK yet.
{{< /paragraph >}}

{{< paragraph class="language-py" >}}
example of selecting a nested field inside an array:
{{< /paragraph >}}

<< highlight py >>
input_pc = ...
output_pc = input_pc | beam.Select("transactions[].bank")
<< /highlight py >>

{{< paragraph class="language-go">}}
Support for Array fields hasn't been developed for the Go SDK yet.
{{< /paragraph >}}
Expand Down
Loading