Skip to content

Commit

Permalink
Use inclusive words in apache airflow project (apache#23090)
Browse files Browse the repository at this point in the history
  • Loading branch information
edithturn authored May 9, 2022
1 parent 9a6baab commit d7b85d9
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 18 deletions.
39 changes: 29 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -429,19 +429,38 @@ repos:
- id: check-for-inclusive-language
language: pygrep
name: Check for language that we do not accept as community
description: Please use "deny_list" or "allow_list" instead.
entry: "(?i)(black|white)[_-]?list"
description: Please use more appropriate words for community documentation.
entry: >
(?i)
(black|white)[_-]?list|
\bshe\b|
\bhe\b|
\bher\b|
\bhis\b|
\bmaster\b|
\bslave\b|
\bsanity\b|
\bdummy\b
pass_filenames: true
exclude: >
(?x)
^airflow/www/fab_security/manager\.py$|
^airflow/providers/apache/cassandra/hooks/cassandra\.py$|
^airflow/providers/apache/hive/operators/hive_stats\.py$|
^airflow/providers/apache/hive/.*PROVIDER_CHANGES_*|
^airflow/providers/apache/hive/.*README\.md$|
^tests/providers/apache/cassandra/hooks/test_cassandra\.py$|
^docs/apache-airflow-providers-apache-cassandra/connections/cassandra\.rst$|
^docs/apache-airflow-providers-apache-hive/commits\.rst$|
^airflow/www/fab_security/manager.py$|
^airflow/www/static/|
^airflow/providers/|
^tests/providers/apache/cassandra/hooks/test_cassandra.py$|
^docs/apache-airflow-providers-apache-cassandra/connections/cassandra.rst$|
^docs/apache-airflow-providers-apache-hive/commits.rst$|
^airflow/api_connexion/openapi/v1.yaml$|
^tests/cli/commands/test_webserver_command.py$|
^airflow/cli/commands/webserver_command.py$|
^airflow/ui/yarn.lock$|
^airflow/config_templates/default_airflow.cfg$|
^airflow/config_templates/config.yml$|
^docs/*.*$|
^tests/providers/|
^.pre-commit-config\.yaml$|
^.*RELEASE_NOTES\.rst$|
^.*CHANGELOG\.txt$|^.*CHANGELOG\.rst$|
git
- id: check-base-operator-usage
language: pygrep
Expand Down
4 changes: 2 additions & 2 deletions airflow/sensors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ def _validate_input_values(self) -> None:
f".{self.task_id}'; received '{self.mode}'."
)

# Sanity check for poke_interval isn't immediately over MySQL's TIMESTAMP limit.
# Quick check for poke_interval isn't immediately over MySQL's TIMESTAMP limit.
# This check is only rudimentary to catch trivial user errors, e.g. mistakenly
# set the value to milliseconds instead of seconds. There's another check when
# we actually try to reschedule to ensure database sanity.
# we actually try to reschedule to ensure database coherence.
if self.reschedule and _is_metadatabase_mysql():
if timezone.utcnow() + datetime.timedelta(seconds=self.poke_interval) > _MYSQL_TIMESTAMP_MAX:
raise AirflowException(
Expand Down
2 changes: 1 addition & 1 deletion airflow/utils/orm_event_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def set_sqlite_pragma(dbapi_connection, connection_record):
cursor.execute("PRAGMA foreign_keys=ON")
cursor.close()

# this ensures sanity in mysql when storing datetimes (not required for postgres)
# this ensures coherence in mysql when storing datetimes (not required for postgres)
if engine.dialect.name == "mysql":

@event.listens_for(engine, "connect")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def clean_docker_context_files(verbose: bool, dry_run: bool):

def check_docker_context_files(install_packages_from_context: bool):
"""
Sanity check - if we want to install from docker-context-files we expect some packages there but if
Quick check - if we want to install from docker-context-files we expect some packages there but if
we don't - we don't expect them, and they might invalidate Docker cache.
This method exits with an error if what we see is unexpected for given operation.
Expand Down Expand Up @@ -459,7 +459,7 @@ def build_production_image(
* converts all the parameters received via kwargs into BuildProdParams (including cache)
* prints info about the image to build
* removes docker-context-files if requested
* performs sanity check if the files are present in docker-context-files if expected
* performs quick check if the files are present in docker-context-files if expected
* logs int to docker registry on CI if build cache is being executed
* removes "tag" for previously build image so that inline cache uses only remote image
* constructs docker-compose command to run based on parameters passed
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/libraries/_sanity_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function sanity_checks::go_to_airflow_sources {
}

#
# Performs basic sanity checks common for most of the scripts in this directory
# Performs basic quick checks common for most of the scripts in this directory
#
function sanity_checks::basic_sanity_checks() {
sanity_checks::assert_not_in_container
Expand Down
2 changes: 1 addition & 1 deletion scripts/in_container/run_system_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.

#
# Bash sanity settings (error on exit, complain for undefined vars, error when pipe fails)
# Bash coherence settings (error on exit, complain for undefined vars, error when pipe fails)
set -euo pipefail

IN_CONTAINER_DIR=$(cd "$(dirname "$0")" || exit 1; pwd)
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def trace_sql(request):

terminal_reporter = request.config.pluginmanager.getplugin("terminalreporter")
# if no terminal reporter plugin is present, nothing we can do here;
# this can happen when this function executes in a slave node
# this can happen when this function executes in a worker node
# when using pytest-xdist, for example
if terminal_reporter is None:
yield
Expand Down

0 comments on commit d7b85d9

Please sign in to comment.