You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "eumiro (via GitHub)" <gi...@apache.org> on 2023/08/25 20:28:56 UTC
[GitHub] [airflow] eumiro opened a new pull request, #33745: Refactor: Use fewer lambdas
eumiro opened a new pull request, #33745:
URL: https://github.com/apache/airflow/pull/33745
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on a diff in pull request #33745: Refactor: Replace lambdas with comprehensions
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #33745:
URL: https://github.com/apache/airflow/pull/33745#discussion_r1308405461
##########
dev/breeze/src/airflow_breeze/utils/parallel.py:
##########
@@ -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]
Review Comment:
```suggestion
return [result for result in results if result.ready()]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk merged pull request #33745: Refactor: Replace lambdas with comprehensions
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #33745:
URL: https://github.com/apache/airflow/pull/33745
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #33745: Refactor: Replace lambdas with comprehensions
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #33745:
URL: https://github.com/apache/airflow/pull/33745#issuecomment-1699487123
You need to make it ready for review @eumiro
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on a diff in pull request #33745: Refactor: Replace lambdas with comprehensions
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #33745:
URL: https://github.com/apache/airflow/pull/33745#discussion_r1306788343
##########
airflow/jobs/backfill_job_runner.py:
##########
@@ -742,7 +742,7 @@ def tabulate_ti_keys_set(ti_keys: Iterable[TaskInstanceKey]) -> str:
if all(key.map_index == -1 for key in ti_keys):
headers = ["DAG ID", "Task ID", "Run ID", "Try number"]
- sorted_ti_keys = (k[0:4] for k in sorted_ti_keys)
+ sorted_ti_keys = [k[0:4] for k in sorted_ti_keys]
Review Comment:
This does not seem to fit in this PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] eumiro commented on a diff in pull request #33745: Refactor: Replace lambdas with comprehensions
Posted by "eumiro (via GitHub)" <gi...@apache.org>.
eumiro commented on code in PR #33745:
URL: https://github.com/apache/airflow/pull/33745#discussion_r1307768314
##########
airflow/jobs/backfill_job_runner.py:
##########
@@ -742,7 +742,7 @@ def tabulate_ti_keys_set(ti_keys: Iterable[TaskInstanceKey]) -> str:
if all(key.map_index == -1 for key in ti_keys):
headers = ["DAG ID", "Task ID", "Run ID", "Try number"]
- sorted_ti_keys = (k[0:4] for k in sorted_ti_keys)
+ sorted_ti_keys = [k[0:4] for k in sorted_ti_keys]
Review Comment:
Oh yes, thanks, removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on a diff in pull request #33745: Refactor: Replace lambdas with comprehensions
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #33745:
URL: https://github.com/apache/airflow/pull/33745#discussion_r1308407138
##########
dev/example_dags/update_example_dags_paths.py:
##########
@@ -102,19 +102,18 @@ def find_matches(_file: Path, provider: str, version: str):
if __name__ == "__main__":
curdir: Path = Path(os.curdir).resolve()
- dirs: list[Path] = list(filter(os.path.isdir, curdir.iterdir()))
+ dirs: list[Path] = [p for p in curdir.iterdir() if p.is_dir()]
with Progress(console=console) as progress:
task = progress.add_task(f"Updating {len(dirs)}", total=len(dirs))
for directory in dirs:
if directory.name.startswith("apache-airflow-providers-"):
provider = directory.name[len("apache-airflow-providers-") :]
console.print(f"[bright_blue] Processing {directory}")
- version_dirs = list(filter(os.path.isdir, directory.iterdir()))
+ version_dirs = [p for p in directory.iterdir() if p.is_dir()]
for version_dir in version_dirs:
Review Comment:
```python
for version_dir in directory.iterdir():
if not version_dir.is_dir():
continue
...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org