You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Jakob Homan (Jira)" <ji...@apache.org> on 2019/09/13 23:20:00 UTC

[jira] [Created] (AIRFLOW-5496) hive_stats_operator: Unneeded variable assignment

Jakob Homan created AIRFLOW-5496:
------------------------------------

             Summary: hive_stats_operator: Unneeded variable assignment
                 Key: AIRFLOW-5496
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5496
             Project: Apache Airflow
          Issue Type: Bug
          Components: operators
    Affects Versions: 1.10.6
            Reporter: Jakob Homan


Note: This ticket's being created to facilitate a new contributor's workshop for Airflow. After the workshop has completed, I'll mark these all available for anyone that might like to take them on.

The variable {{d}} is assigned to an empty dictionary and the immediately reassigned in the if/else block.  We should remove the unneeded first assignment.

airflow/operators/hive_stats_operator.py:116
{code:java}
for col, col_type in list(field_types.items()):
    d = {}
    if self.assignment_func:
        d = self.assignment_func(col, col_type)
        if d is None:
            d = self.get_default_exprs(col, col_type)
    else:
        d = self.get_default_exprs(col, col_type)
    exprs.update(d) {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)