airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Potiuk (Jira)" <j...@apache.org>
Subject [jira] [Created] (AIRFLOW-6406) Operator Resources miss the type hint derived
Date Mon, 30 Dec 2019 15:11:00 GMT
Jarek Potiuk created AIRFLOW-6406:
-------------------------------------

             Summary: Operator Resources miss the type hint derived
                 Key: AIRFLOW-6406
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-6406
             Project: Apache Airflow
          Issue Type: Improvement
          Components: core
    Affects Versions: 2.0.0
            Reporter: Jarek Potiuk


The Operator Resources classes ([https://github.com/apache/airflow/blob/master/airflow/utils/operator_resources.py])
have wrong type-hints defined. Their __init__ takes same-named parameters with different types
and it fools Type hinting for IntelliJ.

 
{code:java}
def __init__(self,
     cpus=conf.getint('operators', 'default_cpus'),
     ram=conf.getint('operators', 'default_ram'),
     disk=conf.getint('operators', 'default_disk'),
     gpus=conf.getint('operators', 'default_gpus')
    ):
    self.cpus = CpuResource(cpus)
    self.ram = RamResource(ram)
    self.disk = DiskResource(disk)
    self.gpus = GpuResource(gpus){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message