Skip to content

Commit bee9e9c

Browse files
Merge pull request #49 from cal-itp/update-sqlalchemy-bigquery
calitp(dependencies): added sqlalchemy-bigquery to calitp-py, removed pybigquery
2 parents 8136150 + 3d9c6b5 commit bee9e9c

7 files changed

+38
-21
lines changed

calitp/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# flake8: noqa
22

3-
__version__ = "0.0.12"
3+
__version__ = "0.0.13"
44

55
from .sql import get_table, write_table, query_sql, to_snakecase, get_engine
66
from .storage import save_to_gcfs, read_gcfs

calitp/__main__.py

+20-5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,28 @@
77

88
@app.command()
99
def random_protobuff(
10-
glob=typer.Argument("*", help="A glob matching itp_id/url_number/string.",),
11-
bucket=typer.Option("gtfs-data", help="GCS bucket to search.",),
12-
date=typer.Option(f"{datetime.date.today()}*", help="Date glob.",),
13-
format=typer.Option("protobuff", help="format to output, json or protobuff.",),
10+
glob=typer.Argument(
11+
"*",
12+
help="A glob matching itp_id/url_number/string.",
13+
),
14+
bucket=typer.Option(
15+
"gtfs-data",
16+
help="GCS bucket to search.",
17+
),
18+
date=typer.Option(
19+
f"{datetime.date.today()}*",
20+
help="Date glob.",
21+
),
22+
format=typer.Option(
23+
"protobuff",
24+
help="format to output, json or protobuff.",
25+
),
1426
):
1527
blob, data, error = get_random_protobuff(
16-
glob, bucket=bucket, date=date, format=format,
28+
glob,
29+
bucket=bucket,
30+
date=date,
31+
format=format,
1732
)
1833
data = str(data)
1934
print(f"downloaded {blob}")

calitp/config.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ def format_table_name(name, is_staging=False, full_name=False):
9696

9797

9898
def pipe_file_name(path):
99-
"""Returns absolute path for a file in the pipeline (e.g. the data folder).
100-
101-
"""
99+
"""Returns absolute path for a file in the pipeline (e.g. the data folder)."""
102100

103101
# For now, we just get the path relative to the directory holding the
104102
# DAGs folder. For some reason, gcp doesn't expose the same variable

calitp/tests/test_tables.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ def test_write_table(tmp_name):
5858
with as_pipeline():
5959
write_table(df, tmp_name)
6060

61-
tbl = AutoTable(get_engine(), lambda s: s, lambda s: True,) # s.replace(".", "_"),
61+
tbl = AutoTable(
62+
get_engine(),
63+
lambda s: s,
64+
lambda s: True,
65+
) # s.replace(".", "_"),
6266

6367
tbl._init()
6468

requirements-dev.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ filelock==3.0.12
1919
fsspec==2021.6.0
2020
future==0.18.2
2121
gcsfs==0.8.0
22-
google-api-core==1.30.0
22+
google-api-core==2.7.1
2323
google-auth==1.31.0
2424
google-auth-oauthlib==0.4.4
25-
google-cloud-bigquery==2.16.1
25+
google-cloud-bigquery==2.25.2
2626
google-cloud-bigquery-storage==2.8.0
27-
google-cloud-core==1.7.0
27+
google-cloud-core==2.2.3
2828
google-crc32c==1.1.2
2929
google-resumable-media==1.3.0
3030
googleapis-common-protos==1.53.0
31-
grpcio==1.38.0
31+
grpcio==1.44.0
3232
identify==2.2.10
3333
idna==2.10
3434
iniconfig==1.1.1
@@ -74,7 +74,7 @@ py==1.10.0
7474
pyarrow==4.0.1
7575
pyasn1==0.4.8
7676
pyasn1-modules==0.2.8
77-
pybigquery==0.7.0
77+
sqlalchemy-bigquery==1.4.3
7878
pycparser==2.20
7979
pydata-google-auth==1.2.0
8080
Pygments==2.9.0

requirements.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ filelock==3.0.12
1515
fsspec==2021.6.0
1616
future==0.18.2
1717
gcsfs==0.8.0
18-
google-api-core==1.30.0
18+
google-api-core==2.7.1
1919
google-auth==1.31.0
2020
google-auth-oauthlib==0.4.4
21-
google-cloud-bigquery==2.16.1
22-
google-cloud-core==1.7.0
21+
google-cloud-bigquery==2.25.2
22+
google-cloud-core==2.2.3
2323
google-crc32c==1.1.2
2424
google-resumable-media==1.3.0
2525
googleapis-common-protos==1.53.0
26-
grpcio==1.38.0
26+
grpcio==1.44.0
2727
gtfs-realtime-bindings==0.0.7
2828
identify==2.2.10
2929
idna==2.10
@@ -52,7 +52,7 @@ ptyprocess==0.7.0
5252
py==1.10.0
5353
pyasn1==0.4.8
5454
pyasn1-modules==0.2.8
55-
pybigquery==0.7.0
55+
sqlalchemy-bigquery==1.4.3
5656
pycparser==2.20
5757
pydata-google-auth==1.2.0
5858
Pygments==2.9.0

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"gcsfs",
2020
"pandas",
2121
"pandas-gbq",
22-
"pybigquery",
22+
"sqlalchemy-bigquery",
2323
"google-cloud-bigquery",
2424
"gtfs-realtime-bindings",
2525
],

0 commit comments

Comments
 (0)