Skip to content

Commit b8c933d

Browse files
committed
Restore _generate_bq_schema, as it is used in tests.
1 parent 8d820ed commit b8c933d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pandas_gbq/gbq.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,7 @@ def to_gbq(dataframe, destination_table, project_id, chunksize=None,
953953
private_key=private_key)
954954

955955
if not table_schema:
956-
from pandas_gbq import _schema
957-
table_schema = _schema.generate_bq_schema(df)
956+
table_schema = _generate_bq_schema(dataframe)
958957
else:
959958
table_schema = dict(fields=table_schema)
960959

@@ -994,11 +993,15 @@ def generate_bq_schema(df, default_type='STRING'):
994993
The default big query type in case the type of the column
995994
does not exist in the schema.
996995
"""
997-
from pandas_gbq import _schema
998-
999996
# deprecation TimeSeries, #11121
1000997
warnings.warn("generate_bq_schema is deprecated and will be removed in "
1001998
"a future version", FutureWarning, stacklevel=2)
999+
1000+
return _generate_bq_schema(df, default_type=default_type)
1001+
1002+
1003+
def _generate_bq_schema(df, default_type='STRING'):
1004+
from pandas_gbq import _schema
10021005
return _schema.generate_bq_schema(df, default_type=default_type)
10031006

10041007

0 commit comments

Comments
 (0)