diff --git a/.gitignore b/.gitignore index e507b7e8..b102fc9a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,10 @@ /.vscode/ *.pyc .cache/ +.idea/ *.iml /pybigquery.egg-info /dist /build env +venv/ diff --git a/README.rst b/README.rst index b618e3cb..ddfe8487 100644 --- a/README.rst +++ b/README.rst @@ -163,7 +163,7 @@ This will create a dataset ``test_pybigquery`` with tables named ``sample_one_ro Set up an environment and run tests:: - pyvenv .env + python3 -m venv .env source .env/bin/activate pip install -r dev_requirements.txt pytest diff --git a/dev_requirements.txt b/dev_requirements.txt index b32e352b..909ba27e 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,6 +1,8 @@ sqlalchemy>=1.1.9 google-cloud-bigquery>=1.6.0 +google-cloud-bigquery-storage==2.0.0 future==0.16.0 +alembic==1.4.3 pytest==3.2.2 pytz==2017.2 \ No newline at end of file diff --git a/pybigquery/sqlalchemy_bigquery.py b/pybigquery/sqlalchemy_bigquery.py index 74573458..ef199e85 100644 --- a/pybigquery/sqlalchemy_bigquery.py +++ b/pybigquery/sqlalchemy_bigquery.py @@ -21,6 +21,15 @@ from .parse_url import parse_url +try: + import alembic +except ImportError: + pass +else: + from alembic.ddl import impl + class PyBigQueryImpl(impl.DefaultImpl): + __dialect__ = 'bigquery' + FIELD_ILLEGAL_CHARACTERS = re.compile(r'[^\w]+') diff --git a/setup.py b/setup.py index e7a3e90f..e662f9c5 100644 --- a/setup.py +++ b/setup.py @@ -27,8 +27,10 @@ def readme(): 'sqlalchemy>=1.1.9', 'google-cloud-bigquery>=1.6.0', 'future', + 'alembic==1.4.3' ], tests_require=[ + 'pytest', 'pytz' ], entry_points={