Skip to main content

A Harlequin adapter for Amazon Athena.

Project description

harlequin-athena

This repo provides the Harlequin adapter for Amazon Athena.

Installation

harlequin-athena depends on harlequin, so installing this package will also install Harlequin.

Using pip

To install this adapter into an activated virtual environment:

pip install harlequin-athena

Using poetry

poetry add harlequin-athena

Using pipx

If you do not already have Harlequin installed:

pip install harlequin-athena

If you would like to add the Athena adapter to an existing Harlequin installation:

pipx inject harlequin harlequin-athena

As an Extra

Alternatively, you can install Harlequin with the athena extra:

pip install harlequin[athena]
poetry add harlequin[athena]
pipx install harlequin[athena]

Usage and Configuration

For a minimum connection you are going to need:

  • s3_staging_dir (required): S3 bucket path for query results
  • region (optional, default: us-east-1): AWS region
harlequin -a athena -s s3://my-bucket/athena-results/ -r us-east-1

AWS Credentials

The adapter supports multiple methods for AWS authentication:

  1. Default credentials (environment variables, ~/.aws/credentials, or IAM role):

    harlequin -a athena -s s3://my-bucket/athena-results/
    
  2. AWS Profile:

    harlequin -a athena -s s3://my-bucket/athena-results/ --profile my-profile
    
  3. Explicit credentials:

    harlequin -a athena -s s3://my-bucket/athena-results/ \
      --aws-access-key-id AKIA... \
      --aws-secret-access-key ...
    

Additional Options

  • --work-group or -w: Athena work group to use
  • --schema or -d or --database: Default schema (database) to use
  • --catalog or -c: Catalog name (default: AwsDataCatalog)
  • --poll-interval: Polling interval in seconds for checking query status (default: 0.5, lower = faster polling)

Example with all options:

harlequin -a athena \
  -s s3://my-bucket/athena-results/ \
  -r us-east-1 \
  -w my-workgroup \
  -d my_database \
  -c AwsDataCatalog

Many more options are available; to see the full list, run:

harlequin --help

For more information, see the Harlequin Docs.

Development

Setup

git clone https://github.com/yourusername/harlequin-athena.git
cd harlequin-athena
poetry install

Running Tests

poetry run pytest

Note: Tests require AWS credentials and an Athena setup. You may want to use mocking for CI/CD.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

harlequin_athena-0.1.1.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

harlequin_athena-0.1.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file harlequin_athena-0.1.1.tar.gz.

File metadata

  • Download URL: harlequin_athena-0.1.1.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for harlequin_athena-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fbc144bb6526507e9db2bc96f66c930706b734ea06b475359e5b335fb1f8181f
MD5 16854e9e25e3fbaa5cea36d2e77904de
BLAKE2b-256 8fa0dd06a83db032dea4389dd8e6f96d93cb85bf19146c098ec832353ba78da3

See more details on using hashes here.

File details

Details for the file harlequin_athena-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for harlequin_athena-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 54081914d6b1cb2292aa07a282c805890da31c260d3fbc2e3bf1119485b38284
MD5 33d29f999acba99cb13fd97f0b090ea4
BLAKE2b-256 af6ced7ceec6d17d946b60a34d0150c9ee868d5a652a56af0d7561f3a320f709

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page