Git Product home page Git Product logo

pylint-airflow's Introduction

Pylint-Airflow

Code style: Black

License: MIT

image

image

Pylint plugin for static code analysis on Airflow code.

Usage

Installation:

pip install pylint-airflow

Usage:

pylint --load-plugins=pylint_airflow [your_file]

This plugin runs on Python 3.6 and higher.

Error codes

The Pylint-Airflow codes follow the structure {I,C,R,W,E,F}83{0-9}{0-9}, where:

The current codes are:

Code Symbol Description
C8300 different-operator-varname-taskid For consistency assign the same variable name and task_id to operators.
C8301 match-callable-taskid For consistency name the callable function '_[task_id]', e.g. PythonOperator(task_id='mytask', python_callable=_mytask).
C8302 mixed-dependency-directions For consistency don't mix directions in a single statement, instead split over multiple statements.
C8303 task-no-dependencies Sometimes a task without any dependency is desired, however often it is the result of a forgotten dependency.
C8304 task-context-argname Indicate you expect Airflow task context variables in the **kwargs argument by renaming to **context.
C8305 task-context-separate-arg To avoid unpacking kwargs from the Airflow task context in a function, you can set the needed variables as arguments in the function.
C8306 match-dagid-filename For consistency match the DAG filename with the dag_id.
R8300 unused-xcom Return values from a python_callable function or execute() method are automatically pushed as XCom.
W8300 basehook-top-level Airflow executes DAG scripts periodically and anything at the top level of a script is executed. Therefore, move BaseHook calls into functions/hooks/operators.
E8300 duplicate-dag-name DAG name should be unique.
E8301 duplicate-task-name Task name within a DAG should be unique.
E8302 duplicate-dependency Task dependencies can be defined only once.
E8303 dag-with-cycles A DAG is acyclic and cannot contain cycles.
E8304 task-no-dag A task must know a DAG instance to run.

Documentation

Documentation is available on Read the Docs.

Contributing

Suggestions for more checks are always welcome, please create an issue on GitHub. Read CONTRIBUTING.rst for more details.

pylint-airflow's People

Contributors

basph avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.