Using gaarf in Airflow
If you want to use Apache Airflow to run any gaarf-based projects you can use
airflow-google-ads-api-report-fetcher package.
Install it with pip install airflow-google-ads-api-report-fetcher -
it will make airflow_gaarf library available.
Install the latest development version with
pip install -e git+https://github.com/google/ads-api-report-fetcher.git#egg=airflow-google-ads-api-report-fetcher\&subdirectory=py/airflow_gaarf
The library comes with two operators - GaarfOperator and GaarfBqOperator which can
be used to simplify executing google_ads_queries and bq_queries respectively.
Setup
Connections
Template pipeline expects two type of connections - go to Admin - Connections, add new connection (type Generic) and in Extra add the values specified below:
-
google_ads_default{"google_ads_client": {"developer_token": "", "client_id": "", "client_secret": "", "refresh_token": "", "login_customer_id": "", "client_customer_id": "", "use_proto_plus": "true" } } -
gcp_conn_id{"cloud": {"project_id": "your-project"} }
Examples
Once the above connections were setup you may proceed to configuring DAG.
examples folder contains several DAGs you might find useful:
01_gaarf_console_reader_console_writer.py- simple DAG which consist of a singleGaarfOperatorwhat fetches data from an inline query and outputs results to the console.02_gaarf_file_reader_csv_writer.py- DAG that reads query from a file (can be local or remote storage) and save results to CSV.03_gaarf_read_solution_directory- DAG that reads queries from a directory with queries and for reach query builds its own task.
Metadata
Release files for airflow-google-ads-api-report-fetcher 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| airflow-google-ads-api-report-fetcher-0.0.7.tar.gz | 4.4 kB | Without provenance | Details for airflow-google-ads-api-report-fetcher-0.0.7.tar.gz |
Release files / airflow-google-ads-api-report-fetcher-0.0.7.tar.gz
| Download URL | airflow-google-ads-api-report-fetcher-0.0.7.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca477b74525f1b3deacd47370c4afa2e4fe567c783d2467e3e7cbfc2a80cf174
|
|
BLAKE2b-256 checksum How to use checksums |
0733976b6114214408b962266e3bdf754b933dfcc7a5f2d8073adfe40fc8cb73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Security for airflow-google-ads-api-report-fetcher 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.