Commit b37ce29 1 parent 58aefb2 commit b37ce29 Copy full SHA for b37ce29
File tree 3 files changed +14
-2
lines changed
3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,16 @@ https://developers.google.com/style/inclusive-documentation
62
62
63
63
-->
64
64
65
+ ### Ability to patch Pool.DEFAULT_POOL_NAME in BaseOperator
66
+ It was not possible to patch pool in BaseOperator as the signature sets the default value of pool
67
+ as Pool.DEFAULT_POOL_NAME.
68
+ While using subdagoperator in unittest(without initializing the sqlite db), it was throwing the
69
+ following error:
70
+ ```
71
+ sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: slot_pool.
72
+ ```
73
+ Fix for this, https://github.com/apache/airflow/pull/8587
74
+
65
75
### Change signature of BigQueryGetDatasetTablesOperator
66
76
Was:
67
77
``` python
Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ def __init__(
316
316
priority_weight : int = 1 ,
317
317
weight_rule : str = WeightRule .DOWNSTREAM ,
318
318
queue : str = conf .get ('celery' , 'default_queue' ),
319
- pool : str = Pool . DEFAULT_POOL_NAME ,
319
+ pool : Optional [ str ] = None ,
320
320
pool_slots : int = 1 ,
321
321
sla : Optional [timedelta ] = None ,
322
322
execution_timeout : Optional [timedelta ] = None ,
@@ -385,7 +385,7 @@ def __init__(
385
385
386
386
self .retries = retries
387
387
self .queue = queue
388
- self .pool = pool
388
+ self .pool = Pool . DEFAULT_POOL_NAME if pool is None else pool
389
389
self .pool_slots = pool_slots
390
390
if self .pool_slots < 1 :
391
391
raise AirflowException ("pool slots for %s in dag %s cannot be less than 1"
Original file line number Diff line number Diff line change 70
70
"bash_command" : "echo {{ task.task_id }}" ,
71
71
"_task_type" : "BashOperator" ,
72
72
"_task_module" : "airflow.operators.bash" ,
73
+ "pool" : "default_pool" ,
73
74
},
74
75
{
75
76
"task_id" : "custom_task" ,
84
85
"template_fields" : ['bash_command' ],
85
86
"_task_type" : "CustomOperator" ,
86
87
"_task_module" : "tests.test_utils.mock_operators" ,
88
+ "pool" : "default_pool" ,
87
89
},
88
90
],
89
91
"timezone" : "UTC" ,
You can’t perform that action at this time.
0 commit comments