You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Jarek Potiuk (Jira)" <ji...@apache.org> on 2019/12/30 15:11:00 UTC

[jira] [Created] (AIRFLOW-6406) Operator Resources miss the type hint derived

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)