Skip to content

Commit

Permalink
Remove deprecated parameters from BigQueryHook: (#23269)
Browse files Browse the repository at this point in the history
* `BigQueryHook.create_empty_table` Remove `num_retries`. Please use `retry`.

* `BigQueryHook.run_grant_dataset_view_access` Remove `source_project`. Please use `project_id`.
  • Loading branch information
eladkal authored Apr 27, 2022
1 parent 9c5d505 commit 4d9c55c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 4 additions & 0 deletions airflow/providers/google/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ Breaking changes

* ``CloudDatastoreExportEntitiesOperator`` : Remove ``xcom_push``. Please use ``BaseOperator.do_xcom_push``

* ``BigQueryHook.create_empty_table`` Remove ``num_retries``. Please use ``retry``.

* ``BigQueryHook.run_grant_dataset_view_access`` Remove ``source_project``. Please use ``project_id``.

6.8.0
.....

Expand Down
10 changes: 0 additions & 10 deletions airflow/providers/google/cloud/hooks/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ def create_empty_table(
materialized_view: Optional[Dict] = None,
encryption_configuration: Optional[Dict] = None,
retry: Optional[Retry] = DEFAULT_RETRY,
num_retries: Optional[int] = None,
location: Optional[str] = None,
exists_ok: bool = True,
) -> Table:
Expand Down Expand Up @@ -374,8 +373,6 @@ def create_empty_table(
:param exists_ok: If ``True``, ignore "already exists" errors when creating the table.
:return: Created table
"""
if num_retries:
warnings.warn("Parameter `num_retries` is deprecated", DeprecationWarning)

_table_resource: Dict[str, Any] = {}

Expand Down Expand Up @@ -1069,7 +1066,6 @@ def run_grant_dataset_view_access(
source_dataset: str,
view_dataset: str,
view_table: str,
source_project: Optional[str] = None,
view_project: Optional[str] = None,
project_id: Optional[str] = None,
) -> Dict[str, Any]:
Expand All @@ -1087,12 +1083,6 @@ def run_grant_dataset_view_access(
self.project_id will be used.
:return: the datasets resource of the source dataset.
"""
if source_project:
project_id = source_project
warnings.warn(
"Parameter ``source_project`` is deprecated. Use ``project_id``.",
DeprecationWarning,
)
view_project = view_project or project_id
view_access = AccessEntry(
role=None,
Expand Down

0 comments on commit 4d9c55c

Please sign in to comment.