GithubHelp home page GithubHelp logo

isabella232 / airflow-looker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gocardless/airflow-looker

0.0 0.0 0.0 19 KB

A collection of Airflow extensions to provide integration with Looker

Home Page: https://pypi.org/project/airflow-looker/

License: MIT License

Python 100.00%

airflow-looker's Introduction

airflow-looker

This is a collection of Airflow extensions to provide integration with Looker.

with DAG(dag_id='looker_update_datagroup', schedule_interval='@daily') as dag:
  LookerUpdateDataGroupByIDOperator(
    datagroup_id=123
  )

Installation

Install from PyPI:

pip install airflow-looker

Usage

There is one operator currently implemented:

  • LookerUpdateDataGroupByIDOperator
    • Calls the update_datagroup API. Accepts the following arguments:
      • datagroup_id
        • The ID of the datagroup to update. Required.
      • stale_before
        • Timestamp before which cache entries are considered stale. Defaults to now.

You can also use the hook directly. The two methods that are implemented for use are:

  • call
    • Call the Looker API. Accepts the following arguments:
      • method
        • The method of the call (GET, POST, etc). Required.
      • endpoint
        • The endpoint to be called i.e. looks/run/1. Required.
      • data
        • Payload to be uploaded or request parameters. Required.
      • headers
        • Additional headers to be passed through as a dictionary. Optional.
  • get_look_sql
    • Gets an SQL query from a Looker look resource and returns the SQL as a string. Accepts the following arguments:
      • look_id
        • Unique identifier for a look resource. Required.

Connection

To use either the operator or the hook you need to pass in a connection ID. This connection needs to have the the host, the login (client_id) and the password (client_secret) defined.

To create a connection, follow the Airflow documentation.

Building Locally

To install from the repository, it's recommended to first create a virtual environment:

python3 -m venv .venv

source .venv/bin/activate

Install using pip:

pip install .

Testing

To run tests locally, first create a virtual environment (see Building Locally section)

Install dependencies:

pip install -e .[dev]

Run the tests:

python -m pytest tests/ -sv

Code style

This project uses flake8.

To check your code, first create a virtual environment (see Building Locally section):

python -m flake8 airflow_looker/ tests/ setup.py

License & Contributing

GoCardless โ™ฅ open source. If you do too, come join us.

airflow-looker's People

Contributors

andrewrjones 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.