Giter Club home page Giter Club logo

Comments (2)

laughingman7743 avatar laughingman7743 commented on June 12, 2024

https://github.com/laughingman7743/PyAthena/blob/master/pyathena/sqlalchemy/base.py#L996-L1006
It would need to be fixed to be able to handle the case of VPCE.

from pyathena.

laughingman7743 avatar laughingman7743 commented on June 12, 2024

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html#boto3.session.Session.client
https://github.com/laughingman7743/PyAthena/blob/master/pyathena/connection.py#L44
https://github.com/laughingman7743/PyAthena/blob/master/pyathena/connection.py#L155-L157
The SQLAlchemy URL is not associated with a VPC endpoint URL.
You should be able to use VPCE by specifying the VPCE URL in the parameter endpoint_url in the SQLAlchemy URL as follows:

conn_str = "awsathena+rest://{aws_access_key_id}:{aws_secret_access_key}@athena.{region_name}.amazonaws.com:443/"\
           "{schema_name}?s3_staging_dir={s3_staging_dir}&endpoint_url={endpoint_url}"
engine = create_engine(conn_str.format(
    aws_access_key_id="YOUR_ACCESS_KEY_ID",
    aws_secret_access_key="YOUR_SECRET_ACCESS_KEY",
    region_name="us-west-2",
    schema_name="default",
    s3_staging_dir="s3://YOUR_S3_BUCKET/path/to/",
    endpoint_url="VPC_ENDPOINT_ID.athena.us-west-2.vpce.amazonaws.com"))

from pyathena.

Related Issues (20)

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.