Skip to content
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

Refactor: Replace lambdas with comprehensions #33745

Merged
merged 1 commit into from
Aug 30, 2023
Merged

Conversation

eumiro
Copy link
Contributor

@eumiro eumiro commented Aug 25, 2023

No description provided.

@boring-cyborg boring-cyborg bot added area:dev-tools area:logging area:providers area:Scheduler including HA (high availability) scheduler area:system-tests area:webserver Webserver related Issues provider:amazon AWS/Amazon - related issues provider:cncf-kubernetes Kubernetes provider related issues provider:elasticsearch provider:google Google (including GCP) related issues provider:microsoft-azure Azure-related issues provider:openlineage AIP-53 provider:oracle provider:slack labels Aug 25, 2023
@eumiro eumiro changed the title Refactor: Use fewer lambdas Refactor: Replace lambdas with comprehensions Aug 26, 2023
sorted_ti_keys = (k[0:4] for k in sorted_ti_keys)
sorted_ti_keys = [k[0:4] for k in sorted_ti_keys]
Copy link
Member

Choose a reason for hiding this comment

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

This does not seem to fit in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes, thanks, removed.

@@ -357,7 +357,7 @@ def print_async_summary(completed_list: list[ApplyResult]) -> None:

def get_completed_result_list(results: list[ApplyResult]) -> list[ApplyResult]:
"""Return completed results from the list."""
return list(filter(lambda result: result.ready(), results))
return [result for result in results if result.ready]
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
return [result for result in results if result.ready]
return [result for result in results if result.ready()]

@potiuk
Copy link
Member

potiuk commented Aug 30, 2023

You need to make it ready for review @eumiro

@eumiro eumiro marked this pull request as ready for review August 30, 2023 18:57
@potiuk potiuk merged commit 9a0f54d into apache:main Aug 30, 2023
@eumiro eumiro deleted the less-lambda branch September 3, 2023 17:05
@ephraimbuddy ephraimbuddy added this to the Airflow 2.7.2 milestone Oct 3, 2023
@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Oct 3, 2023
ephraimbuddy pushed a commit that referenced this pull request Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools area:logging area:providers area:Scheduler including HA (high availability) scheduler area:system-tests area:webserver Webserver related Issues provider:amazon AWS/Amazon - related issues provider:cncf-kubernetes Kubernetes provider related issues provider:elasticsearch provider:google Google (including GCP) related issues provider:microsoft-azure Azure-related issues provider:openlineage AIP-53 provider:oracle provider:slack type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants