Skip to content

fix(retail): add region tag for Python - Update purge user events #13496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
4 changes: 4 additions & 0 deletions retail/interactive-tutorials/events/purge_user_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

# Deleting user event using Retail API.
#
# [START retail_purge_user_events]

import google.auth
from google.cloud.retail import PurgeUserEventsRequest, UserEventServiceClient

Expand Down Expand Up @@ -48,6 +50,8 @@ def call_purge_user_events():
print("---the purge operation was started:----")
print(purge_operation.operation.name)

# [END retail_purge_user_events]
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The placement of this END tag makes the code snippet for documentation incomplete. The function calls write_user_event(visitor_id) and call_purge_user_events() are excluded from the region tag. Move this END tag to after the call_purge_user_events() call on line 57 to include the execution logic within the region tag.



write_user_event(visitor_id)
call_purge_user_events()