Skip to content

Commit

Permalink
Fix typos in warnings, docstrings, exceptions (#19424)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnojek committed Nov 5, 2021
1 parent 5cd8085 commit f421409
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -2133,7 +2133,7 @@ def add_task(self, task):
:type task: task
"""
if not self.start_date and not task.start_date:
raise AirflowException("Task is missing the start_date parameter")
raise AirflowException("DAG is missing the start_date parameter")
# if the task has no start date, assign it the same as the DAG
elif not task.start_date:
task.start_date = self.start_date
Expand Down
2 changes: 1 addition & 1 deletion airflow/models/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def set(
:param key: Variable Key
:param value: Value to set for the Variable
:param description: Value to set for the Variable
:param description: Description of the Variable
:param serialize_json: Serialize the value to a JSON string
:param session: SQL Alchemy Sessions
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
GCP_PROJECT_ID = os.environ.get('GCP_PROJECT_ID', 'gcp-project-id')
S3BUCKET_NAME = os.environ.get('S3BUCKET_NAME', 'example-s3bucket-name')
GCS_BUCKET = os.environ.get('GCP_GCS_BUCKET', 'example-gcsbucket-name')
GCS_BUCKET_URL = f"gs://{GCS_BUCKET}/"
UPLOAD_FILE = '/tmp/example-file.txt'
PREFIX = 'TESTS'

Expand Down Expand Up @@ -56,7 +57,7 @@ def upload_file():
)
# [START howto_transfer_s3togcs_operator]
transfer_to_gcs = S3ToGCSOperator(
task_id='s3_to_gcs_task', bucket=S3BUCKET_NAME, prefix=PREFIX, dest_gcs="gs://" + GCS_BUCKET
task_id='s3_to_gcs_task', bucket=S3BUCKET_NAME, prefix=PREFIX, dest_gcs=GCS_BUCKET_URL
)
# [END howto_transfer_s3togcs_operator]

Expand Down
6 changes: 3 additions & 3 deletions airflow/providers/google/cloud/hooks/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def create_external_table(
:param labels: A dictionary containing labels for the BiqQuery table.
:type labels: dict
:param description: A string containing the description for the BigQuery table.
:type descriptin: str
:type description: str
:param encryption_configuration: [Optional] Custom encryption configuration (e.g., Cloud KMS keys).
**Example**: ::
Expand All @@ -632,8 +632,8 @@ def create_external_table(
:type encryption_configuration: dict
"""
warnings.warn(
"This method is deprecated. Please use `BigQueryHook.create_empty_table` method with"
"pass passing the `table_resource` object. This gives more flexibility than this method.",
"This method is deprecated. Please use `BigQueryHook.create_empty_table` method with "
"passing the `table_resource` object. This gives more flexibility than this method.",
DeprecationWarning,
)
location = location or self.location
Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/google/cloud/operators/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ 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.",
"Please provide table definition using `table_resource` parameter.",
DeprecationWarning,
stacklevel=2,
)
Expand Down
2 changes: 1 addition & 1 deletion breeze
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ function breeze::parse_arguments() {
shift 2
;;
-f | --forward-credentials)
echo "Forwarding credentials. Be careful as your credentials ar available in the container!"
echo "Forwarding credentials. Be careful as your credentials are available in the container!"
echo
export FORWARD_CREDENTIALS="true"
shift
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/howto/timetable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Timetable Display in UI
-----------------------

By default, a custom timetable is displayed by their class name in the UI (e.g.
the *Schedule* column in the "DAGs" table. It is possible to customize this
the *Schedule* column in the "DAGs" table). It is possible to customize this
by overriding the ``summary`` property. This is especially useful for
parameterized timetables to include arguments provided in ``__init__``. For
our ``SometimeAfterWorkdayTimetable`` class, for example, we could have:
Expand Down

0 comments on commit f421409

Please sign in to comment.
  翻译: