Skip to content

Commit 4dc6173

Browse files
[io] Provide correct installation messages when modules not found
1 parent 4cb66ec commit 4dc6173

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

libs/garf_io/garf_io/writers/bigquery_writer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
from google.cloud import bigquery
2020
except ImportError as e:
2121
raise ImportError(
22-
'Please install google-ads-api-report-fetcher with BigQuery support '
23-
'- `pip install google-ads-api-report-fetcher[bq]`'
22+
'Please install garf-io with BigQuery support '
23+
'- `pip install garf-io[bq]`'
2424
) from e
2525

2626
import datetime
@@ -171,7 +171,7 @@ def _define_schema(
171171

172172
def _get_result_types(
173173
report: garf_report.GarfReport,
174-
) -> dict[str, dict[str, parsers.GoogleAdsRowElement]]:
174+
) -> dict[str, dict[str, parsers.ApiRowElement]]:
175175
"""Maps each column of report to BigQuery field type and repeated status.
176176
177177
Fields types are inferred based on report results or results placeholder.
@@ -182,7 +182,7 @@ def _get_result_types(
182182
Returns:
183183
Mapping between each column of report and its field type.
184184
"""
185-
result_types: dict[str, dict[str, parsers.GoogleAdsRowElement]] = {}
185+
result_types: dict[str, dict[str, parsers.ApiRowElement]] = {}
186186
column_names = report.column_names
187187
for row in report.results or report.results_placeholder:
188188
if set(column_names) == set(result_types.keys()):
@@ -209,7 +209,7 @@ def _get_result_types(
209209

210210

211211
def _get_bq_schema(
212-
types: dict[str, dict[str, parsers.GoogleAdsRowElement]],
212+
types: dict[str, dict[str, parsers.ApiRowElement]],
213213
) -> list[bigquery.SchemaField]:
214214
"""Converts report fields types to BigQuery schema fields.
215215

libs/garf_io/garf_io/writers/sheets_writer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import gspread
2222
except ImportError as e:
2323
raise ImportError(
24-
'Please install google-ads-api-report-fetcher with sheets support - '
25-
'`pip install google-ads-api-report-fetcher[sheet]`'
24+
'Please install garf-io with sheets support - '
25+
'`pip install garf-io[sheets]`'
2626
) from e
2727

2828
import datetime

libs/garf_io/garf_io/writers/sqldb_writer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import sqlalchemy
2020
except ImportError as e:
2121
raise ImportError(
22-
'Please install google-ads-api-report-fetcher with sqlalchemy support '
23-
'- `pip install google-ads-api-report-fetcher[sqlalchemy]`'
22+
'Please install garf-io with sqlalchemy support '
23+
'- `pip install garf-io[sqlalchemy]`'
2424
) from e
2525

2626
import logging

0 commit comments

Comments
 (0)