Skip to content

Port CI/CD example #5

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

Merged
merged 2 commits into from
Sep 12, 2024
Merged

Port CI/CD example #5

merged 2 commits into from
Sep 12, 2024

Conversation

dawidwys
Copy link
Member

No description provided.

@dawidwys dawidwys requested a review from a team as a code owner September 12, 2024 13:49
for row in results:
count = row[0]
if (count >= 200):
print("200 elements reached. Stopping...")
Copy link
Member

Choose a reason for hiding this comment

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

you have to stop the count_result manually because this is not a try with resource.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is a try with resources, I believe. The:

with count_result.collect() as results:

plays the role

Copy link
Member Author

Choose a reason for hiding this comment

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

btw, I tested and I see the statement stopped

print("200 elements reached. Stopping...")
break

# By using a closable iterator, the foreground statement will be stopped
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# By using a closable iterator, the foreground statement will be stopped
# By using a closable iterator, the foreground statement will be stopped

Does this apply to Python?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

@dawidwys dawidwys enabled auto-merge (squash) September 12, 2024 14:58
@dawidwys dawidwys merged commit dabe725 into master Sep 12, 2024
@dawidwys dawidwys deleted the sql2381-python branch September 12, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants