Skip to content

Commit

Permalink
[EWT-499] Airflow Upgrade to 1.10.12 [CP] from 1.10.4+twtr : 9b58c88
Browse files Browse the repository at this point in the history
*Cherry-Pick contains [CP][EWT-302]Patch Pool.DEFAULT_POOL_NAME in BaseOperator (apache#8587) (twitter-forks#49)

Open source commit id: b37ce29

Co-authored-by: Vishesh Jain <visheshj@twitter.com>
  • Loading branch information
2 people authored and Ayush Sethi committed Nov 8, 2020
1 parent d6fb07c commit 5a612d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,18 @@ The following metrics are deprecated and won't be emitted in Airflow 2.0:

No breaking changes.

## CP

### Ability to patch Pool.DEFAULT_POOL_NAME in BaseOperator
It was not possible to patch pool in BaseOperator as the signature sets the default value of pool
as Pool.DEFAULT_POOL_NAME.
While using subdagoperator in unittest(without initializing the sqlite db), it was throwing the
following error:
```
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: slot_pool.
```
Fix for this, https://github.com/apache/airflow/pull/8587

## Airflow 1.10.4

### Export MySQL timestamps as UTC
Expand Down
4 changes: 2 additions & 2 deletions airflow/models/baseoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def __init__(
priority_weight=1, # type: int
weight_rule=WeightRule.DOWNSTREAM, # type: str
queue=conf.get('celery', 'default_queue'), # type: str
pool=Pool.DEFAULT_POOL_NAME, # type: str
pool=None, # type: str
pool_slots=1, # type: int
sla=None, # type: Optional[timedelta]
execution_timeout=None, # type: Optional[timedelta]
Expand Down Expand Up @@ -379,7 +379,7 @@ def __init__(
self._schedule_interval = schedule_interval
self.retries = retries
self.queue = queue
self.pool = pool
self.pool = Pool.DEFAULT_POOL_NAME if pool is None else pool
self.pool_slots = pool_slots
if self.pool_slots < 1:
raise AirflowException("pool slots for %s in dag %s cannot be less than 1"
Expand Down

0 comments on commit 5a612d6

Please sign in to comment.