Skip to content

Commit

Permalink
Add __repr__ for Executors (#13753)
Browse files Browse the repository at this point in the history
Before:

```python
>>> from airflow.executors.local_executor import LocalExecutor
>>> LocalExecutor()
<airflow.executors.local_executor.LocalExecutor object at 0x7f49b47f8d68>
```

After:

```python
>>> from airflow.executors.local_executor import LocalExecutor
>>> LocalExecutor()
LocalExecutor(parallelism=32)
```
  • Loading branch information
kaxil committed Jan 18, 2021
1 parent 31d31ad commit 6410f07
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions airflow/executors/base_executor.py
Expand Up @@ -64,6 +64,9 @@ def __init__(self, parallelism: int = PARALLELISM):
self.running: Set[TaskInstanceKey] = set()
self.event_buffer: Dict[TaskInstanceKey, EventBufferValueType] = {}

def __repr__(self):
return f"{self.__class__.__name__}(parallelism={self.parallelism})"

def start(self): # pragma: no cover
"""Executors may need to get things started."""

Expand Down

0 comments on commit 6410f07

Please sign in to comment.