airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Potiuk (Jira)" <>
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
             Project: Apache Airflow
          Issue Type: Improvement
          Components: core
    Affects Versions: 2.0.0
            Reporter: Jarek Potiuk

The Operator Resources classes ([])
have wrong type-hints defined. Their __init__ takes same-named parameters with different types
and it fools Type hinting for IntelliJ.

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

View raw message