GithubHelp home page GithubHelp logo

firebolt-db / firebolt-python-sdk Goto Github PK

View Code? Open in Web Editor NEW
13.0 7.0 8.0 222.43 MB

The Python SDK for Firebolt

License: Apache License 2.0

Python 99.77% Makefile 0.10% Batchfile 0.14%
python sdk firebolt

firebolt-python-sdk's Introduction

firebolt-sdk

Nightly code check Unit tests Code quality checks Firebolt Security Scan Integration tests Coverage

Installation

  • Requires Python >=3.8
  • pip install "firebolt-sdk>=1.0.0a1"

Documentation

For reference and tutorials, see the Firebolt Python SDK reference.

Connection parameters

These parameters are used to connect to a Firebolt database:

  • account_name - name of firebolt account
  • client_id - credentials client id
  • cliend_secret - credentials client secret
  • database [Optional] - name of the database to connect to
  • engine_name [Optional] - name of the engine to connect to

Examples

See PEP-249 for the DB API reference and specifications. An example jupyter notebook is included to illustrate the use of the Firebolt API.

Special considerations

Cursor objects should not be shared between threads

Cursor is not thread-safe and should not be shared across threads. In a multi-threaded environment you can share a Connection, but each thread would need to keep its own Cursor. This corresponds to a thread safety 2 in the DBApi specification.

Some keywords are not allowed as SET parameters

cursor.execute("SET parameter=value")

This will error out if you try to set account_id, output_format, database, engine. These are special keywords that should not be set directly. To switch between databases and engines use USE DATABASE/ENGINE.

Optional features

Faster datetime with ciso8601

By default, firebolt-sdk uses datetime module to parse date and datetime values, which might be slow for a large amount of operations. In order to speed up datetime operations, it's possible to use ciso8601 package. In order to install firebolt-sdk with ciso8601 support, run pip install "firebolt-sdk[ciso8601]"

Contributing

See: CONTRIBUTING.MD

License

The Firebolt DB API is licensed under the Apache License Version 2.0 software license.

firebolt-python-sdk's People

Contributors

codyss avatar eg-firebolt avatar ericf-firebolt avatar fireboltcorey avatar fireboltjeff avatar ima-hima avatar kevinmarr avatar lucianosrp avatar marknoack avatar molly-firebolt avatar pauls-fb avatar ptiurin avatar rotemfb avatar stepansergeevitch avatar yuryfirebolt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

firebolt-python-sdk's Issues

Missing commit() Connection method

.commit()
...

Database modules that do not support transactions should implement this method with void functionality.
~ PEP-249 (https://www.python.org/dev/peps/pep-0249/#commit)

I know it's just should, but it would be nice to add it and mention the lack of transactions in Firebolt engine.

Relaxing `pydantic[dotenv]` bounds

Hello!

I'm writing integrations for Prefect on top of this sdk and running into issues with the enforced dependencies' versions.

Specifically, what I'm working on requires pydantic >= 1.10 so I'm running into this when using firebolt-sdk==0.13.1

ERROR: Cannot install prefect, pydantic[dotenv]==1.8.2, pydantic[dotenv]==1.9.0, pydantic[dotenv]==1.9.1 and pydantic[dotenv]==1.9.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    prefect 2.7.0 depends on pydantic>=1.10.0
    fastapi 0.70.0 depends on pydantic!=1.7, !=1.7.1, !=1.7.2, !=1.7.3, !=1.8, !=1.8.1, <2.0.0 and >=1.6.2
    pydantic[dotenv] 1.9.2 depends on pydantic 1.9.2

and if I try to use an earlier version, e.g.firebolt-sdk==0.8.0 I run into similar issues with httpx[http2]:

The conflict is caused by:
    prefect 2.7.0 depends on httpx[http2]>=0.23
    firebolt-sdk 0.8.0 depends on httpx[http2]==0.21.3

I'm wondering if it's possible for the upper bound of pydantic[dotenv] to be increased (or removed entirely) here to allow pydantic==1.10, as httpx[http2]==0.23.0 is no longer an issue (as of firebolt-sdk==0.13.1).

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.