turbaszek commented on a change in pull request #18676:
URL: https://github.com/apache/airflow/pull/18676#discussion_r725475900
##########
File path: airflow/providers/google/cloud/operators/bigquery.py
##########
@@ -1142,11 +1142,14 @@ def __init__(
if not table_resource:
warnings.warn(
"Passing table parameters via keywords arguments will be
deprecated. "
- "Please use provide table definition using `table_resource`
parameter."
- "You can still use external `schema_object`. ",
+ "Please use provide table definition using `table_resource`
parameter.",
DeprecationWarning,
stacklevel=2,
)
+ if not bucket:
+ raise ValueError("`bucket` is required when not using
`table_resource`.")
+ if not source_objects:
+ raise ValueError("`source_objects` is required when not using
`table_resource`.")
Review comment:
I think `ValueError` is more correct.
> Passing arguments of the wrong type (e.g. passing a list when an int is
expected) should result in a TypeError, but passing arguments with the wrong
value (e.g. a number outside expected boundaries) should result in a ValueError.
This case is more of "wrong arguments" not "arguments types".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]