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 2020/01/19 22:41:00 UTC
[jira] [Assigned] (AIRFLOW-6406) Operator Resources have wronge
type hint derived
[ https://issues.apache.org/jira/browse/AIRFLOW-6406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jarek Potiuk reassigned AIRFLOW-6406:
-------------------------------------
Assignee: Jarek Potiuk
> Operator Resources have wronge 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
> Assignee: Jarek Potiuk
> Priority: Major
>
> 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)