From 0a74928894fb57b0160208262ccacad12da23fc7 Mon Sep 17 00:00:00 2001 From: Hussein Awala Date: Mon, 18 Mar 2024 11:43:36 +0100 Subject: [PATCH] Bump ruff to 0.3.3 (#38240) --- .pre-commit-config.yaml | 4 +-- airflow/__main__.py | 1 + airflow/api/__init__.py | 1 + airflow/api/auth/backend/basic_auth.py | 1 + airflow/api/auth/backend/default.py | 1 + airflow/api/auth/backend/deny_all.py | 1 + airflow/api/auth/backend/session.py | 1 + airflow/api/client/__init__.py | 1 + airflow/api/client/api_client.py | 1 + airflow/api/client/json_client.py | 1 + airflow/api/client/local_client.py | 1 + airflow/api/common/delete_dag.py | 1 + airflow/api/common/experimental/__init__.py | 1 + airflow/api/common/experimental/delete_dag.py | 1 + airflow/api/common/experimental/get_code.py | 1 + .../common/experimental/get_dag_run_state.py | 1 + .../api/common/experimental/get_dag_runs.py | 1 + .../api/common/experimental/get_lineage.py | 1 + airflow/api/common/experimental/get_task.py | 1 + .../common/experimental/get_task_instance.py | 1 + airflow/api/common/experimental/mark_tasks.py | 1 + airflow/api/common/experimental/pool.py | 1 + .../api/common/experimental/trigger_dag.py | 1 + airflow/api/common/mark_tasks.py | 1 + airflow/api/common/trigger_dag.py | 1 + .../fab/api/auth/backend/basic_auth.py | 1 + .../fab/api/auth/backend/kerberos_auth.py | 1 + airflow/auth/managers/models/base_user.py | 6 ++-- airflow/cli/commands/celery_command.py | 1 + airflow/cli/commands/config_command.py | 1 + airflow/cli/commands/connection_command.py | 1 + airflow/cli/commands/dag_command.py | 1 + airflow/cli/commands/dag_processor_command.py | 1 + airflow/cli/commands/db_command.py | 1 + airflow/cli/commands/info_command.py | 1 + airflow/cli/commands/internal_api_command.py | 1 + airflow/cli/commands/kerberos_command.py | 1 + airflow/cli/commands/kubernetes_command.py | 1 + airflow/cli/commands/pool_command.py | 1 + airflow/cli/commands/provider_command.py | 1 + .../cli/commands/rotate_fernet_key_command.py | 1 + airflow/cli/commands/scheduler_command.py | 1 + airflow/cli/commands/task_command.py | 4 +-- airflow/cli/commands/triggerer_command.py | 1 + airflow/cli/commands/variable_command.py | 1 + airflow/cli/commands/version_command.py | 1 + airflow/cli/commands/webserver_command.py | 1 + .../airflow_local_settings.py | 1 + .../default_webserver_config.py | 1 + airflow/configuration.py | 12 +++---- airflow/contrib/hooks/__init__.py | 1 + airflow/contrib/operators/__init__.py | 1 + airflow/contrib/secrets/__init__.py | 1 + airflow/contrib/sensors/__init__.py | 1 + airflow/contrib/task_runner/__init__.py | 1 + airflow/contrib/utils/__init__.py | 1 + airflow/contrib/utils/log/__init__.py | 1 + airflow/dag_processing/manager.py | 1 + airflow/decorators/base.py | 21 ++++------- airflow/decorators/task_group.py | 6 ++-- airflow/example_dags/example_bash_operator.py | 1 + .../example_branch_datetime_operator.py | 1 + .../example_branch_day_of_week_operator.py | 1 + airflow/example_dags/example_branch_labels.py | 1 + .../example_dags/example_branch_operator.py | 1 + .../example_branch_operator_decorator.py | 1 + .../example_branch_python_dop_operator_3.py | 1 + airflow/example_dags/example_complex.py | 1 + airflow/example_dags/example_datasets.py | 1 + .../example_dynamic_task_mapping.py | 1 + ...task_mapping_with_no_taskflow_operators.py | 1 + .../example_external_task_marker_dag.py | 1 + .../example_kubernetes_executor.py | 1 + airflow/example_dags/example_latest_only.py | 1 + .../example_latest_only_with_trigger.py | 1 + .../example_local_kubernetes_executor.py | 1 + .../example_dags/example_nested_branch_dag.py | 1 + .../example_dags/example_params_trigger_ui.py | 1 + .../example_params_ui_tutorial.py | 1 + ...example_passing_params_via_test_command.py | 1 + .../example_dags/example_python_decorator.py | 1 + .../example_dags/example_python_operator.py | 1 + .../example_dags/example_setup_teardown.py | 1 + .../example_setup_teardown_taskflow.py | 1 + .../example_short_circuit_decorator.py | 1 + .../example_short_circuit_operator.py | 1 + airflow/example_dags/example_skip_dag.py | 1 + airflow/example_dags/example_sla_dag.py | 1 + .../example_dags/example_subdag_operator.py | 1 + airflow/example_dags/example_task_group.py | 1 + .../example_task_group_decorator.py | 1 + .../example_time_delta_sensor_async.py | 1 + .../example_trigger_controller_dag.py | 1 + .../example_trigger_target_dag.py | 1 + airflow/example_dags/example_xcom.py | 1 + airflow/example_dags/example_xcomargs.py | 1 + airflow/example_dags/plugins/workday.py | 1 + airflow/example_dags/subdags/subdag.py | 1 + airflow/example_dags/tutorial.py | 1 + airflow/example_dags/tutorial_dag.py | 1 + airflow/exceptions.py | 1 + airflow/executors/__init__.py | 1 + airflow/executors/base_executor.py | 1 + airflow/executors/debug_executor.py | 1 + airflow/executors/executor_loader.py | 1 + airflow/executors/local_executor.py | 1 + airflow/executors/sequential_executor.py | 1 + airflow/hooks/__init__.py | 1 + airflow/hooks/base.py | 1 + airflow/hooks/dbapi.py | 1 + airflow/hooks/package_index.py | 1 + .../pre_7_4_0_compatibility/k8s_model.py | 1 + .../pre_7_4_0_compatibility/kube_client.py | 1 + .../pre_7_4_0_compatibility/pod_generator.py | 1 + .../pod_generator_deprecated.py | 1 + .../pre_7_4_0_compatibility/secret.py | 1 + airflow/lineage/__init__.py | 1 + airflow/lineage/backend.py | 1 + airflow/lineage/entities.py | 1 + airflow/metrics/protocols.py | 6 ++-- airflow/models/__init__.py | 1 + airflow/models/baseoperator.py | 1 + airflow/models/dag.py | 6 ++-- airflow/models/dagparam.py | 1 + airflow/models/dagrun.py | 6 ++-- airflow/models/renderedtifields.py | 1 + airflow/models/serialized_dag.py | 1 + airflow/models/taskfail.py | 1 + airflow/models/taskmap.py | 1 + airflow/models/taskreschedule.py | 1 + airflow/operators/branch.py | 1 + airflow/operators/latest_only.py | 1 + airflow/operators/subdag.py | 1 + airflow/plugins_manager.py | 1 + airflow/providers/airbyte/sensors/airbyte.py | 1 + .../cloud/operators/analyticdb_spark.py | 3 +- .../providers/alibaba/cloud/operators/oss.py | 1 + .../aws/auth_manager/cli/avp_commands.py | 1 + .../aws/auth_manager/cli/idc_commands.py | 1 + .../aws/executors/batch/batch_executor.py | 1 + airflow/providers/amazon/aws/hooks/athena.py | 1 + .../providers/amazon/aws/hooks/base_aws.py | 1 + .../amazon/aws/hooks/batch_client.py | 1 + .../amazon/aws/hooks/batch_waiters.py | 1 + airflow/providers/amazon/aws/hooks/chime.py | 1 + .../amazon/aws/hooks/cloud_formation.py | 1 + .../providers/amazon/aws/hooks/datasync.py | 1 + .../providers/amazon/aws/hooks/dynamodb.py | 1 + airflow/providers/amazon/aws/hooks/eks.py | 1 + .../amazon/aws/hooks/glue_catalog.py | 1 + airflow/providers/amazon/aws/hooks/kinesis.py | 1 + .../amazon/aws/hooks/lambda_function.py | 1 + airflow/providers/amazon/aws/hooks/rds.py | 1 + airflow/providers/amazon/aws/hooks/s3.py | 1 + airflow/providers/amazon/aws/hooks/ses.py | 1 + airflow/providers/amazon/aws/hooks/sns.py | 1 + airflow/providers/amazon/aws/hooks/sqs.py | 1 + .../providers/amazon/aws/operators/batch.py | 1 + .../amazon/aws/operators/cloud_formation.py | 1 + .../amazon/aws/operators/datasync.py | 1 + airflow/providers/amazon/aws/operators/eks.py | 1 + airflow/providers/amazon/aws/operators/s3.py | 1 + airflow/providers/amazon/aws/operators/sns.py | 1 + airflow/providers/amazon/aws/operators/sqs.py | 1 + .../amazon/aws/secrets/secrets_manager.py | 1 + .../amazon/aws/secrets/systems_manager.py | 1 + .../amazon/aws/sensors/cloud_formation.py | 1 + airflow/providers/amazon/aws/sensors/eks.py | 7 ++-- airflow/providers/amazon/aws/sensors/sqs.py | 1 + .../providers/amazon/aws/transfers/base.py | 1 + .../amazon/aws/transfers/exasol_to_s3.py | 1 + .../amazon/aws/transfers/gcs_to_s3.py | 1 + .../amazon/aws/transfers/google_api_to_s3.py | 1 + .../amazon/aws/transfers/hive_to_dynamodb.py | 1 + .../amazon/aws/transfers/http_to_s3.py | 1 + .../aws/transfers/imap_attachment_to_s3.py | 1 + .../amazon/aws/transfers/redshift_to_s3.py | 1 + airflow/providers/amazon/aws/utils/emailer.py | 1 + airflow/providers/apache/beam/hooks/beam.py | 1 + .../providers/apache/beam/operators/beam.py | 10 +++--- .../apache/cassandra/hooks/cassandra.py | 1 + .../apache/druid/transfers/hive_to_druid.py | 1 + .../providers/apache/hdfs/hooks/webhdfs.py | 1 + .../apache/hive/transfers/hive_to_mysql.py | 1 + .../apache/hive/transfers/hive_to_samba.py | 1 + .../apache/hive/transfers/mssql_to_hive.py | 1 + .../apache/hive/transfers/mysql_to_hive.py | 1 + .../apache/hive/transfers/s3_to_hive.py | 1 + .../apache/hive/transfers/vertica_to_hive.py | 1 + airflow/providers/apache/livy/hooks/livy.py | 1 + .../providers/apache/livy/operators/livy.py | 1 + airflow/providers/apache/livy/sensors/livy.py | 1 + .../providers/apache/livy/triggers/livy.py | 1 + airflow/providers/arangodb/hooks/arangodb.py | 1 + airflow/providers/asana/hooks/asana.py | 1 + .../providers/atlassian/jira/hooks/jira.py | 1 + .../providers/celery/cli/celery_command.py | 1 + .../celery/executors/celery_executor.py | 1 + .../celery/executors/default_celery.py | 1 + airflow/providers/cloudant/hooks/cloudant.py | 1 + .../backcompat/backwards_compat_converters.py | 1 + .../executors/kubernetes_executor.py | 1 + .../providers/cncf/kubernetes/k8s_model.py | 1 + .../providers/cncf/kubernetes/kube_client.py | 1 + .../operators/custom_object_launcher.py | 1 + .../cncf/kubernetes/operators/job.py | 1 + .../kubernetes/operators/kubernetes_pod.py | 1 + .../cncf/kubernetes/pod_generator.py | 1 + .../kubernetes/pod_generator_deprecated.py | 1 + .../kubernetes/pod_launcher_deprecated.py | 1 + .../kubernetes/python_kubernetes_script.py | 1 + airflow/providers/cncf/kubernetes/secret.py | 1 + .../kubernetes/triggers/kubernetes_pod.py | 1 + .../cncf/kubernetes/utils/pod_manager.py | 1 + .../cncf/kubernetes/utils/xcom_sidecar.py | 1 + airflow/providers/common/sql/hooks/sql.py | 6 ++-- .../providers/databricks/hooks/databricks.py | 1 + .../databricks/hooks/databricks_base.py | 1 + .../databricks/hooks/databricks_sql.py | 6 ++-- .../databricks/operators/databricks.py | 1 + .../databricks/operators/databricks_repos.py | 1 + .../databricks/operators/databricks_sql.py | 1 + airflow/providers/docker/exceptions.py | 1 + airflow/providers/docker/operators/docker.py | 1 + .../docker/operators/docker_swarm.py | 1 + airflow/providers/exasol/hooks/exasol.py | 6 ++-- .../api/auth/backend/basic_auth.py | 1 + .../auth_manager/cli_commands/role_command.py | 1 + .../cli_commands/sync_perm_command.py | 1 + .../auth_manager/cli_commands/user_command.py | 1 + airflow/providers/facebook/ads/hooks/ads.py | 1 + airflow/providers/ftp/operators/ftp.py | 1 + airflow/providers/github/hooks/github.py | 1 + airflow/providers/google/ads/hooks/ads.py | 1 + airflow/providers/google/ads/operators/ads.py | 1 + .../example_dags/example_cloud_sql_query.py | 1 + .../cloud/example_dags/example_cloud_task.py | 1 + .../example_facebook_ads_to_gcs.py | 1 + .../cloud/example_dags/example_looker.py | 1 + .../example_dags/example_presto_to_gcs.py | 1 + .../example_dags/example_salesforce_to_gcs.py | 1 + .../providers/google/cloud/hooks/automl.py | 1 + .../google/cloud/hooks/bigquery_dts.py | 1 + .../providers/google/cloud/hooks/bigtable.py | 1 + .../google/cloud/hooks/cloud_build.py | 1 + .../google/cloud/hooks/cloud_memorystore.py | 1 + .../providers/google/cloud/hooks/cloud_sql.py | 1 + .../providers/google/cloud/hooks/compute.py | 1 + .../providers/google/cloud/hooks/dataflow.py | 1 + .../google/cloud/hooks/datafusion.py | 1 + .../google/cloud/hooks/datapipeline.py | 1 + .../providers/google/cloud/hooks/dataplex.py | 1 + .../providers/google/cloud/hooks/dataprep.py | 1 + .../providers/google/cloud/hooks/dataproc.py | 1 + .../google/cloud/hooks/dataproc_metastore.py | 1 + .../providers/google/cloud/hooks/datastore.py | 1 + airflow/providers/google/cloud/hooks/dlp.py | 1 + .../providers/google/cloud/hooks/functions.py | 1 + airflow/providers/google/cloud/hooks/gcs.py | 7 ++-- airflow/providers/google/cloud/hooks/kms.py | 1 + .../google/cloud/hooks/kubernetes_engine.py | 1 + .../google/cloud/hooks/life_sciences.py | 1 + .../providers/google/cloud/hooks/looker.py | 1 + .../providers/google/cloud/hooks/mlengine.py | 1 + .../google/cloud/hooks/natural_language.py | 1 + .../providers/google/cloud/hooks/os_login.py | 1 + .../providers/google/cloud/hooks/pubsub.py | 1 + .../google/cloud/hooks/secret_manager.py | 1 + .../providers/google/cloud/hooks/spanner.py | 1 + .../google/cloud/hooks/speech_to_text.py | 1 + .../google/cloud/hooks/stackdriver.py | 1 + .../google/cloud/hooks/text_to_speech.py | 1 + .../providers/google/cloud/hooks/translate.py | 1 + .../google/cloud/hooks/vertex_ai/auto_ml.py | 1 + .../hooks/vertex_ai/batch_prediction_job.py | 1 + .../cloud/hooks/vertex_ai/custom_job.py | 1 + .../google/cloud/hooks/vertex_ai/dataset.py | 1 + .../cloud/hooks/vertex_ai/endpoint_service.py | 1 + .../vertex_ai/hyperparameter_tuning_job.py | 1 + .../cloud/hooks/vertex_ai/pipeline_job.py | 1 + .../google/cloud/hooks/video_intelligence.py | 1 + .../providers/google/cloud/hooks/vision.py | 1 + .../providers/google/cloud/links/automl.py | 1 + .../providers/google/cloud/links/bigquery.py | 1 + .../google/cloud/links/bigquery_dts.py | 1 + .../google/cloud/links/cloud_memorystore.py | 1 + .../providers/google/cloud/links/cloud_sql.py | 1 + .../google/cloud/links/cloud_tasks.py | 1 + .../providers/google/cloud/links/compute.py | 1 + .../google/cloud/links/datacatalog.py | 1 + .../providers/google/cloud/links/dataflow.py | 1 + .../providers/google/cloud/links/dataform.py | 1 + .../google/cloud/links/datafusion.py | 1 + .../providers/google/cloud/links/dataplex.py | 1 + .../providers/google/cloud/links/dataproc.py | 1 + .../providers/google/cloud/links/mlengine.py | 1 + .../providers/google/cloud/links/pubsub.py | 1 + .../providers/google/cloud/links/spanner.py | 1 + .../google/cloud/links/stackdriver.py | 1 + .../providers/google/cloud/links/workflows.py | 1 + .../cloud/log/stackdriver_task_handler.py | 1 + .../google/cloud/operators/automl.py | 1 + .../google/cloud/operators/bigquery.py | 1 + .../google/cloud/operators/bigquery_dts.py | 1 + .../google/cloud/operators/bigtable.py | 1 + .../google/cloud/operators/cloud_base.py | 1 + .../google/cloud/operators/cloud_build.py | 1 + .../cloud/operators/cloud_memorystore.py | 1 + .../google/cloud/operators/cloud_sql.py | 1 + .../cloud_storage_transfer_service.py | 1 + .../google/cloud/operators/compute.py | 1 + .../google/cloud/operators/dataflow.py | 1 + .../google/cloud/operators/datafusion.py | 1 + .../google/cloud/operators/datapipeline.py | 1 + .../google/cloud/operators/dataprep.py | 1 + .../google/cloud/operators/dataproc.py | 1 + .../cloud/operators/dataproc_metastore.py | 1 + .../google/cloud/operators/datastore.py | 1 + .../google/cloud/operators/functions.py | 1 + .../providers/google/cloud/operators/gcs.py | 1 + .../cloud/operators/kubernetes_engine.py | 1 + .../google/cloud/operators/life_sciences.py | 1 + .../google/cloud/operators/looker.py | 1 + .../cloud/operators/natural_language.py | 1 + .../google/cloud/operators/pubsub.py | 1 + .../google/cloud/operators/spanner.py | 1 + .../google/cloud/operators/speech_to_text.py | 1 + .../google/cloud/operators/text_to_speech.py | 1 + .../google/cloud/operators/translate.py | 1 + .../cloud/operators/translate_speech.py | 1 + .../cloud/operators/vertex_ai/custom_job.py | 1 + .../cloud/operators/vertex_ai/dataset.py | 1 + .../cloud/operators/vertex_ai/pipeline_job.py | 1 + .../cloud/operators/video_intelligence.py | 1 + .../google/cloud/operators/vision.py | 1 + .../google/cloud/secrets/secret_manager.py | 1 + .../google/cloud/sensors/bigquery.py | 1 + .../google/cloud/sensors/bigquery_dts.py | 1 + .../google/cloud/sensors/bigtable.py | 1 + .../sensors/cloud_storage_transfer_service.py | 1 + .../google/cloud/sensors/dataflow.py | 1 + .../google/cloud/sensors/dataform.py | 1 + .../google/cloud/sensors/datafusion.py | 1 + .../google/cloud/sensors/dataplex.py | 1 + .../google/cloud/sensors/dataprep.py | 1 + .../google/cloud/sensors/dataproc.py | 1 + airflow/providers/google/cloud/sensors/gcs.py | 1 + .../providers/google/cloud/sensors/looker.py | 1 + .../providers/google/cloud/sensors/pubsub.py | 1 + .../providers/google/cloud/sensors/tasks.py | 1 + .../cloud/transfers/bigquery_to_bigquery.py | 1 + .../google/cloud/transfers/bigquery_to_gcs.py | 1 + .../cloud/transfers/bigquery_to_mssql.py | 1 + .../cloud/transfers/bigquery_to_mysql.py | 1 + .../cloud/transfers/bigquery_to_postgres.py | 1 + .../google/cloud/transfers/bigquery_to_sql.py | 1 + .../cloud/transfers/facebook_ads_to_gcs.py | 1 + .../google/cloud/transfers/gcs_to_bigquery.py | 1 + .../google/cloud/transfers/gcs_to_gcs.py | 1 + .../google/cloud/transfers/gcs_to_sftp.py | 1 + .../google/cloud/transfers/local_to_gcs.py | 1 + .../google/cloud/transfers/mssql_to_gcs.py | 1 + .../google/cloud/transfers/mysql_to_gcs.py | 1 + .../google/cloud/transfers/postgres_to_gcs.py | 1 + .../google/cloud/transfers/sftp_to_gcs.py | 1 + .../google/cloud/transfers/sql_to_gcs.py | 1 + .../google/cloud/triggers/cloud_sql.py | 1 + .../google/cloud/triggers/dataplex.py | 1 + .../google/cloud/triggers/dataproc.py | 1 + .../providers/google/cloud/triggers/pubsub.py | 1 + .../google/cloud/utils/field_sanitizer.py | 3 +- .../google/cloud/utils/field_validator.py | 1 + .../providers/google/cloud/utils/helpers.py | 1 + .../cloud/utils/mlengine_operator_utils.py | 1 + .../utils/mlengine_prediction_summary.py | 1 + .../google/cloud/utils/openlineage.py | 1 + .../common/auth_backend/google_openid.py | 1 + .../google/common/hooks/base_google.py | 1 + .../google/common/hooks/discovery_api.py | 1 + .../providers/google/common/links/storage.py | 1 + .../common/utils/id_token_credentials.py | 1 + .../google/firebase/hooks/firestore.py | 1 + airflow/providers/google/go_module_utils.py | 1 + .../providers/google/leveldb/hooks/leveldb.py | 1 + .../example_dags/example_display_video.py | 1 + .../hooks/analytics_admin.py | 1 + .../hooks/campaign_manager.py | 1 + .../marketing_platform/hooks/display_video.py | 1 + .../marketing_platform/hooks/search_ads.py | 1 + .../marketing_platform/operators/analytics.py | 1 + .../operators/analytics_admin.py | 1 + .../operators/campaign_manager.py | 1 + .../operators/display_video.py | 1 + .../operators/search_ads.py | 1 + .../sensors/campaign_manager.py | 1 + .../sensors/display_video.py | 1 + .../marketing_platform/sensors/search_ads.py | 1 + .../providers/google/suite/hooks/calendar.py | 1 + airflow/providers/google/suite/hooks/drive.py | 1 + .../providers/google/suite/hooks/sheets.py | 1 + .../providers/google/suite/sensors/drive.py | 1 + .../google/suite/transfers/gcs_to_gdrive.py | 1 + .../google/suite/transfers/local_to_drive.py | 1 + airflow/providers/grpc/hooks/grpc.py | 1 + airflow/providers/hashicorp/hooks/vault.py | 1 + airflow/providers/hashicorp/secrets/vault.py | 1 + airflow/providers/imap/hooks/imap.py | 1 + .../providers/imap/sensors/imap_attachment.py | 1 + airflow/providers/influxdb/hooks/influxdb.py | 1 + .../providers/microsoft/azure/hooks/adx.py | 1 + .../azure/hooks/container_registry.py | 1 + .../providers/microsoft/azure/hooks/cosmos.py | 1 + .../microsoft/azure/hooks/data_factory.py | 1 + .../providers/microsoft/azure/hooks/wasb.py | 1 + .../microsoft/azure/operators/adx.py | 1 + .../microsoft/azure/transfers/sftp_to_wasb.py | 1 + .../providers/microsoft/mssql/hooks/mssql.py | 1 + .../providers/microsoft/winrm/hooks/winrm.py | 1 + airflow/providers/mongo/hooks/mongo.py | 7 ++-- airflow/providers/mysql/hooks/mysql.py | 1 + airflow/providers/neo4j/hooks/neo4j.py | 1 + airflow/providers/odbc/hooks/odbc.py | 1 + .../providers/openlineage/extractors/base.py | 3 +- .../providers/pagerduty/hooks/pagerduty.py | 1 + .../pagerduty/hooks/pagerduty_events.py | 1 + airflow/providers/pinecone/hooks/pinecone.py | 1 + .../presto/transfers/gcs_to_presto.py | 1 + airflow/providers/redis/hooks/redis.py | 1 + .../providers/salesforce/hooks/salesforce.py | 1 + .../providers/samba/transfers/gcs_to_samba.py | 1 + airflow/providers/segment/hooks/segment.py | 1 + airflow/providers/sendgrid/utils/emailer.py | 1 + airflow/providers/sftp/hooks/sftp.py | 1 + airflow/providers/sftp/operators/sftp.py | 1 + airflow/providers/sftp/sensors/sftp.py | 1 + .../slack/notifications/slack_notifier.py | 1 + airflow/providers/smtp/hooks/smtp.py | 1 + .../providers/snowflake/hooks/snowflake.py | 6 ++-- .../transfers/copy_into_snowflake.py | 1 + airflow/providers/ssh/hooks/ssh.py | 1 + airflow/providers/telegram/hooks/telegram.py | 1 + .../providers/telegram/operators/telegram.py | 1 + airflow/providers/teradata/hooks/teradata.py | 1 + airflow/providers/trino/operators/trino.py | 1 + .../providers/trino/transfers/gcs_to_trino.py | 1 + airflow/providers/vertica/hooks/vertica.py | 6 ++-- airflow/providers/yandex/secrets/lockbox.py | 1 + airflow/providers_manager.py | 5 ++- airflow/secrets/__init__.py | 1 + airflow/secrets/environment_variables.py | 1 + airflow/secrets/local_filesystem.py | 1 + airflow/secrets/metastore.py | 1 + airflow/sentry.py | 1 + airflow/serialization/enums.py | 1 + airflow/serialization/helpers.py | 1 + airflow/serialization/json_schema.py | 1 + airflow/serialization/serialized_objects.py | 1 + airflow/task/priority_strategy.py | 1 + airflow/task/task_runner/base_task_runner.py | 1 + .../task/task_runner/cgroup_task_runner.py | 1 + .../task/task_runner/standard_task_runner.py | 1 + airflow/ti_deps/deps/dagrun_backfill_dep.py | 1 + .../ti_deps/deps/pool_slots_available_dep.py | 1 + airflow/ti_deps/deps/task_not_running_dep.py | 1 + airflow/typing_compat.py | 1 + airflow/utils/cli.py | 1 + airflow/utils/cli_action_loggers.py | 1 + airflow/utils/context.py | 1 + airflow/utils/dag_cycle_tester.py | 1 + airflow/utils/db_cleanup.py | 1 + airflow/utils/dot_renderer.py | 1 + airflow/utils/file.py | 6 ++-- airflow/utils/log/colored_log.py | 1 + airflow/utils/log/file_task_handler.py | 1 + airflow/utils/log/json_formatter.py | 1 + airflow/utils/log/secrets_masker.py | 1 + .../log/task_handler_with_custom_formatter.py | 1 + airflow/utils/platform.py | 1 + airflow/utils/process_utils.py | 1 + airflow/utils/python_virtualenv.py | 1 + airflow/utils/retries.py | 6 ++-- airflow/utils/serve_logs.py | 1 + airflow/utils/sqlalchemy.py | 12 +++---- airflow/utils/strings.py | 1 + airflow/utils/task_group.py | 1 + airflow/utils/timezone.py | 24 +++++-------- airflow/utils/weekday.py | 1 + airflow/utils/yaml.py | 1 + ...assign_cherry_picked_prs_with_milestone.py | 3 +- .../src/airflow_breeze/branch_defaults.py | 1 + .../src/airflow_breeze/global_constants.py | 1 + dev/breeze/src/airflow_breeze/utils/cache.py | 1 + .../src/airflow_breeze/utils/console.py | 1 + .../utils/docker_command_utils.py | 1 + .../airflow_breeze/utils/host_info_utils.py | 1 + .../airflow_breeze/utils/md5_build_check.py | 1 + .../src/airflow_breeze/utils/path_utils.py | 1 + .../src/airflow_breeze/utils/run_utils.py | 1 + .../src/airflow_breeze/utils/visuals.py | 1 + dev/chart/build_changelog_annotations.py | 1 + dev/perf/dags/perf_dag_1.py | 1 + dev/perf/dags/perf_dag_2.py | 1 + dev/prepare_bulk_issues.py | 3 +- ...late_statistics_provider_testing_issues.py | 3 +- .../empty_plugin/empty_plugin.py | 1 + docs/build_docs.py | 1 + docs/conf.py | 1 + .../extending/embedding-dags/test_dag.py | 1 + docs/exts/docroles.py | 1 + docs/exts/provider_init_hack.py | 1 + docs/exts/providers_extensions.py | 1 + docs/exts/redirects.py | 1 + docs/exts/removemarktransform.py | 1 + pyproject.toml | 2 +- .../pre_commit_changelog_duplicates.py | 1 + .../pre_commit_check_extra_packages_ref.py | 1 + .../pre_commit_check_integrations_list.py | 1 + ...re_commit_check_order_dockerfile_extras.py | 1 + .../pre_commit_check_order_pyproject_toml.py | 1 + .../pre_commit_check_pre_commit_hooks.py | 1 + .../ci/pre_commit/pre_commit_newsfragments.py | 1 + .../pre_commit_update_chart_dependencies.py | 6 ++-- .../in_container/run_migration_reference.py | 1 + .../in_container/run_prepare_er_diagram.py | 1 + .../endpoints/test_plugin_endpoint.py | 9 ++--- .../schemas/test_plugin_schema.py | 9 ++--- tests/conftest.py | 22 ++++-------- tests/dags/test_issue_1225.py | 1 + tests/dags/test_miscellaneous.py | 1 + tests/dags/test_subdag.py | 1 + tests/dags/test_task_view_type_check.py | 1 + tests/decorators/test_bash.py | 3 +- tests/decorators/test_python.py | 23 +++++------- tests/decorators/test_short_circuit.py | 3 +- tests/decorators/test_task_group.py | 3 +- tests/hooks/test_package_index.py | 1 + tests/jobs/test_backfill_job.py | 18 +++++----- tests/models/test_baseoperator.py | 3 +- tests/models/test_dag.py | 24 +++++-------- tests/models/test_dagrun.py | 36 +++++++------------ tests/models/test_mappedoperator.py | 6 ++-- tests/models/test_renderedtifields.py | 1 + tests/models/test_serialized_dag.py | 1 + tests/models/test_skipmixin.py | 3 +- tests/plugins/workday.py | 1 + .../executors/batch/test_batch_executor.py | 6 ++-- .../aws/executors/ecs/test_ecs_executor.py | 36 +++++++++---------- tests/providers/amazon/aws/hooks/test_s3.py | 8 ++--- .../amazon/aws/operators/test_base_aws.py | 3 +- .../amazon/aws/sensors/test_base_aws.py | 3 +- .../amazon/aws/system/utils/test_helpers.py | 1 + .../amazon/aws/transfers/test_exasol_to_s3.py | 1 + .../amazon/aws/utils/eks_test_constants.py | 1 + .../cncf/kubernetes/hooks/test_kubernetes.py | 3 +- .../elasticsearch/log/test_es_task_handler.py | 3 +- .../cloud/hooks/test_bigquery_system.py | 1 + .../google/cloud/hooks/test_cloud_build.py | 1 + .../providers/google/cloud/hooks/test_dlp.py | 1 + .../google/cloud/hooks/test_life_sciences.py | 1 + .../cloud/operators/test_cloud_build.py | 1 + .../google/cloud/operators/test_cloud_run.py | 1 + .../google/cloud/operators/test_dlp.py | 1 + .../cloud/operators/test_life_sciences.py | 3 +- .../google/firebase/hooks/test_firestore.py | 1 + .../google/suite/hooks/test_calendar.py | 1 + .../google/suite/hooks/test_sheets.py | 1 + .../providers/sendgrid/utils/test_emailer.py | 6 ++-- tests/serialization/test_dag_serialization.py | 1 + .../airbyte/example_airbyte_trigger_job.py | 1 + .../aws/example_google_api_sheets_to_s3.py | 1 + .../aws/example_google_api_youtube_to_s3.py | 1 + .../amazon/aws/example_hive_to_dynamodb.py | 7 ++-- .../aws/example_imap_attachment_to_s3.py | 1 + .../amazon/aws/example_salesforce_to_s3.py | 1 + .../providers/apache/beam/example_beam.py | 1 + .../apache/beam/example_beam_java_flink.py | 1 + .../apache/beam/example_beam_java_spark.py | 1 + .../providers/apache/beam/example_go.py | 1 + .../apache/beam/example_go_dataflow.py | 1 + .../apache/beam/example_java_dataflow.py | 1 + .../providers/apache/beam/example_python.py | 1 + .../apache/beam/example_python_async.py | 1 + .../apache/beam/example_python_dataflow.py | 1 + tests/system/providers/apache/beam/utils.py | 1 + .../apache/cassandra/example_cassandra_dag.py | 1 + .../apache/drill/example_drill_dag.py | 1 + .../apache/druid/example_druid_dag.py | 1 + .../apache/hive/example_twitter_dag.py | 1 + .../apache/kylin/example_kylin_dag.py | 1 + .../providers/apache/livy/example_livy.py | 1 + .../providers/apache/pig/example_pig.py | 1 + .../apache/spark/example_spark_dag.py | 1 + tests/system/providers/asana/example_asana.py | 1 + .../cncf/kubernetes/example_kubernetes.py | 1 + .../cncf/kubernetes/example_kubernetes_job.py | 1 + .../kubernetes/example_kubernetes_resource.py | 1 + .../kubernetes/example_spark_kubernetes.py | 1 + .../databricks/example_databricks.py | 1 + .../databricks/example_databricks_sql.py | 1 + .../providers/dingding/example_dingding.py | 1 + .../docker/example_docker_copy_data.py | 1 + .../example_elasticsearch_query.py | 1 + tests/system/providers/ftp/example_ftp.py | 1 + .../providers/google/ads/example_ads.py | 1 + .../cloud/automl/example_automl_dataset.py | 1 + .../cloud/automl/example_automl_model.py | 1 + .../example_automl_nl_text_classification.py | 1 + .../example_automl_nl_text_extraction.py | 1 + .../example_automl_nl_text_sentiment.py | 1 + .../automl/example_automl_translation.py | 1 + .../example_automl_video_classification.py | 1 + .../automl/example_automl_video_tracking.py | 1 + .../example_automl_vision_classification.py | 1 + .../example_automl_vision_object_detection.py | 1 + .../bigquery/example_bigquery_dataset.py | 1 + .../cloud/bigquery/example_bigquery_dts.py | 1 + .../bigquery/example_bigquery_operations.py | 1 + .../example_bigquery_operations_location.py | 1 + .../bigquery/example_bigquery_queries.py | 1 + .../example_bigquery_queries_async.py | 1 + .../bigquery/example_bigquery_sensors.py | 1 + .../cloud/bigquery/example_bigquery_tables.py | 1 + .../bigquery/example_bigquery_to_bigquery.py | 1 + .../cloud/bigquery/example_bigquery_to_gcs.py | 1 + .../bigquery/example_bigquery_to_gcs_async.py | 1 + .../bigquery/example_bigquery_to_mssql.py | 1 + .../bigquery/example_bigquery_to_mysql.py | 1 + .../bigquery/example_bigquery_to_postgres.py | 1 + .../bigquery/example_bigquery_transfer.py | 1 + .../google/cloud/bigtable/example_bigtable.py | 1 + .../cloud/cloud_batch/example_cloud_batch.py | 1 + .../cloud/cloud_build/example_cloud_build.py | 1 + .../example_cloud_build_trigger.py | 1 + .../example_cloud_memorystore_memcached.py | 1 + .../example_cloud_memorystore_redis.py | 1 + .../cloud/cloud_run/example_cloud_run.py | 1 + .../cloud/cloud_sql/example_cloud_sql.py | 1 + .../example_cloud_sql_query_mysql.py | 1 + .../example_cloud_sql_query_postgres.py | 1 + .../cloud/compute/example_compute_igm.py | 1 + .../cloud/dataflow/example_dataflow_go.py | 1 + .../dataflow/example_dataflow_native_java.py | 1 + .../example_dataflow_native_python.py | 1 + .../example_dataflow_native_python_async.py | 1 + .../cloud/dataflow/example_dataflow_sql.py | 1 + .../example_dataflow_streaming_python.py | 1 + .../dataflow/example_dataflow_template.py | 1 + .../google/cloud/dataform/example_dataform.py | 1 + .../cloud/datafusion/example_datafusion.py | 1 + .../datapipelines/example_datapipeline.py | 1 + .../google/cloud/dataplex/example_dataplex.py | 1 + .../cloud/dataplex/example_dataplex_dp.py | 1 + .../cloud/dataplex/example_dataplex_dq.py | 1 + .../google/cloud/dataprep/example_dataprep.py | 1 + .../cloud/dataproc/example_dataproc_batch.py | 1 + .../example_dataproc_batch_deferrable.py | 1 + .../example_dataproc_batch_persistent.py | 1 + ...cluster_create_existing_stopped_cluster.py | 1 + .../example_dataproc_cluster_deferrable.py | 1 + .../example_dataproc_cluster_diagnose.py | 1 + .../example_dataproc_cluster_generator.py | 1 + .../example_dataproc_cluster_start_stop.py | 1 + .../example_dataproc_cluster_update.py | 1 + .../cloud/dataproc/example_dataproc_gke.py | 1 + .../cloud/dataproc/example_dataproc_hadoop.py | 1 + .../cloud/dataproc/example_dataproc_hive.py | 1 + .../cloud/dataproc/example_dataproc_pig.py | 1 + .../cloud/dataproc/example_dataproc_presto.py | 1 + .../dataproc/example_dataproc_pyspark.py | 1 + .../cloud/dataproc/example_dataproc_spark.py | 1 + .../dataproc/example_dataproc_spark_async.py | 1 + .../example_dataproc_spark_deferrable.py | 1 + .../dataproc/example_dataproc_spark_sql.py | 1 + .../cloud/dataproc/example_dataproc_sparkr.py | 1 + .../cloud/dataproc/example_dataproc_trino.py | 1 + .../dataproc/example_dataproc_workflow.py | 1 + .../example_dataproc_workflow_deferrable.py | 1 + .../example_dataproc_metastore.py | 1 + .../example_dataproc_metastore_backup.py | 1 + ...ataproc_metastore_hive_partition_sensor.py | 1 + .../datastore/example_datastore_commit.py | 1 + .../datastore/example_datastore_query.py | 1 + .../datastore/example_datastore_rollback.py | 1 + .../google/cloud/gcs/example_firestore.py | 1 + .../google/cloud/gcs/example_gcs_acl.py | 1 + .../cloud/gcs/example_gcs_copy_delete.py | 1 + .../google/cloud/gcs/example_gcs_sensor.py | 1 + .../cloud/gcs/example_gcs_to_bigquery.py | 1 + .../gcs/example_gcs_to_bigquery_async.py | 1 + .../google/cloud/gcs/example_gcs_to_gcs.py | 1 + .../google/cloud/gcs/example_gcs_to_gdrive.py | 1 + .../google/cloud/gcs/example_gcs_transform.py | 1 + .../gcs/example_gcs_transform_timespan.py | 1 + .../cloud/gcs/example_gcs_upload_download.py | 1 + .../google/cloud/gcs/example_mysql_to_gcs.py | 1 + .../google/cloud/gcs/example_sftp_to_gcs.py | 1 + .../google/cloud/gcs/example_trino_to_gcs.py | 1 + .../example_kubernetes_engine.py | 1 + .../example_kubernetes_engine_async.py | 1 + .../example_kubernetes_engine_job.py | 1 + .../example_kubernetes_engine_kueue.py | 1 + .../example_kubernetes_engine_resource.py | 1 + .../cloud/ml_engine/example_mlengine.py | 1 + .../example_natural_language.py | 1 + .../google/cloud/pubsub/example_pubsub.py | 1 + .../cloud/pubsub/example_pubsub_deferrable.py | 1 + .../google/cloud/spanner/example_spanner.py | 1 + .../sql_to_sheets/example_sql_to_sheets.py | 1 + .../cloud/stackdriver/example_stackdriver.py | 1 + ...mple_cloud_storage_transfer_service_aws.py | 1 + .../google/cloud/tasks/example_queue.py | 1 + .../google/cloud/tasks/example_tasks.py | 1 + .../cloud/transfers/example_gcs_to_sftp.py | 1 + .../transfers/example_gdrive_to_local.py | 1 + .../transfers/example_postgres_to_gcs.py | 1 + .../cloud/translate/example_translate.py | 1 + ..._vertex_ai_auto_ml_forecasting_training.py | 1 + ...xample_vertex_ai_auto_ml_image_training.py | 1 + ...example_vertex_ai_auto_ml_list_training.py | 1 + ...mple_vertex_ai_auto_ml_tabular_training.py | 1 + ...example_vertex_ai_auto_ml_text_training.py | 1 + ...xample_vertex_ai_auto_ml_video_training.py | 1 + .../example_vertex_ai_batch_prediction_job.py | 1 + .../example_vertex_ai_custom_container.py | 1 + .../vertex_ai/example_vertex_ai_custom_job.py | 1 + ...ple_vertex_ai_custom_job_python_package.py | 1 + .../vertex_ai/example_vertex_ai_dataset.py | 1 + .../vertex_ai/example_vertex_ai_endpoint.py | 1 + .../example_vertex_ai_generative_model.py | 1 + ...ple_vertex_ai_hyperparameter_tuning_job.py | 1 + .../example_vertex_ai_list_custom_jobs.py | 1 + .../example_vertex_ai_model_service.py | 1 + .../example_vertex_ai_pipeline_job.py | 1 + .../google/leveldb/example_leveldb.py | 1 + .../marketing_platform/example_analytics.py | 1 + .../example_analytics_admin.py | 1 + .../example_campaign_manager.py | 1 + .../marketing_platform/example_search_ads.py | 1 + .../google/suite/example_local_to_drive.py | 1 + tests/system/providers/http/example_http.py | 1 + .../providers/jdbc/example_jdbc_queries.py | 1 + .../azure/example_azure_batch_operator.py | 1 + .../example_azure_container_instances.py | 1 + .../microsoft/azure/example_azure_cosmosdb.py | 1 + .../microsoft/azure/example_wasb_sensors.py | 1 + .../microsoft/mssql/example_mssql.py | 1 + .../microsoft/winrm/example_winrm.py | 1 + tests/system/providers/mysql/example_mysql.py | 1 + tests/system/providers/neo4j/example_neo4j.py | 1 + tests/system/providers/papermill/conftest.py | 6 ++-- .../providers/papermill/example_papermill.py | 1 + .../example_papermill_remote_verify.py | 1 + .../papermill/example_papermill_verify.py | 1 + .../providers/presto/example_gcs_to_presto.py | 1 + .../providers/redis/example_redis_publish.py | 1 + .../providers/samba/example_gcs_to_samba.py | 1 + .../providers/slack/example_sql_to_slack.py | 1 + .../slack/example_sql_to_slack_webhook.py | 1 + .../snowflake/example_copy_into_snowflake.py | 1 + .../providers/snowflake/example_snowflake.py | 1 + .../system/providers/sqlite/example_sqlite.py | 1 + .../providers/tableau/example_tableau.py | 1 + .../providers/telegram/example_telegram.py | 1 + .../teradata/example_ssl_teradata.py | 1 + .../providers/teradata/example_teradata.py | 1 + .../example_teradata_to_teradata_transfer.py | 1 + .../providers/trino/example_gcs_to_trino.py | 1 + tests/system/providers/trino/example_trino.py | 1 + tests/test_utils/get_all_tests.py | 1 + .../remote_user_api_auth_backend.py | 1 + tests/utils/log/test_json_formatter.py | 1 + tests/utils/test_orm_event_handlers.py | 1 + tests/utils/test_task_group.py | 36 +++++++------------ 773 files changed, 904 insertions(+), 306 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 39a0ed246eff9..4486b435b681a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -338,7 +338,7 @@ repos: types_or: [python, pyi] args: [--fix] require_serial: true - additional_dependencies: ["ruff==0.2.1"] + additional_dependencies: ["ruff==0.3.3"] exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py - id: ruff-format name: Run 'ruff format' for extremely fast Python formatting @@ -348,7 +348,7 @@ repos: types_or: [python, pyi] args: [] require_serial: true - additional_dependencies: ["ruff==0.2.1"] + additional_dependencies: ["ruff==0.3.3"] exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py|^airflow/contrib/ - id: replace-bad-characters name: Replace bad characters diff --git a/airflow/__main__.py b/airflow/__main__.py index 6f82f7536026b..bfebc63946ef6 100644 --- a/airflow/__main__.py +++ b/airflow/__main__.py @@ -18,6 +18,7 @@ # specific language governing permissions and limitations # under the License. """Main executable module.""" + from __future__ import annotations import os diff --git a/airflow/api/__init__.py b/airflow/api/__init__.py index a58caea9fd8fb..d0613bb651faa 100644 --- a/airflow/api/__init__.py +++ b/airflow/api/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Authentication backend.""" + from __future__ import annotations import logging diff --git a/airflow/api/auth/backend/basic_auth.py b/airflow/api/auth/backend/basic_auth.py index 1b793534319ed..382b9a95982cc 100644 --- a/airflow/api/auth/backend/basic_auth.py +++ b/airflow/api/auth/backend/basic_auth.py @@ -19,6 +19,7 @@ Please use :mod:`airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead. """ + from __future__ import annotations import warnings diff --git a/airflow/api/auth/backend/default.py b/airflow/api/auth/backend/default.py index b1d8f9bcf2674..afe2c88f35f0c 100644 --- a/airflow/api/auth/backend/default.py +++ b/airflow/api/auth/backend/default.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Default authentication backend - everything is allowed.""" + from __future__ import annotations from functools import wraps diff --git a/airflow/api/auth/backend/deny_all.py b/airflow/api/auth/backend/deny_all.py index 29b23f8d73b5a..8f7132cbdf304 100644 --- a/airflow/api/auth/backend/deny_all.py +++ b/airflow/api/auth/backend/deny_all.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Authentication backend that denies all requests.""" + from __future__ import annotations from functools import wraps diff --git a/airflow/api/auth/backend/session.py b/airflow/api/auth/backend/session.py index ef914b57e4420..d51f7bf1cf4c9 100644 --- a/airflow/api/auth/backend/session.py +++ b/airflow/api/auth/backend/session.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Session authentication backend.""" + from __future__ import annotations from functools import wraps diff --git a/airflow/api/client/__init__.py b/airflow/api/client/__init__.py index 26b0fa31f288e..18edd05abd701 100644 --- a/airflow/api/client/__init__.py +++ b/airflow/api/client/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """API Client that allows interacting with Airflow API.""" + from __future__ import annotations from importlib import import_module diff --git a/airflow/api/client/api_client.py b/airflow/api/client/api_client.py index d4a6d2357a8bf..42f54562a2dd7 100644 --- a/airflow/api/client/api_client.py +++ b/airflow/api/client/api_client.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Client for all the API clients.""" + from __future__ import annotations import httpx diff --git a/airflow/api/client/json_client.py b/airflow/api/client/json_client.py index ac73813136544..b1e0124c865ae 100644 --- a/airflow/api/client/json_client.py +++ b/airflow/api/client/json_client.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """JSON API Client.""" + from __future__ import annotations from urllib.parse import urljoin diff --git a/airflow/api/client/local_client.py b/airflow/api/client/local_client.py index d8b95650998e1..4fd0754218ec1 100644 --- a/airflow/api/client/local_client.py +++ b/airflow/api/client/local_client.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Local client API.""" + from __future__ import annotations from airflow.api.client import api_client diff --git a/airflow/api/common/delete_dag.py b/airflow/api/common/delete_dag.py index 8af05056a72af..4452e2726f934 100644 --- a/airflow/api/common/delete_dag.py +++ b/airflow/api/common/delete_dag.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Delete DAGs APIs.""" + from __future__ import annotations import logging diff --git a/airflow/api/common/experimental/__init__.py b/airflow/api/common/experimental/__init__.py index e8f5548c4e629..1f0f0bc67db85 100644 --- a/airflow/api/common/experimental/__init__.py +++ b/airflow/api/common/experimental/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Experimental APIs.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/api/common/experimental/delete_dag.py b/airflow/api/common/experimental/delete_dag.py index 2dddd1265bbfe..402b4cac7b1a3 100644 --- a/airflow/api/common/experimental/delete_dag.py +++ b/airflow/api/common/experimental/delete_dag.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module is deprecated. Please use :mod:`airflow.api.common.delete_dag` instead.""" + from __future__ import annotations import warnings diff --git a/airflow/api/common/experimental/get_code.py b/airflow/api/common/experimental/get_code.py index b74ed036ccadc..f618690a92120 100644 --- a/airflow/api/common/experimental/get_code.py +++ b/airflow/api/common/experimental/get_code.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Get code APIs.""" + from __future__ import annotations from deprecated import deprecated diff --git a/airflow/api/common/experimental/get_dag_run_state.py b/airflow/api/common/experimental/get_dag_run_state.py index fe246e8f77c21..8905aa4f0412c 100644 --- a/airflow/api/common/experimental/get_dag_run_state.py +++ b/airflow/api/common/experimental/get_dag_run_state.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """DAG run APIs.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/api/common/experimental/get_dag_runs.py b/airflow/api/common/experimental/get_dag_runs.py index 2761bb45fd2cd..856214bd02cff 100644 --- a/airflow/api/common/experimental/get_dag_runs.py +++ b/airflow/api/common/experimental/get_dag_runs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """DAG runs APIs.""" + from __future__ import annotations from typing import Any diff --git a/airflow/api/common/experimental/get_lineage.py b/airflow/api/common/experimental/get_lineage.py index 49665eba3915a..d361ae66f3097 100644 --- a/airflow/api/common/experimental/get_lineage.py +++ b/airflow/api/common/experimental/get_lineage.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Lineage APIs.""" + from __future__ import annotations from collections import defaultdict diff --git a/airflow/api/common/experimental/get_task.py b/airflow/api/common/experimental/get_task.py index 8e1c4f641db9e..6bc58d0328819 100644 --- a/airflow/api/common/experimental/get_task.py +++ b/airflow/api/common/experimental/get_task.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Task APIs.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/api/common/experimental/get_task_instance.py b/airflow/api/common/experimental/get_task_instance.py index d77450f65d502..8a22e2c24ec76 100644 --- a/airflow/api/common/experimental/get_task_instance.py +++ b/airflow/api/common/experimental/get_task_instance.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Task instance APIs.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/api/common/experimental/mark_tasks.py b/airflow/api/common/experimental/mark_tasks.py index 97e56f313dd6d..753db8947f136 100644 --- a/airflow/api/common/experimental/mark_tasks.py +++ b/airflow/api/common/experimental/mark_tasks.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Task Instance APIs. This module is deprecated. Please use :mod:`airflow.api.common.mark_tasks` instead.""" + from __future__ import annotations import warnings diff --git a/airflow/api/common/experimental/pool.py b/airflow/api/common/experimental/pool.py index 87adacdd76fb7..cfa1ffcc71873 100644 --- a/airflow/api/common/experimental/pool.py +++ b/airflow/api/common/experimental/pool.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Pool APIs.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/api/common/experimental/trigger_dag.py b/airflow/api/common/experimental/trigger_dag.py index 8e9d0e146219b..c65b8a57c593d 100644 --- a/airflow/api/common/experimental/trigger_dag.py +++ b/airflow/api/common/experimental/trigger_dag.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module is deprecated. Please use :mod:`airflow.api.common.trigger_dag` instead.""" + from __future__ import annotations import warnings diff --git a/airflow/api/common/mark_tasks.py b/airflow/api/common/mark_tasks.py index a175a61e207ea..a9d8325e5ba64 100644 --- a/airflow/api/common/mark_tasks.py +++ b/airflow/api/common/mark_tasks.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Marks tasks APIs.""" + from __future__ import annotations from typing import TYPE_CHECKING, Collection, Iterable, Iterator, NamedTuple diff --git a/airflow/api/common/trigger_dag.py b/airflow/api/common/trigger_dag.py index 231a3007568e2..ee54f8622c7a3 100644 --- a/airflow/api/common/trigger_dag.py +++ b/airflow/api/common/trigger_dag.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Triggering DAG runs APIs.""" + from __future__ import annotations import json diff --git a/airflow/auth/managers/fab/api/auth/backend/basic_auth.py b/airflow/auth/managers/fab/api/auth/backend/basic_auth.py index 1b793534319ed..382b9a95982cc 100644 --- a/airflow/auth/managers/fab/api/auth/backend/basic_auth.py +++ b/airflow/auth/managers/fab/api/auth/backend/basic_auth.py @@ -19,6 +19,7 @@ Please use :mod:`airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead. """ + from __future__ import annotations import warnings diff --git a/airflow/auth/managers/fab/api/auth/backend/kerberos_auth.py b/airflow/auth/managers/fab/api/auth/backend/kerberos_auth.py index 282dd04da691e..838e5409f29e1 100644 --- a/airflow/auth/managers/fab/api/auth/backend/kerberos_auth.py +++ b/airflow/auth/managers/fab/api/auth/backend/kerberos_auth.py @@ -20,6 +20,7 @@ Please use :mod:`airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead. """ + from __future__ import annotations import warnings diff --git a/airflow/auth/managers/models/base_user.py b/airflow/auth/managers/models/base_user.py index 93163ee06d009..ca59fe3d0c5d6 100644 --- a/airflow/auth/managers/models/base_user.py +++ b/airflow/auth/managers/models/base_user.py @@ -28,9 +28,7 @@ def is_active(self) -> bool: return True @abstractmethod - def get_id(self) -> str: - ... + def get_id(self) -> str: ... @abstractmethod - def get_name(self) -> str: - ... + def get_name(self) -> str: ... diff --git a/airflow/cli/commands/celery_command.py b/airflow/cli/commands/celery_command.py index 56c8d4330358a..ae8b9c1925634 100644 --- a/airflow/cli/commands/celery_command.py +++ b/airflow/cli/commands/celery_command.py @@ -20,6 +20,7 @@ # DO NOT MODIFY THIS FILE unless it is a serious bugfix - all the new celery commands should be added in celery provider. # This file is kept for backward compatibility only. """Celery command.""" + from __future__ import annotations import logging diff --git a/airflow/cli/commands/config_command.py b/airflow/cli/commands/config_command.py index ed18ee9d9d9b0..f159723764093 100644 --- a/airflow/cli/commands/config_command.py +++ b/airflow/cli/commands/config_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Config sub-commands.""" + from __future__ import annotations from io import StringIO diff --git a/airflow/cli/commands/connection_command.py b/airflow/cli/commands/connection_command.py index e279faf48cef5..2bc1076f2b4c9 100644 --- a/airflow/cli/commands/connection_command.py +++ b/airflow/cli/commands/connection_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Connection sub-commands.""" + from __future__ import annotations import json diff --git a/airflow/cli/commands/dag_command.py b/airflow/cli/commands/dag_command.py index d307cb45392a5..c36b30bd70886 100644 --- a/airflow/cli/commands/dag_command.py +++ b/airflow/cli/commands/dag_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Dag sub-commands.""" + from __future__ import annotations import ast diff --git a/airflow/cli/commands/dag_processor_command.py b/airflow/cli/commands/dag_processor_command.py index 592be93f3f23e..14deee6770284 100644 --- a/airflow/cli/commands/dag_processor_command.py +++ b/airflow/cli/commands/dag_processor_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """DagProcessor command.""" + from __future__ import annotations import logging diff --git a/airflow/cli/commands/db_command.py b/airflow/cli/commands/db_command.py index 3fd7cda4de609..184496df428f9 100644 --- a/airflow/cli/commands/db_command.py +++ b/airflow/cli/commands/db_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Database sub-commands.""" + from __future__ import annotations import logging diff --git a/airflow/cli/commands/info_command.py b/airflow/cli/commands/info_command.py index 83c62f71886a9..2b4963179ee32 100644 --- a/airflow/cli/commands/info_command.py +++ b/airflow/cli/commands/info_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Config sub-commands.""" + from __future__ import annotations import locale diff --git a/airflow/cli/commands/internal_api_command.py b/airflow/cli/commands/internal_api_command.py index 7094cca11bbc1..00a5c4b840246 100644 --- a/airflow/cli/commands/internal_api_command.py +++ b/airflow/cli/commands/internal_api_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Internal API command.""" + from __future__ import annotations import logging diff --git a/airflow/cli/commands/kerberos_command.py b/airflow/cli/commands/kerberos_command.py index dd7bb1aee37d8..827f2d6a9d062 100644 --- a/airflow/cli/commands/kerberos_command.py +++ b/airflow/cli/commands/kerberos_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Kerberos command.""" + from __future__ import annotations from airflow import settings diff --git a/airflow/cli/commands/kubernetes_command.py b/airflow/cli/commands/kubernetes_command.py index 2d9a488ebbc5e..e05d5d2326321 100644 --- a/airflow/cli/commands/kubernetes_command.py +++ b/airflow/cli/commands/kubernetes_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Kubernetes sub-commands.""" + from __future__ import annotations import os diff --git a/airflow/cli/commands/pool_command.py b/airflow/cli/commands/pool_command.py index 13386d6fbe8b6..4856a6a4bc384 100644 --- a/airflow/cli/commands/pool_command.py +++ b/airflow/cli/commands/pool_command.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Pools sub-commands.""" + from __future__ import annotations import json diff --git a/airflow/cli/commands/provider_command.py b/airflow/cli/commands/provider_command.py index 4eeb4bff39f98..637a8ce189af3 100644 --- a/airflow/cli/commands/provider_command.py +++ b/airflow/cli/commands/provider_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Providers sub-commands.""" + from __future__ import annotations import sys diff --git a/airflow/cli/commands/rotate_fernet_key_command.py b/airflow/cli/commands/rotate_fernet_key_command.py index 1a47a29e3149a..590aed3aff147 100644 --- a/airflow/cli/commands/rotate_fernet_key_command.py +++ b/airflow/cli/commands/rotate_fernet_key_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Rotate Fernet key command.""" + from __future__ import annotations from sqlalchemy import select diff --git a/airflow/cli/commands/scheduler_command.py b/airflow/cli/commands/scheduler_command.py index ed51381a219f2..0b5cac8857caa 100644 --- a/airflow/cli/commands/scheduler_command.py +++ b/airflow/cli/commands/scheduler_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Scheduler command.""" + from __future__ import annotations import logging diff --git a/airflow/cli/commands/task_command.py b/airflow/cli/commands/task_command.py index 0309fa1bf56f1..a0dead92e6436 100644 --- a/airflow/cli/commands/task_command.py +++ b/airflow/cli/commands/task_command.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Task sub-commands.""" + from __future__ import annotations import functools @@ -513,8 +514,7 @@ def task_list(args, dag: DAG | None = None) -> None: class _SupportedDebugger(Protocol): - def post_mortem(self) -> None: - ... + def post_mortem(self) -> None: ... SUPPORTED_DEBUGGER_MODULES = [ diff --git a/airflow/cli/commands/triggerer_command.py b/airflow/cli/commands/triggerer_command.py index 3479480dbf8ac..eba4328e7e702 100644 --- a/airflow/cli/commands/triggerer_command.py +++ b/airflow/cli/commands/triggerer_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Triggerer command.""" + from __future__ import annotations from contextlib import contextmanager diff --git a/airflow/cli/commands/variable_command.py b/airflow/cli/commands/variable_command.py index 3dd920eb0c87f..489168a5bbd36 100644 --- a/airflow/cli/commands/variable_command.py +++ b/airflow/cli/commands/variable_command.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Variable subcommands.""" + from __future__ import annotations import json diff --git a/airflow/cli/commands/version_command.py b/airflow/cli/commands/version_command.py index 81f56f3062135..2062ef868cee4 100644 --- a/airflow/cli/commands/version_command.py +++ b/airflow/cli/commands/version_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Version command.""" + from __future__ import annotations import airflow diff --git a/airflow/cli/commands/webserver_command.py b/airflow/cli/commands/webserver_command.py index 4cb7939fd7fb5..4285564e1fd17 100644 --- a/airflow/cli/commands/webserver_command.py +++ b/airflow/cli/commands/webserver_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Webserver command.""" + from __future__ import annotations import logging diff --git a/airflow/config_templates/airflow_local_settings.py b/airflow/config_templates/airflow_local_settings.py index 0c29714e56228..02cbfdcfa15ca 100644 --- a/airflow/config_templates/airflow_local_settings.py +++ b/airflow/config_templates/airflow_local_settings.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Airflow logging settings.""" + from __future__ import annotations import os diff --git a/airflow/config_templates/default_webserver_config.py b/airflow/config_templates/default_webserver_config.py index 5522c0676b26c..3048bb21f4d59 100644 --- a/airflow/config_templates/default_webserver_config.py +++ b/airflow/config_templates/default_webserver_config.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Default configuration for the Airflow webserver.""" + from __future__ import annotations import os diff --git a/airflow/configuration.py b/airflow/configuration.py index 9d4bca54feb67..096a36c103eb7 100644 --- a/airflow/configuration.py +++ b/airflow/configuration.py @@ -80,13 +80,11 @@ def _parse_sqlite_version(s: str) -> tuple[int, ...]: @overload -def expand_env_var(env_var: None) -> None: - ... +def expand_env_var(env_var: None) -> None: ... @overload -def expand_env_var(env_var: str) -> str: - ... +def expand_env_var(env_var: str) -> str: ... def expand_env_var(env_var: str | None) -> str | None: @@ -929,12 +927,10 @@ def get_mandatory_list_value(self, section: str, key: str, **kwargs) -> list[str return value @overload # type: ignore[override] - def get(self, section: str, key: str, fallback: str = ..., **kwargs) -> str: - ... + def get(self, section: str, key: str, fallback: str = ..., **kwargs) -> str: ... @overload # type: ignore[override] - def get(self, section: str, key: str, **kwargs) -> str | None: - ... + def get(self, section: str, key: str, **kwargs) -> str | None: ... def get( # type: ignore[override,misc] self, diff --git a/airflow/contrib/hooks/__init__.py b/airflow/contrib/hooks/__init__.py index 63306a5ec3b42..fa26b735c9f79 100644 --- a/airflow/contrib/hooks/__init__.py +++ b/airflow/contrib/hooks/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This package is deprecated. Please use `airflow.hooks` or `airflow.providers.*.hooks`.""" + from __future__ import annotations import warnings diff --git a/airflow/contrib/operators/__init__.py b/airflow/contrib/operators/__init__.py index c2df41430174f..aa25423f30510 100644 --- a/airflow/contrib/operators/__init__.py +++ b/airflow/contrib/operators/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This package is deprecated. Please use `airflow.operators` or `airflow.providers.*.operators`.""" + from __future__ import annotations import warnings diff --git a/airflow/contrib/secrets/__init__.py b/airflow/contrib/secrets/__init__.py index d97107bfed13b..29d4c0acca6bf 100644 --- a/airflow/contrib/secrets/__init__.py +++ b/airflow/contrib/secrets/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This package is deprecated. Please use :mod:`airflow.secrets` or `airflow.providers.*.secrets`.""" + from __future__ import annotations import warnings diff --git a/airflow/contrib/sensors/__init__.py b/airflow/contrib/sensors/__init__.py index 811263de75912..0121f47d29128 100644 --- a/airflow/contrib/sensors/__init__.py +++ b/airflow/contrib/sensors/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This package is deprecated. Please use `airflow.sensors` or `airflow.providers.*.sensors`.""" + from __future__ import annotations import warnings diff --git a/airflow/contrib/task_runner/__init__.py b/airflow/contrib/task_runner/__init__.py index 88257f1cba91a..ddb67e168037e 100644 --- a/airflow/contrib/task_runner/__init__.py +++ b/airflow/contrib/task_runner/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This package is deprecated. Please use :mod:`airflow.task.task_runner`.""" + from __future__ import annotations import warnings diff --git a/airflow/contrib/utils/__init__.py b/airflow/contrib/utils/__init__.py index 0202a1c7c13d2..ff5d2a9948808 100644 --- a/airflow/contrib/utils/__init__.py +++ b/airflow/contrib/utils/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This package is deprecated. Please use :mod:`airflow.utils`.""" + from __future__ import annotations import warnings diff --git a/airflow/contrib/utils/log/__init__.py b/airflow/contrib/utils/log/__init__.py index e6af71dfefb71..979d9ecc72d77 100644 --- a/airflow/contrib/utils/log/__init__.py +++ b/airflow/contrib/utils/log/__init__.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This package is deprecated. Please use :mod:`airflow.utils.log`.""" + from __future__ import annotations import warnings diff --git a/airflow/dag_processing/manager.py b/airflow/dag_processing/manager.py index 76845d1790383..71f25b16acd17 100644 --- a/airflow/dag_processing/manager.py +++ b/airflow/dag_processing/manager.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Processes DAGs.""" + from __future__ import annotations import enum diff --git a/airflow/decorators/base.py b/airflow/decorators/base.py index 51ebbce29c24c..0b0d921f8cac2 100644 --- a/airflow/decorators/base.py +++ b/airflow/decorators/base.py @@ -314,8 +314,7 @@ def _infer_multiple_outputs(self): try: # We only care about the return annotation, not anything about the parameters - def fake(): - ... + def fake(): ... fake.__annotations__ = {"return": self.function.__annotations__["return"]} @@ -559,20 +558,15 @@ class Task(Protocol, Generic[FParams, FReturn]): function: Callable[FParams, FReturn] @property - def __wrapped__(self) -> Callable[FParams, FReturn]: - ... + def __wrapped__(self) -> Callable[FParams, FReturn]: ... - def partial(self, **kwargs: Any) -> Task[FParams, FReturn]: - ... + def partial(self, **kwargs: Any) -> Task[FParams, FReturn]: ... - def expand(self, **kwargs: OperatorExpandArgument) -> XComArg: - ... + def expand(self, **kwargs: OperatorExpandArgument) -> XComArg: ... - def expand_kwargs(self, kwargs: OperatorExpandKwargsArgument, *, strict: bool = True) -> XComArg: - ... + def expand_kwargs(self, kwargs: OperatorExpandKwargsArgument, *, strict: bool = True) -> XComArg: ... - def override(self, **kwargs: Any) -> Task[FParams, FReturn]: - ... + def override(self, **kwargs: Any) -> Task[FParams, FReturn]: ... class TaskDecorator(Protocol): @@ -594,8 +588,7 @@ def __call__( ) -> Callable[[Callable[FParams, FReturn]], Task[FParams, FReturn]]: """For the decorator factory ``@task()`` case.""" - def override(self, **kwargs: Any) -> Task[FParams, FReturn]: - ... + def override(self, **kwargs: Any) -> Task[FParams, FReturn]: ... def task_decorator_factory( diff --git a/airflow/decorators/task_group.py b/airflow/decorators/task_group.py index 30aafc4e9e3e2..d347f9e6eb7da 100644 --- a/airflow/decorators/task_group.py +++ b/airflow/decorators/task_group.py @@ -186,14 +186,12 @@ def task_group( ui_color: str = "CornflowerBlue", ui_fgcolor: str = "#000", add_suffix_on_collision: bool = False, -) -> Callable[[Callable[FParams, FReturn]], _TaskGroupFactory[FParams, FReturn]]: - ... +) -> Callable[[Callable[FParams, FReturn]], _TaskGroupFactory[FParams, FReturn]]: ... # This covers the @task_group case (no parentheses). @overload -def task_group(python_callable: Callable[FParams, FReturn]) -> _TaskGroupFactory[FParams, FReturn]: - ... +def task_group(python_callable: Callable[FParams, FReturn]) -> _TaskGroupFactory[FParams, FReturn]: ... def task_group(python_callable=None, **tg_kwargs): diff --git a/airflow/example_dags/example_bash_operator.py b/airflow/example_dags/example_bash_operator.py index 781a8408943da..4d45d9114fd8f 100644 --- a/airflow/example_dags/example_bash_operator.py +++ b/airflow/example_dags/example_bash_operator.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the BashOperator.""" + from __future__ import annotations import datetime diff --git a/airflow/example_dags/example_branch_datetime_operator.py b/airflow/example_dags/example_branch_datetime_operator.py index 5b13c007f583f..d24dd6cde4411 100644 --- a/airflow/example_dags/example_branch_datetime_operator.py +++ b/airflow/example_dags/example_branch_datetime_operator.py @@ -19,6 +19,7 @@ Example DAG demonstrating the usage of DateTimeBranchOperator with datetime as well as time objects as targets. """ + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_branch_day_of_week_operator.py b/airflow/example_dags/example_branch_day_of_week_operator.py index 1699e3c01ea7b..c532ad712ca8d 100644 --- a/airflow/example_dags/example_branch_day_of_week_operator.py +++ b/airflow/example_dags/example_branch_day_of_week_operator.py @@ -18,6 +18,7 @@ """ Example DAG demonstrating the usage of BranchDayOfWeekOperator. """ + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_branch_labels.py b/airflow/example_dags/example_branch_labels.py index 512fc4244dea7..7e90f26d0f952 100644 --- a/airflow/example_dags/example_branch_labels.py +++ b/airflow/example_dags/example_branch_labels.py @@ -18,6 +18,7 @@ """ Example DAG demonstrating the usage of labels with different branches. """ + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_branch_operator.py b/airflow/example_dags/example_branch_operator.py index 806652d9bab86..a26733c849742 100644 --- a/airflow/example_dags/example_branch_operator.py +++ b/airflow/example_dags/example_branch_operator.py @@ -19,6 +19,7 @@ It is showcasing the basic BranchPythonOperator and its sisters BranchExternalPythonOperator and BranchPythonVirtualenvOperator.""" + from __future__ import annotations import random diff --git a/airflow/example_dags/example_branch_operator_decorator.py b/airflow/example_dags/example_branch_operator_decorator.py index 7b9486157dec7..59cb3b2919475 100644 --- a/airflow/example_dags/example_branch_operator_decorator.py +++ b/airflow/example_dags/example_branch_operator_decorator.py @@ -21,6 +21,7 @@ version ``@task.branch_external_python`` which calls an external Python interpreter and the ``@task.branch_virtualenv`` which builds a temporary Python virtual environment. """ + from __future__ import annotations import random diff --git a/airflow/example_dags/example_branch_python_dop_operator_3.py b/airflow/example_dags/example_branch_python_dop_operator_3.py index af28a9b9e10b4..a7031961ab55d 100644 --- a/airflow/example_dags/example_branch_python_dop_operator_3.py +++ b/airflow/example_dags/example_branch_python_dop_operator_3.py @@ -19,6 +19,7 @@ Example DAG demonstrating the usage of ``@task.branch`` TaskFlow API decorator with depends_on_past=True, where tasks may be run or skipped on alternating runs. """ + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_complex.py b/airflow/example_dags/example_complex.py index 1e7ab78faa31d..e7eba78eae815 100644 --- a/airflow/example_dags/example_complex.py +++ b/airflow/example_dags/example_complex.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that shows the complex DAG structure. """ + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_datasets.py b/airflow/example_dags/example_datasets.py index ac7cc2b3c1702..54f15d8a2d802 100644 --- a/airflow/example_dags/example_datasets.py +++ b/airflow/example_dags/example_datasets.py @@ -49,6 +49,7 @@ The DAGs dataset_consumes_1_never_scheduled and dataset_consumes_unknown_never_scheduled will not run automatically as they depend on datasets that do not get updated or are not produced by any scheduled tasks. """ + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_dynamic_task_mapping.py b/airflow/example_dags/example_dynamic_task_mapping.py index 2315ce9a8c8cb..21f5a03ae8af1 100644 --- a/airflow/example_dags/example_dynamic_task_mapping.py +++ b/airflow/example_dags/example_dynamic_task_mapping.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of dynamic task mapping.""" + from __future__ import annotations from datetime import datetime diff --git a/airflow/example_dags/example_dynamic_task_mapping_with_no_taskflow_operators.py b/airflow/example_dags/example_dynamic_task_mapping_with_no_taskflow_operators.py index ca68a1cf2943d..d639f345aa618 100644 --- a/airflow/example_dags/example_dynamic_task_mapping_with_no_taskflow_operators.py +++ b/airflow/example_dags/example_dynamic_task_mapping_with_no_taskflow_operators.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of dynamic task mapping with non-TaskFlow operators.""" + from __future__ import annotations from datetime import datetime diff --git a/airflow/example_dags/example_external_task_marker_dag.py b/airflow/example_dags/example_external_task_marker_dag.py index e3b6b7fc19907..abaf21770523a 100644 --- a/airflow/example_dags/example_external_task_marker_dag.py +++ b/airflow/example_dags/example_external_task_marker_dag.py @@ -37,6 +37,7 @@ or AirflowSensorTimeout exception """ + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_kubernetes_executor.py b/airflow/example_dags/example_kubernetes_executor.py index a82abcf8a3d2e..395398ee93c8f 100644 --- a/airflow/example_dags/example_kubernetes_executor.py +++ b/airflow/example_dags/example_kubernetes_executor.py @@ -18,6 +18,7 @@ """ This is an example dag for using a Kubernetes Executor Configuration. """ + from __future__ import annotations import logging diff --git a/airflow/example_dags/example_latest_only.py b/airflow/example_dags/example_latest_only.py index 59c879cfc28ca..1e9906240f5af 100644 --- a/airflow/example_dags/example_latest_only.py +++ b/airflow/example_dags/example_latest_only.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example of the LatestOnlyOperator""" + from __future__ import annotations import datetime diff --git a/airflow/example_dags/example_latest_only_with_trigger.py b/airflow/example_dags/example_latest_only_with_trigger.py index 3f6c0ffbd1e81..44a5ed4274005 100644 --- a/airflow/example_dags/example_latest_only_with_trigger.py +++ b/airflow/example_dags/example_latest_only_with_trigger.py @@ -18,6 +18,7 @@ """ Example LatestOnlyOperator and TriggerRule interactions """ + from __future__ import annotations # [START example] diff --git a/airflow/example_dags/example_local_kubernetes_executor.py b/airflow/example_dags/example_local_kubernetes_executor.py index 18341fabe32f1..07be5ba1d38c2 100644 --- a/airflow/example_dags/example_local_kubernetes_executor.py +++ b/airflow/example_dags/example_local_kubernetes_executor.py @@ -18,6 +18,7 @@ """ This is an example dag for using a Local Kubernetes Executor Configuration. """ + from __future__ import annotations import logging diff --git a/airflow/example_dags/example_nested_branch_dag.py b/airflow/example_dags/example_nested_branch_dag.py index 624a66dab6b3c..4e44c3eed1fe5 100644 --- a/airflow/example_dags/example_nested_branch_dag.py +++ b/airflow/example_dags/example_nested_branch_dag.py @@ -20,6 +20,7 @@ ``none_failed_min_one_success`` trigger rule such that they are skipped whenever their corresponding branching tasks are skipped. """ + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_params_trigger_ui.py b/airflow/example_dags/example_params_trigger_ui.py index cc46406521be7..da28a9cc9bc39 100644 --- a/airflow/example_dags/example_params_trigger_ui.py +++ b/airflow/example_dags/example_params_trigger_ui.py @@ -19,6 +19,7 @@ This example DAG generates greetings to a list of provided names in selected languages in the logs. """ + from __future__ import annotations import datetime diff --git a/airflow/example_dags/example_params_ui_tutorial.py b/airflow/example_dags/example_params_ui_tutorial.py index 489a4681c91b7..f4c85c9e430c8 100644 --- a/airflow/example_dags/example_params_ui_tutorial.py +++ b/airflow/example_dags/example_params_ui_tutorial.py @@ -20,6 +20,7 @@ The DAG attribute `params` is used to define a default dictionary of parameters which are usually passed to the DAG and which are used to render a trigger form. """ + from __future__ import annotations import datetime diff --git a/airflow/example_dags/example_passing_params_via_test_command.py b/airflow/example_dags/example_passing_params_via_test_command.py index 9e73d30d1f8e7..2fcb8e4edab7b 100644 --- a/airflow/example_dags/example_passing_params_via_test_command.py +++ b/airflow/example_dags/example_passing_params_via_test_command.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the params arguments in templated arguments.""" + from __future__ import annotations import datetime diff --git a/airflow/example_dags/example_python_decorator.py b/airflow/example_dags/example_python_decorator.py index 157a37653cc31..264fc4333349f 100644 --- a/airflow/example_dags/example_python_decorator.py +++ b/airflow/example_dags/example_python_decorator.py @@ -19,6 +19,7 @@ Example DAG demonstrating the usage of the TaskFlow API to execute Python functions natively and within a virtual environment. """ + from __future__ import annotations import logging diff --git a/airflow/example_dags/example_python_operator.py b/airflow/example_dags/example_python_operator.py index a5c2f145a304c..e829ced88a929 100644 --- a/airflow/example_dags/example_python_operator.py +++ b/airflow/example_dags/example_python_operator.py @@ -19,6 +19,7 @@ Example DAG demonstrating the usage of the classic Python operators to execute Python functions natively and within a virtual environment. """ + from __future__ import annotations import logging diff --git a/airflow/example_dags/example_setup_teardown.py b/airflow/example_dags/example_setup_teardown.py index 59aba9753a119..dd61fcdc0197e 100644 --- a/airflow/example_dags/example_setup_teardown.py +++ b/airflow/example_dags/example_setup_teardown.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of setup and teardown tasks.""" + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_setup_teardown_taskflow.py b/airflow/example_dags/example_setup_teardown_taskflow.py index b1bdbccf7fadc..21c05e29c04a8 100644 --- a/airflow/example_dags/example_setup_teardown_taskflow.py +++ b/airflow/example_dags/example_setup_teardown_taskflow.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of setup and teardown tasks.""" + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_short_circuit_decorator.py b/airflow/example_dags/example_short_circuit_decorator.py index 79a8c6904b17e..00d6cd7186751 100644 --- a/airflow/example_dags/example_short_circuit_decorator.py +++ b/airflow/example_dags/example_short_circuit_decorator.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the `@task.short_circuit()` TaskFlow decorator.""" + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_short_circuit_operator.py b/airflow/example_dags/example_short_circuit_operator.py index 23618d6dc4054..9dfee64707243 100644 --- a/airflow/example_dags/example_short_circuit_operator.py +++ b/airflow/example_dags/example_short_circuit_operator.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the ShortCircuitOperator.""" + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_skip_dag.py b/airflow/example_dags/example_skip_dag.py index e30b462b8c7b7..72ff242831aa4 100644 --- a/airflow/example_dags/example_skip_dag.py +++ b/airflow/example_dags/example_skip_dag.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the EmptyOperator and a custom EmptySkipOperator which skips by default.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/example_dags/example_sla_dag.py b/airflow/example_dags/example_sla_dag.py index e76f40f10ddad..aca1277e88799 100644 --- a/airflow/example_dags/example_sla_dag.py +++ b/airflow/example_dags/example_sla_dag.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating SLA use in Tasks""" + from __future__ import annotations import datetime diff --git a/airflow/example_dags/example_subdag_operator.py b/airflow/example_dags/example_subdag_operator.py index df0ddbc95e34f..53a9015181822 100644 --- a/airflow/example_dags/example_subdag_operator.py +++ b/airflow/example_dags/example_subdag_operator.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the SubDagOperator.""" + from __future__ import annotations # [START example_subdag_operator] diff --git a/airflow/example_dags/example_task_group.py b/airflow/example_dags/example_task_group.py index 9d7a9f2e74d59..85a6f114ee372 100644 --- a/airflow/example_dags/example_task_group.py +++ b/airflow/example_dags/example_task_group.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the TaskGroup.""" + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_task_group_decorator.py b/airflow/example_dags/example_task_group_decorator.py index db8d7b302529c..56d4decf63a81 100644 --- a/airflow/example_dags/example_task_group_decorator.py +++ b/airflow/example_dags/example_task_group_decorator.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the @taskgroup decorator.""" + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_time_delta_sensor_async.py b/airflow/example_dags/example_time_delta_sensor_async.py index 1666f29f3ac7d..a2edb00a03103 100644 --- a/airflow/example_dags/example_time_delta_sensor_async.py +++ b/airflow/example_dags/example_time_delta_sensor_async.py @@ -19,6 +19,7 @@ Example DAG demonstrating ``TimeDeltaSensorAsync``, a drop in replacement for ``TimeDeltaSensor`` that defers and doesn't occupy a worker slot while it waits """ + from __future__ import annotations import datetime diff --git a/airflow/example_dags/example_trigger_controller_dag.py b/airflow/example_dags/example_trigger_controller_dag.py index 9d0d642223372..e68e60c4b19a3 100644 --- a/airflow/example_dags/example_trigger_controller_dag.py +++ b/airflow/example_dags/example_trigger_controller_dag.py @@ -20,6 +20,7 @@ 1. 1st DAG (example_trigger_controller_dag) holds a TriggerDagRunOperator, which will trigger the 2nd DAG 2. 2nd DAG (example_trigger_target_dag) which will be triggered by the TriggerDagRunOperator in the 1st DAG """ + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_trigger_target_dag.py b/airflow/example_dags/example_trigger_target_dag.py index d31b4b869a041..7a009b8dcc6d1 100644 --- a/airflow/example_dags/example_trigger_target_dag.py +++ b/airflow/example_dags/example_trigger_target_dag.py @@ -20,6 +20,7 @@ 1. 1st DAG (example_trigger_controller_dag) holds a TriggerDagRunOperator, which will trigger the 2nd DAG 2. 2nd DAG (example_trigger_target_dag) which will be triggered by the TriggerDagRunOperator in the 1st DAG """ + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_xcom.py b/airflow/example_dags/example_xcom.py index 655c424755423..fa99b91834658 100644 --- a/airflow/example_dags/example_xcom.py +++ b/airflow/example_dags/example_xcom.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of XComs.""" + from __future__ import annotations import pendulum diff --git a/airflow/example_dags/example_xcomargs.py b/airflow/example_dags/example_xcomargs.py index c2be83ea08ac5..d9d0c94f4ea01 100644 --- a/airflow/example_dags/example_xcomargs.py +++ b/airflow/example_dags/example_xcomargs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the XComArgs.""" + from __future__ import annotations import logging diff --git a/airflow/example_dags/plugins/workday.py b/airflow/example_dags/plugins/workday.py index e78367e96c709..90bd80f8a9f1c 100644 --- a/airflow/example_dags/plugins/workday.py +++ b/airflow/example_dags/plugins/workday.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Plugin to demonstrate timetable registration and accommodate example DAGs.""" + from __future__ import annotations import logging diff --git a/airflow/example_dags/subdags/subdag.py b/airflow/example_dags/subdags/subdag.py index 9745fb9e2d91f..748582f4b84ae 100644 --- a/airflow/example_dags/subdags/subdag.py +++ b/airflow/example_dags/subdags/subdag.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Helper function to generate a DAG and operators given some arguments.""" + from __future__ import annotations # [START subdag] diff --git a/airflow/example_dags/tutorial.py b/airflow/example_dags/tutorial.py index 9915810985373..267ae32d7d543 100644 --- a/airflow/example_dags/tutorial.py +++ b/airflow/example_dags/tutorial.py @@ -20,6 +20,7 @@ Documentation that goes along with the Airflow tutorial located [here](https://airflow.apache.org/tutorial.html) """ + from __future__ import annotations # [START tutorial] diff --git a/airflow/example_dags/tutorial_dag.py b/airflow/example_dags/tutorial_dag.py index f0420a85f850b..553b194fef0db 100644 --- a/airflow/example_dags/tutorial_dag.py +++ b/airflow/example_dags/tutorial_dag.py @@ -19,6 +19,7 @@ ### DAG Tutorial Documentation This DAG is demonstrating an Extract -> Transform -> Load pipeline """ + from __future__ import annotations # [START tutorial] diff --git a/airflow/exceptions.py b/airflow/exceptions.py index f8ab14db56d32..ea2f5b0140d89 100644 --- a/airflow/exceptions.py +++ b/airflow/exceptions.py @@ -18,6 +18,7 @@ # Note: Any AirflowException raised is expected to cause the TaskInstance # to be marked in an ERROR state """Exceptions used by Airflow.""" + from __future__ import annotations import warnings diff --git a/airflow/executors/__init__.py b/airflow/executors/__init__.py index f6e18b20a81af..7c936a16b8643 100644 --- a/airflow/executors/__init__.py +++ b/airflow/executors/__init__.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Executors.""" + from __future__ import annotations from airflow.utils.deprecation_tools import add_deprecated_classes diff --git a/airflow/executors/base_executor.py b/airflow/executors/base_executor.py index 276c6f127c8eb..afa6e6d6ed40f 100644 --- a/airflow/executors/base_executor.py +++ b/airflow/executors/base_executor.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Base executor - this is the base class for all the implemented executors.""" + from __future__ import annotations import logging diff --git a/airflow/executors/debug_executor.py b/airflow/executors/debug_executor.py index 2096ca06e0fbf..69a01888e8d53 100644 --- a/airflow/executors/debug_executor.py +++ b/airflow/executors/debug_executor.py @@ -22,6 +22,7 @@ For more information on how the DebugExecutor works, take a look at the guide: :ref:`executor:DebugExecutor` """ + from __future__ import annotations import threading diff --git a/airflow/executors/executor_loader.py b/airflow/executors/executor_loader.py index b3c6601f27672..9f07706a440be 100644 --- a/airflow/executors/executor_loader.py +++ b/airflow/executors/executor_loader.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """All executors.""" + from __future__ import annotations import functools diff --git a/airflow/executors/local_executor.py b/airflow/executors/local_executor.py index 16aa649ee7fb6..3b2670e75592c 100644 --- a/airflow/executors/local_executor.py +++ b/airflow/executors/local_executor.py @@ -22,6 +22,7 @@ For more information on how the LocalExecutor works, take a look at the guide: :ref:`executor:LocalExecutor` """ + from __future__ import annotations import contextlib diff --git a/airflow/executors/sequential_executor.py b/airflow/executors/sequential_executor.py index 227bf879f306b..41b8ae9ddc244 100644 --- a/airflow/executors/sequential_executor.py +++ b/airflow/executors/sequential_executor.py @@ -22,6 +22,7 @@ For more information on how the SequentialExecutor works, take a look at the guide: :ref:`executor:SequentialExecutor` """ + from __future__ import annotations import subprocess diff --git a/airflow/hooks/__init__.py b/airflow/hooks/__init__.py index 779a9a3351284..1baff07c0bb16 100644 --- a/airflow/hooks/__init__.py +++ b/airflow/hooks/__init__.py @@ -17,6 +17,7 @@ # under the License. # fmt:, off """Hooks.""" + from __future__ import annotations from airflow.utils.deprecation_tools import add_deprecated_classes diff --git a/airflow/hooks/base.py b/airflow/hooks/base.py index 6ec0a8938ed20..7219cee1cd3f4 100644 --- a/airflow/hooks/base.py +++ b/airflow/hooks/base.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Base class for all hooks.""" + from __future__ import annotations import logging diff --git a/airflow/hooks/dbapi.py b/airflow/hooks/dbapi.py index eb59f3268d86c..e0c289bbed8af 100644 --- a/airflow/hooks/dbapi.py +++ b/airflow/hooks/dbapi.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module is deprecated. Please use :mod:`airflow.providers.common.sql.hooks.sql`.""" + from __future__ import annotations import warnings diff --git a/airflow/hooks/package_index.py b/airflow/hooks/package_index.py index b1b86f77e3b2e..e6d169d65eb21 100644 --- a/airflow/hooks/package_index.py +++ b/airflow/hooks/package_index.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for additional Package Indexes (Python).""" + from __future__ import annotations import subprocess diff --git a/airflow/kubernetes/pre_7_4_0_compatibility/k8s_model.py b/airflow/kubernetes/pre_7_4_0_compatibility/k8s_model.py index cff12d057bcad..930b194a2dbea 100644 --- a/airflow/kubernetes/pre_7_4_0_compatibility/k8s_model.py +++ b/airflow/kubernetes/pre_7_4_0_compatibility/k8s_model.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Classes for interacting with Kubernetes API.""" + from __future__ import annotations from abc import ABC, abstractmethod diff --git a/airflow/kubernetes/pre_7_4_0_compatibility/kube_client.py b/airflow/kubernetes/pre_7_4_0_compatibility/kube_client.py index 393a3ce94fade..982f0da439bc5 100644 --- a/airflow/kubernetes/pre_7_4_0_compatibility/kube_client.py +++ b/airflow/kubernetes/pre_7_4_0_compatibility/kube_client.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Client for kubernetes communication.""" + from __future__ import annotations import logging diff --git a/airflow/kubernetes/pre_7_4_0_compatibility/pod_generator.py b/airflow/kubernetes/pre_7_4_0_compatibility/pod_generator.py index 73671fd25a241..ea4ae63b2ec42 100644 --- a/airflow/kubernetes/pre_7_4_0_compatibility/pod_generator.py +++ b/airflow/kubernetes/pre_7_4_0_compatibility/pod_generator.py @@ -24,6 +24,7 @@ The advantage being that the full Kubernetes API is supported and no serialization need be written. """ + from __future__ import annotations import copy diff --git a/airflow/kubernetes/pre_7_4_0_compatibility/pod_generator_deprecated.py b/airflow/kubernetes/pre_7_4_0_compatibility/pod_generator_deprecated.py index df1b78c0252e0..8dc56331b5bb6 100644 --- a/airflow/kubernetes/pre_7_4_0_compatibility/pod_generator_deprecated.py +++ b/airflow/kubernetes/pre_7_4_0_compatibility/pod_generator_deprecated.py @@ -22,6 +22,7 @@ The advantage being that the full Kubernetes API is supported and no serialization need be written. """ + from __future__ import annotations import copy diff --git a/airflow/kubernetes/pre_7_4_0_compatibility/secret.py b/airflow/kubernetes/pre_7_4_0_compatibility/secret.py index b02bbb3dd70e7..d4d6a8aa044c5 100644 --- a/airflow/kubernetes/pre_7_4_0_compatibility/secret.py +++ b/airflow/kubernetes/pre_7_4_0_compatibility/secret.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Classes for interacting with Kubernetes API.""" + from __future__ import annotations import copy diff --git a/airflow/lineage/__init__.py b/airflow/lineage/__init__.py index 79f1f664638fa..3b08b9a44a9f9 100644 --- a/airflow/lineage/__init__.py +++ b/airflow/lineage/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Provides lineage support functions.""" + from __future__ import annotations import logging diff --git a/airflow/lineage/backend.py b/airflow/lineage/backend.py index 1ccfa78b890be..25d1bd4b07eb0 100644 --- a/airflow/lineage/backend.py +++ b/airflow/lineage/backend.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Sends lineage metadata to a backend.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/lineage/entities.py b/airflow/lineage/entities.py index c52dc4cfd0133..0601fa4c713cd 100644 --- a/airflow/lineage/entities.py +++ b/airflow/lineage/entities.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Defines base entities used for providing lineage information.""" + from __future__ import annotations from typing import Any, ClassVar diff --git a/airflow/metrics/protocols.py b/airflow/metrics/protocols.py index cb4feeb51f6a4..c46942ce95f70 100644 --- a/airflow/metrics/protocols.py +++ b/airflow/metrics/protocols.py @@ -29,11 +29,9 @@ class TimerProtocol(Protocol): """Type protocol for StatsLogger.timer.""" - def __enter__(self) -> Timer: - ... + def __enter__(self) -> Timer: ... - def __exit__(self, exc_type, exc_value, traceback) -> None: - ... + def __exit__(self, exc_type, exc_value, traceback) -> None: ... def start(self) -> Timer: """Start the timer.""" diff --git a/airflow/models/__init__.py b/airflow/models/__init__.py index a98147f416154..c5462c57f8b34 100644 --- a/airflow/models/__init__.py +++ b/airflow/models/__init__.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Airflow models.""" + from __future__ import annotations # Do not add new models to this -- this is for compat only diff --git a/airflow/models/baseoperator.py b/airflow/models/baseoperator.py index 052f2489503ab..72fa1aff264f6 100644 --- a/airflow/models/baseoperator.py +++ b/airflow/models/baseoperator.py @@ -20,6 +20,7 @@ :sphinx-autoapi-skip: """ + from __future__ import annotations import abc diff --git a/airflow/models/dag.py b/airflow/models/dag.py index 0a51aa8e10ae4..a230c94fd7529 100644 --- a/airflow/models/dag.py +++ b/airflow/models/dag.py @@ -1779,8 +1779,7 @@ def _get_task_instances( exclude_task_ids: Collection[str | tuple[str, int]] | None, session: Session, dag_bag: DagBag | None = ..., - ) -> Iterable[TaskInstance]: - ... # pragma: no cover + ) -> Iterable[TaskInstance]: ... # pragma: no cover @overload def _get_task_instances( @@ -1801,8 +1800,7 @@ def _get_task_instances( recursion_depth: int = ..., max_recursion_depth: int = ..., visited_external_tis: set[TaskInstanceKey] = ..., - ) -> set[TaskInstanceKey]: - ... # pragma: no cover + ) -> set[TaskInstanceKey]: ... # pragma: no cover def _get_task_instances( self, diff --git a/airflow/models/dagparam.py b/airflow/models/dagparam.py index 9b06151966413..78322a345695a 100644 --- a/airflow/models/dagparam.py +++ b/airflow/models/dagparam.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module is deprecated. Please use :mod:`airflow.models.param`.""" + from __future__ import annotations import warnings diff --git a/airflow/models/dagrun.py b/airflow/models/dagrun.py index 40880a644429c..f9e7022b5fd37 100644 --- a/airflow/models/dagrun.py +++ b/airflow/models/dagrun.py @@ -1277,8 +1277,7 @@ def _get_task_creator( created_counts: dict[str, int], ti_mutation_hook: Callable, hook_is_noop: Literal[True], - ) -> Callable[[Operator, Iterable[int]], Iterator[dict[str, Any]]]: - ... + ) -> Callable[[Operator, Iterable[int]], Iterator[dict[str, Any]]]: ... @overload def _get_task_creator( @@ -1286,8 +1285,7 @@ def _get_task_creator( created_counts: dict[str, int], ti_mutation_hook: Callable, hook_is_noop: Literal[False], - ) -> Callable[[Operator, Iterable[int]], Iterator[TI]]: - ... + ) -> Callable[[Operator, Iterable[int]], Iterator[TI]]: ... def _get_task_creator( self, diff --git a/airflow/models/renderedtifields.py b/airflow/models/renderedtifields.py index ff850e24ee925..5d61e6e40fa5c 100644 --- a/airflow/models/renderedtifields.py +++ b/airflow/models/renderedtifields.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Save Rendered Template Fields.""" + from __future__ import annotations import os diff --git a/airflow/models/serialized_dag.py b/airflow/models/serialized_dag.py index 06c10d0089679..cba8d3a1cbf7c 100644 --- a/airflow/models/serialized_dag.py +++ b/airflow/models/serialized_dag.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Serialized DAG table in database.""" + from __future__ import annotations import logging diff --git a/airflow/models/taskfail.py b/airflow/models/taskfail.py index c8f2ac51fcc4a..1bf7db7a11ac3 100644 --- a/airflow/models/taskfail.py +++ b/airflow/models/taskfail.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Taskfail tracks the failed run durations of each task instance.""" + from __future__ import annotations from sqlalchemy import Column, ForeignKeyConstraint, Index, Integer, text diff --git a/airflow/models/taskmap.py b/airflow/models/taskmap.py index 7211203171625..25b08a4e71e15 100644 --- a/airflow/models/taskmap.py +++ b/airflow/models/taskmap.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Table to store information about mapped task instances (AIP-42).""" + from __future__ import annotations import collections.abc diff --git a/airflow/models/taskreschedule.py b/airflow/models/taskreschedule.py index 69356661e2bcb..65e5ef5ada229 100644 --- a/airflow/models/taskreschedule.py +++ b/airflow/models/taskreschedule.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """TaskReschedule tracks rescheduled task instances.""" + from __future__ import annotations import warnings diff --git a/airflow/operators/branch.py b/airflow/operators/branch.py index 4288775f6b4f6..74586590db0b9 100644 --- a/airflow/operators/branch.py +++ b/airflow/operators/branch.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Branching operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Iterable diff --git a/airflow/operators/latest_only.py b/airflow/operators/latest_only.py index 7b4341b101313..6f2c0288d90d6 100644 --- a/airflow/operators/latest_only.py +++ b/airflow/operators/latest_only.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Contains an operator to run downstream tasks only for the latest scheduled DagRun.""" + from __future__ import annotations from typing import TYPE_CHECKING, Iterable diff --git a/airflow/operators/subdag.py b/airflow/operators/subdag.py index 44e92c3086931..315cd103f5ae8 100644 --- a/airflow/operators/subdag.py +++ b/airflow/operators/subdag.py @@ -20,6 +20,7 @@ The module which provides a way to nest your DAGs and so your levels of complexity. """ + from __future__ import annotations import warnings diff --git a/airflow/plugins_manager.py b/airflow/plugins_manager.py index d334eb4465d36..13ce0c1b66a20 100644 --- a/airflow/plugins_manager.py +++ b/airflow/plugins_manager.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Manages all plugins.""" + from __future__ import annotations import importlib diff --git a/airflow/providers/airbyte/sensors/airbyte.py b/airflow/providers/airbyte/sensors/airbyte.py index 2db010d3bb05f..0ccdd903c48d6 100644 --- a/airflow/providers/airbyte/sensors/airbyte.py +++ b/airflow/providers/airbyte/sensors/airbyte.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Airbyte Job sensor.""" + from __future__ import annotations import time diff --git a/airflow/providers/alibaba/cloud/operators/analyticdb_spark.py b/airflow/providers/alibaba/cloud/operators/analyticdb_spark.py index 1ea8f8a970aa6..345cf5d27ea13 100644 --- a/airflow/providers/alibaba/cloud/operators/analyticdb_spark.py +++ b/airflow/providers/alibaba/cloud/operators/analyticdb_spark.py @@ -60,8 +60,7 @@ def get_hook(self) -> AnalyticDBSparkHook: """Get valid hook.""" return self.hook - def execute(self, context: Context) -> Any: - ... + def execute(self, context: Context) -> Any: ... def monitor_application(self): self.log.info("Monitoring application with %s", self.app_id) diff --git a/airflow/providers/alibaba/cloud/operators/oss.py b/airflow/providers/alibaba/cloud/operators/oss.py index 4844d715a7553..1e07a4cce85a2 100644 --- a/airflow/providers/alibaba/cloud/operators/oss.py +++ b/airflow/providers/alibaba/cloud/operators/oss.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Alibaba Cloud OSS operators.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/amazon/aws/auth_manager/cli/avp_commands.py b/airflow/providers/amazon/aws/auth_manager/cli/avp_commands.py index 4d94e723ef828..1ee9d90692e6d 100644 --- a/airflow/providers/amazon/aws/auth_manager/cli/avp_commands.py +++ b/airflow/providers/amazon/aws/auth_manager/cli/avp_commands.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """User sub-commands.""" + from __future__ import annotations import json diff --git a/airflow/providers/amazon/aws/auth_manager/cli/idc_commands.py b/airflow/providers/amazon/aws/auth_manager/cli/idc_commands.py index 3639dd4b91386..388948765ace6 100644 --- a/airflow/providers/amazon/aws/auth_manager/cli/idc_commands.py +++ b/airflow/providers/amazon/aws/auth_manager/cli/idc_commands.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """User sub-commands.""" + from __future__ import annotations import logging diff --git a/airflow/providers/amazon/aws/executors/batch/batch_executor.py b/airflow/providers/amazon/aws/executors/batch/batch_executor.py index d9edf19acc50c..1bd5135dea947 100644 --- a/airflow/providers/amazon/aws/executors/batch/batch_executor.py +++ b/airflow/providers/amazon/aws/executors/batch/batch_executor.py @@ -16,6 +16,7 @@ # under the License. """AWS Batch Executor. Each Airflow task gets delegated out to an AWS Batch Job.""" + from __future__ import annotations import time diff --git a/airflow/providers/amazon/aws/hooks/athena.py b/airflow/providers/amazon/aws/hooks/athena.py index 94818863539a1..a613d7410cfa8 100644 --- a/airflow/providers/amazon/aws/hooks/athena.py +++ b/airflow/providers/amazon/aws/hooks/athena.py @@ -22,6 +22,7 @@ PageIterator """ + from __future__ import annotations import warnings diff --git a/airflow/providers/amazon/aws/hooks/base_aws.py b/airflow/providers/amazon/aws/hooks/base_aws.py index ff2f33dbe8205..59887a9a1c631 100644 --- a/airflow/providers/amazon/aws/hooks/base_aws.py +++ b/airflow/providers/amazon/aws/hooks/base_aws.py @@ -22,6 +22,7 @@ For more information on how to use this hook, take a look at the guide: :ref:`howto/connection:aws` """ + from __future__ import annotations import datetime diff --git a/airflow/providers/amazon/aws/hooks/batch_client.py b/airflow/providers/amazon/aws/hooks/batch_client.py index 465ca3e65b5fd..7ee2c29d73482 100644 --- a/airflow/providers/amazon/aws/hooks/batch_client.py +++ b/airflow/providers/amazon/aws/hooks/batch_client.py @@ -24,6 +24,7 @@ - https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/batch.html - https://docs.aws.amazon.com/batch/latest/APIReference/Welcome.html """ + from __future__ import annotations import itertools diff --git a/airflow/providers/amazon/aws/hooks/batch_waiters.py b/airflow/providers/amazon/aws/hooks/batch_waiters.py index 6adc363c2ff93..12151b7a42762 100644 --- a/airflow/providers/amazon/aws/hooks/batch_waiters.py +++ b/airflow/providers/amazon/aws/hooks/batch_waiters.py @@ -23,6 +23,7 @@ - https://boto3.amazonaws.com/v1/documentation/api/latest/guide/clients.html#waiters - https://github.com/boto/botocore/blob/develop/botocore/waiter.py """ + from __future__ import annotations import json diff --git a/airflow/providers/amazon/aws/hooks/chime.py b/airflow/providers/amazon/aws/hooks/chime.py index a209a3a18aca1..c4f411269e846 100644 --- a/airflow/providers/amazon/aws/hooks/chime.py +++ b/airflow/providers/amazon/aws/hooks/chime.py @@ -17,6 +17,7 @@ # under the License. """This module contains a web hook for Chime.""" + from __future__ import annotations import json diff --git a/airflow/providers/amazon/aws/hooks/cloud_formation.py b/airflow/providers/amazon/aws/hooks/cloud_formation.py index 5250b3c430b9e..5f591795af144 100644 --- a/airflow/providers/amazon/aws/hooks/cloud_formation.py +++ b/airflow/providers/amazon/aws/hooks/cloud_formation.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains AWS CloudFormation Hook.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/amazon/aws/hooks/datasync.py b/airflow/providers/amazon/aws/hooks/datasync.py index 4b4b27cc0e6cc..1e9b25cf731db 100644 --- a/airflow/providers/amazon/aws/hooks/datasync.py +++ b/airflow/providers/amazon/aws/hooks/datasync.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Interact with AWS DataSync, using the AWS ``boto3`` library.""" + from __future__ import annotations import time diff --git a/airflow/providers/amazon/aws/hooks/dynamodb.py b/airflow/providers/amazon/aws/hooks/dynamodb.py index 957730a754c06..07c9b99a51a46 100644 --- a/airflow/providers/amazon/aws/hooks/dynamodb.py +++ b/airflow/providers/amazon/aws/hooks/dynamodb.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains the Amazon DynamoDB Hook.""" + from __future__ import annotations from typing import Iterable diff --git a/airflow/providers/amazon/aws/hooks/eks.py b/airflow/providers/amazon/aws/hooks/eks.py index 24a22c6a2b25e..23fbd43330977 100644 --- a/airflow/providers/amazon/aws/hooks/eks.py +++ b/airflow/providers/amazon/aws/hooks/eks.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Interact with Amazon EKS, using the boto3 library.""" + from __future__ import annotations import base64 diff --git a/airflow/providers/amazon/aws/hooks/glue_catalog.py b/airflow/providers/amazon/aws/hooks/glue_catalog.py index 97e654c18f77c..01937dd729b25 100644 --- a/airflow/providers/amazon/aws/hooks/glue_catalog.py +++ b/airflow/providers/amazon/aws/hooks/glue_catalog.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains AWS Glue Catalog Hook.""" + from __future__ import annotations from typing import Any diff --git a/airflow/providers/amazon/aws/hooks/kinesis.py b/airflow/providers/amazon/aws/hooks/kinesis.py index 0d2908bd8b73d..6218205932a92 100644 --- a/airflow/providers/amazon/aws/hooks/kinesis.py +++ b/airflow/providers/amazon/aws/hooks/kinesis.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains AWS Firehose hook.""" + from __future__ import annotations from typing import Iterable diff --git a/airflow/providers/amazon/aws/hooks/lambda_function.py b/airflow/providers/amazon/aws/hooks/lambda_function.py index d2fe27c23cc5a..771a01aeb7fd1 100644 --- a/airflow/providers/amazon/aws/hooks/lambda_function.py +++ b/airflow/providers/amazon/aws/hooks/lambda_function.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains AWS Lambda hook.""" + from __future__ import annotations import base64 diff --git a/airflow/providers/amazon/aws/hooks/rds.py b/airflow/providers/amazon/aws/hooks/rds.py index 9232fb717775d..8219a37757c8b 100644 --- a/airflow/providers/amazon/aws/hooks/rds.py +++ b/airflow/providers/amazon/aws/hooks/rds.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Interact with AWS RDS.""" + from __future__ import annotations import time diff --git a/airflow/providers/amazon/aws/hooks/s3.py b/airflow/providers/amazon/aws/hooks/s3.py index 580bb8ce7992f..c4610700866a4 100644 --- a/airflow/providers/amazon/aws/hooks/s3.py +++ b/airflow/providers/amazon/aws/hooks/s3.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Interact with AWS S3, using the boto3 library.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/amazon/aws/hooks/ses.py b/airflow/providers/amazon/aws/hooks/ses.py index 120d3235f904e..a5ea06de35171 100644 --- a/airflow/providers/amazon/aws/hooks/ses.py +++ b/airflow/providers/amazon/aws/hooks/ses.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains AWS SES Hook.""" + from __future__ import annotations from typing import Any, Iterable diff --git a/airflow/providers/amazon/aws/hooks/sns.py b/airflow/providers/amazon/aws/hooks/sns.py index 54843ae366ffb..1c9a99b72f6e6 100644 --- a/airflow/providers/amazon/aws/hooks/sns.py +++ b/airflow/providers/amazon/aws/hooks/sns.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains AWS SNS hook.""" + from __future__ import annotations import json diff --git a/airflow/providers/amazon/aws/hooks/sqs.py b/airflow/providers/amazon/aws/hooks/sqs.py index d1d8ed99d0c2c..f384bd4d28f24 100644 --- a/airflow/providers/amazon/aws/hooks/sqs.py +++ b/airflow/providers/amazon/aws/hooks/sqs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains AWS SQS hook.""" + from __future__ import annotations from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook diff --git a/airflow/providers/amazon/aws/operators/batch.py b/airflow/providers/amazon/aws/operators/batch.py index 78ad203718343..8c39be02a7cff 100644 --- a/airflow/providers/amazon/aws/operators/batch.py +++ b/airflow/providers/amazon/aws/operators/batch.py @@ -22,6 +22,7 @@ - https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/batch.html - https://docs.aws.amazon.com/batch/latest/APIReference/Welcome.html """ + from __future__ import annotations import warnings diff --git a/airflow/providers/amazon/aws/operators/cloud_formation.py b/airflow/providers/amazon/aws/operators/cloud_formation.py index a4d43358ec1de..b75c5dfb96102 100644 --- a/airflow/providers/amazon/aws/operators/cloud_formation.py +++ b/airflow/providers/amazon/aws/operators/cloud_formation.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains AWS CloudFormation create/delete stack operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/amazon/aws/operators/datasync.py b/airflow/providers/amazon/aws/operators/datasync.py index c280b531028d5..3252dc9940efd 100644 --- a/airflow/providers/amazon/aws/operators/datasync.py +++ b/airflow/providers/amazon/aws/operators/datasync.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Create, get, update, execute and delete an AWS DataSync Task.""" + from __future__ import annotations import logging diff --git a/airflow/providers/amazon/aws/operators/eks.py b/airflow/providers/amazon/aws/operators/eks.py index 07095c15926f2..a62fe59d67345 100644 --- a/airflow/providers/amazon/aws/operators/eks.py +++ b/airflow/providers/amazon/aws/operators/eks.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Amazon EKS operators.""" + from __future__ import annotations import logging diff --git a/airflow/providers/amazon/aws/operators/s3.py b/airflow/providers/amazon/aws/operators/s3.py index 5c2b3c7208239..f256196ee96cd 100644 --- a/airflow/providers/amazon/aws/operators/s3.py +++ b/airflow/providers/amazon/aws/operators/s3.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains AWS S3 operators.""" + from __future__ import annotations import subprocess diff --git a/airflow/providers/amazon/aws/operators/sns.py b/airflow/providers/amazon/aws/operators/sns.py index 18e3255c6fe78..05b01c5849c21 100644 --- a/airflow/providers/amazon/aws/operators/sns.py +++ b/airflow/providers/amazon/aws/operators/sns.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Publish message to SNS queue.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/amazon/aws/operators/sqs.py b/airflow/providers/amazon/aws/operators/sqs.py index f68b8c8bc6bb9..79444f8a57a97 100644 --- a/airflow/providers/amazon/aws/operators/sqs.py +++ b/airflow/providers/amazon/aws/operators/sqs.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Publish message to SQS queue.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/amazon/aws/secrets/secrets_manager.py b/airflow/providers/amazon/aws/secrets/secrets_manager.py index f33f328c00218..e4916b8e1bcd1 100644 --- a/airflow/providers/amazon/aws/secrets/secrets_manager.py +++ b/airflow/providers/amazon/aws/secrets/secrets_manager.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Objects relating to sourcing secrets from AWS Secrets Manager.""" + from __future__ import annotations import json diff --git a/airflow/providers/amazon/aws/secrets/systems_manager.py b/airflow/providers/amazon/aws/secrets/systems_manager.py index 8b1daca1f7dc1..25fb1606f2b6a 100644 --- a/airflow/providers/amazon/aws/secrets/systems_manager.py +++ b/airflow/providers/amazon/aws/secrets/systems_manager.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Objects relating to sourcing connections from AWS SSM Parameter Store.""" + from __future__ import annotations import re diff --git a/airflow/providers/amazon/aws/sensors/cloud_formation.py b/airflow/providers/amazon/aws/sensors/cloud_formation.py index 892f1b9857815..f67278ecec384 100644 --- a/airflow/providers/amazon/aws/sensors/cloud_formation.py +++ b/airflow/providers/amazon/aws/sensors/cloud_formation.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains sensors for AWS CloudFormation.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/amazon/aws/sensors/eks.py b/airflow/providers/amazon/aws/sensors/eks.py index c293b56f2fe05..a5dcdeb0ef185 100644 --- a/airflow/providers/amazon/aws/sensors/eks.py +++ b/airflow/providers/amazon/aws/sensors/eks.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Tracking the state of Amazon EKS Clusters, Amazon EKS managed node groups, and AWS Fargate profiles.""" + from __future__ import annotations from abc import abstractmethod @@ -114,12 +115,10 @@ def poke(self, context: Context) -> bool: return state == self.target_state @abstractmethod - def get_state(self) -> ClusterStates | NodegroupStates | FargateProfileStates: - ... + def get_state(self) -> ClusterStates | NodegroupStates | FargateProfileStates: ... @abstractmethod - def get_terminal_states(self) -> frozenset: - ... + def get_terminal_states(self) -> frozenset: ... class EksClusterStateSensor(EksBaseSensor): diff --git a/airflow/providers/amazon/aws/sensors/sqs.py b/airflow/providers/amazon/aws/sensors/sqs.py index cbe12b2bd49dc..7b93e3847c243 100644 --- a/airflow/providers/amazon/aws/sensors/sqs.py +++ b/airflow/providers/amazon/aws/sensors/sqs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Reads and then deletes the message from SQS queue.""" + from __future__ import annotations from datetime import timedelta diff --git a/airflow/providers/amazon/aws/transfers/base.py b/airflow/providers/amazon/aws/transfers/base.py index 71433e5e3e3f5..09a72bcf3875f 100644 --- a/airflow/providers/amazon/aws/transfers/base.py +++ b/airflow/providers/amazon/aws/transfers/base.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains base AWS to AWS transfer operator.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/amazon/aws/transfers/exasol_to_s3.py b/airflow/providers/amazon/aws/transfers/exasol_to_s3.py index ba3b86416fa16..ea17b77db6cc4 100644 --- a/airflow/providers/amazon/aws/transfers/exasol_to_s3.py +++ b/airflow/providers/amazon/aws/transfers/exasol_to_s3.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Transfers data from Exasol database into a S3 Bucket.""" + from __future__ import annotations from tempfile import NamedTemporaryFile diff --git a/airflow/providers/amazon/aws/transfers/gcs_to_s3.py b/airflow/providers/amazon/aws/transfers/gcs_to_s3.py index 6f05496c0ce1f..c0a3762b5a6c8 100644 --- a/airflow/providers/amazon/aws/transfers/gcs_to_s3.py +++ b/airflow/providers/amazon/aws/transfers/gcs_to_s3.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Storage to S3 operator.""" + from __future__ import annotations import os diff --git a/airflow/providers/amazon/aws/transfers/google_api_to_s3.py b/airflow/providers/amazon/aws/transfers/google_api_to_s3.py index 71d7824715bdc..d3a020c993143 100644 --- a/airflow/providers/amazon/aws/transfers/google_api_to_s3.py +++ b/airflow/providers/amazon/aws/transfers/google_api_to_s3.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module allows you to transfer data from any Google API endpoint into a S3 Bucket.""" + from __future__ import annotations import json diff --git a/airflow/providers/amazon/aws/transfers/hive_to_dynamodb.py b/airflow/providers/amazon/aws/transfers/hive_to_dynamodb.py index c8f19a8cc063c..3da7b506bb9cb 100644 --- a/airflow/providers/amazon/aws/transfers/hive_to_dynamodb.py +++ b/airflow/providers/amazon/aws/transfers/hive_to_dynamodb.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains operator to move data from Hive to DynamoDB.""" + from __future__ import annotations import json diff --git a/airflow/providers/amazon/aws/transfers/http_to_s3.py b/airflow/providers/amazon/aws/transfers/http_to_s3.py index 0534e04d3df1f..373a31c87e1c3 100644 --- a/airflow/providers/amazon/aws/transfers/http_to_s3.py +++ b/airflow/providers/amazon/aws/transfers/http_to_s3.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains operator to move data from HTTP endpoint to S3.""" + from __future__ import annotations from functools import cached_property diff --git a/airflow/providers/amazon/aws/transfers/imap_attachment_to_s3.py b/airflow/providers/amazon/aws/transfers/imap_attachment_to_s3.py index 939c423c41eb9..aff83eb889101 100644 --- a/airflow/providers/amazon/aws/transfers/imap_attachment_to_s3.py +++ b/airflow/providers/amazon/aws/transfers/imap_attachment_to_s3.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module allows you to transfer mail attachments from a mail server into s3 bucket.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/amazon/aws/transfers/redshift_to_s3.py b/airflow/providers/amazon/aws/transfers/redshift_to_s3.py index 938a9663bf5be..052c3b5cc7d65 100644 --- a/airflow/providers/amazon/aws/transfers/redshift_to_s3.py +++ b/airflow/providers/amazon/aws/transfers/redshift_to_s3.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Transfers data from AWS Redshift into a S3 Bucket.""" + from __future__ import annotations import re diff --git a/airflow/providers/amazon/aws/utils/emailer.py b/airflow/providers/amazon/aws/utils/emailer.py index 5a5cdd15c8bc0..5b4ffd30c0a3b 100644 --- a/airflow/providers/amazon/aws/utils/emailer.py +++ b/airflow/providers/amazon/aws/utils/emailer.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Airflow module for email backend using AWS SES.""" + from __future__ import annotations from typing import Any diff --git a/airflow/providers/apache/beam/hooks/beam.py b/airflow/providers/apache/beam/hooks/beam.py index 29ecfa46516c0..e4622a3dd1977 100644 --- a/airflow/providers/apache/beam/hooks/beam.py +++ b/airflow/providers/apache/beam/hooks/beam.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Apache Beam Hook.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/apache/beam/operators/beam.py b/airflow/providers/apache/beam/operators/beam.py index 0933ba35e8145..e88923bc05374 100644 --- a/airflow/providers/apache/beam/operators/beam.py +++ b/airflow/providers/apache/beam/operators/beam.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Apache Beam operators.""" + from __future__ import annotations import asyncio @@ -821,12 +822,10 @@ def on_kill(self) -> None: class _GoArtifact(ABC): @abstractmethod - def is_located_on_gcs(self) -> bool: - ... + def is_located_on_gcs(self) -> bool: ... @abstractmethod - def download_from_gcs(self, gcs_hook: GCSHook, tmp_dir: str) -> None: - ... + def download_from_gcs(self, gcs_hook: GCSHook, tmp_dir: str) -> None: ... @abstractmethod def start_pipeline( @@ -834,8 +833,7 @@ def start_pipeline( beam_hook: BeamHook, variables: dict, process_line_callback: Callable[[str], None] | None = None, - ) -> None: - ... + ) -> None: ... class _GoFile(_GoArtifact): diff --git a/airflow/providers/apache/cassandra/hooks/cassandra.py b/airflow/providers/apache/cassandra/hooks/cassandra.py index ac0e251c90fa8..34c0be1caf804 100644 --- a/airflow/providers/apache/cassandra/hooks/cassandra.py +++ b/airflow/providers/apache/cassandra/hooks/cassandra.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains hook to integrate with Apache Cassandra.""" + from __future__ import annotations import re diff --git a/airflow/providers/apache/druid/transfers/hive_to_druid.py b/airflow/providers/apache/druid/transfers/hive_to_druid.py index 2616ea4f5e6f6..b691ec352c726 100644 --- a/airflow/providers/apache/druid/transfers/hive_to_druid.py +++ b/airflow/providers/apache/druid/transfers/hive_to_druid.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains operator to move data from Hive to Druid.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Sequence diff --git a/airflow/providers/apache/hdfs/hooks/webhdfs.py b/airflow/providers/apache/hdfs/hooks/webhdfs.py index fdfdfc0c5a49e..96fa77a313231 100644 --- a/airflow/providers/apache/hdfs/hooks/webhdfs.py +++ b/airflow/providers/apache/hdfs/hooks/webhdfs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Web HDFS.""" + from __future__ import annotations import logging diff --git a/airflow/providers/apache/hive/transfers/hive_to_mysql.py b/airflow/providers/apache/hive/transfers/hive_to_mysql.py index 6eb08d2cc2a63..47aa9623bef56 100644 --- a/airflow/providers/apache/hive/transfers/hive_to_mysql.py +++ b/airflow/providers/apache/hive/transfers/hive_to_mysql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains an operator to move data from Hive to MySQL.""" + from __future__ import annotations from tempfile import NamedTemporaryFile diff --git a/airflow/providers/apache/hive/transfers/hive_to_samba.py b/airflow/providers/apache/hive/transfers/hive_to_samba.py index 4f09789e107f1..edfa6bf8b9368 100644 --- a/airflow/providers/apache/hive/transfers/hive_to_samba.py +++ b/airflow/providers/apache/hive/transfers/hive_to_samba.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains an operator to move data from Hive to Samba.""" + from __future__ import annotations from tempfile import NamedTemporaryFile diff --git a/airflow/providers/apache/hive/transfers/mssql_to_hive.py b/airflow/providers/apache/hive/transfers/mssql_to_hive.py index b6630b16f2143..79b5dae27ac3a 100644 --- a/airflow/providers/apache/hive/transfers/mssql_to_hive.py +++ b/airflow/providers/apache/hive/transfers/mssql_to_hive.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains an operator to move data from MSSQL to Hive.""" + from __future__ import annotations import csv diff --git a/airflow/providers/apache/hive/transfers/mysql_to_hive.py b/airflow/providers/apache/hive/transfers/mysql_to_hive.py index bd7876efd414c..70cb7f4eee2b8 100644 --- a/airflow/providers/apache/hive/transfers/mysql_to_hive.py +++ b/airflow/providers/apache/hive/transfers/mysql_to_hive.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains an operator to move data from MySQL to Hive.""" + from __future__ import annotations import csv diff --git a/airflow/providers/apache/hive/transfers/s3_to_hive.py b/airflow/providers/apache/hive/transfers/s3_to_hive.py index db954eb8b9f2c..ebc9536897018 100644 --- a/airflow/providers/apache/hive/transfers/s3_to_hive.py +++ b/airflow/providers/apache/hive/transfers/s3_to_hive.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains an operator to move data from an S3 bucket to Hive.""" + from __future__ import annotations import bz2 diff --git a/airflow/providers/apache/hive/transfers/vertica_to_hive.py b/airflow/providers/apache/hive/transfers/vertica_to_hive.py index 6f65fd35b9443..810afd2ed8f99 100644 --- a/airflow/providers/apache/hive/transfers/vertica_to_hive.py +++ b/airflow/providers/apache/hive/transfers/vertica_to_hive.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains an operator to move data from Vertica to Hive.""" + from __future__ import annotations import csv diff --git a/airflow/providers/apache/livy/hooks/livy.py b/airflow/providers/apache/livy/hooks/livy.py index ff2f9faac34e1..53a86b5cfb198 100644 --- a/airflow/providers/apache/livy/hooks/livy.py +++ b/airflow/providers/apache/livy/hooks/livy.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains the Apache Livy hook.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/apache/livy/operators/livy.py b/airflow/providers/apache/livy/operators/livy.py index 34c8a73eb2586..70f63a20c2a69 100644 --- a/airflow/providers/apache/livy/operators/livy.py +++ b/airflow/providers/apache/livy/operators/livy.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains the Apache Livy operator.""" + from __future__ import annotations import time diff --git a/airflow/providers/apache/livy/sensors/livy.py b/airflow/providers/apache/livy/sensors/livy.py index d0838b187a965..d14c112403ed3 100644 --- a/airflow/providers/apache/livy/sensors/livy.py +++ b/airflow/providers/apache/livy/sensors/livy.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains the Apache Livy sensor.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Sequence diff --git a/airflow/providers/apache/livy/triggers/livy.py b/airflow/providers/apache/livy/triggers/livy.py index 30d6e393f1d3d..d6203b4324d49 100644 --- a/airflow/providers/apache/livy/triggers/livy.py +++ b/airflow/providers/apache/livy/triggers/livy.py @@ -16,6 +16,7 @@ # under the License. """This module contains the Apache Livy Trigger.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/arangodb/hooks/arangodb.py b/airflow/providers/arangodb/hooks/arangodb.py index 469cd498154e6..e0625b8b9e1bf 100644 --- a/airflow/providers/arangodb/hooks/arangodb.py +++ b/airflow/providers/arangodb/hooks/arangodb.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module allows connecting to a ArangoDB.""" + from __future__ import annotations from functools import cached_property diff --git a/airflow/providers/asana/hooks/asana.py b/airflow/providers/asana/hooks/asana.py index cc7276a50267e..eb77afdca511f 100644 --- a/airflow/providers/asana/hooks/asana.py +++ b/airflow/providers/asana/hooks/asana.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Connect to Asana.""" + from __future__ import annotations from functools import cached_property diff --git a/airflow/providers/atlassian/jira/hooks/jira.py b/airflow/providers/atlassian/jira/hooks/jira.py index 291195b01eded..b4f3a207f0313 100644 --- a/airflow/providers/atlassian/jira/hooks/jira.py +++ b/airflow/providers/atlassian/jira/hooks/jira.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for JIRA.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/celery/cli/celery_command.py b/airflow/providers/celery/cli/celery_command.py index 217433f811d00..fff46090aa48d 100644 --- a/airflow/providers/celery/cli/celery_command.py +++ b/airflow/providers/celery/cli/celery_command.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Celery command.""" + from __future__ import annotations import logging diff --git a/airflow/providers/celery/executors/celery_executor.py b/airflow/providers/celery/executors/celery_executor.py index 6bd38014b23b1..2a75be91da56e 100644 --- a/airflow/providers/celery/executors/celery_executor.py +++ b/airflow/providers/celery/executors/celery_executor.py @@ -21,6 +21,7 @@ For more information on how the CeleryExecutor works, take a look at the guide: :doc:`/celery_executor` """ + from __future__ import annotations import logging diff --git a/airflow/providers/celery/executors/default_celery.py b/airflow/providers/celery/executors/default_celery.py index 01b13b1c5a8af..bc672c39a8e5e 100644 --- a/airflow/providers/celery/executors/default_celery.py +++ b/airflow/providers/celery/executors/default_celery.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Default celery configuration.""" + from __future__ import annotations import json diff --git a/airflow/providers/cloudant/hooks/cloudant.py b/airflow/providers/cloudant/hooks/cloudant.py index 873462ccbf663..41a2316ca89ba 100644 --- a/airflow/providers/cloudant/hooks/cloudant.py +++ b/airflow/providers/cloudant/hooks/cloudant.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Cloudant.""" + from __future__ import annotations from typing import Any diff --git a/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py b/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py index 44d464ac25aba..a53af7d6e30e9 100644 --- a/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py +++ b/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Executes task in a Kubernetes POD.""" + from __future__ import annotations from kubernetes.client import ApiClient, models as k8s diff --git a/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py b/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py index c023bbf1983ff..f9bf574192168 100644 --- a/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py +++ b/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py @@ -21,6 +21,7 @@ For more information on how the KubernetesExecutor works, take a look at the guide: :doc:`/kubernetes_executor` """ + from __future__ import annotations import contextlib diff --git a/airflow/providers/cncf/kubernetes/k8s_model.py b/airflow/providers/cncf/kubernetes/k8s_model.py index cff12d057bcad..930b194a2dbea 100644 --- a/airflow/providers/cncf/kubernetes/k8s_model.py +++ b/airflow/providers/cncf/kubernetes/k8s_model.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Classes for interacting with Kubernetes API.""" + from __future__ import annotations from abc import ABC, abstractmethod diff --git a/airflow/providers/cncf/kubernetes/kube_client.py b/airflow/providers/cncf/kubernetes/kube_client.py index e6d79f39a694e..3a5c099f59518 100644 --- a/airflow/providers/cncf/kubernetes/kube_client.py +++ b/airflow/providers/cncf/kubernetes/kube_client.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Client for kubernetes communication.""" + from __future__ import annotations import logging diff --git a/airflow/providers/cncf/kubernetes/operators/custom_object_launcher.py b/airflow/providers/cncf/kubernetes/operators/custom_object_launcher.py index 621710f19cd5c..fc174513535a2 100644 --- a/airflow/providers/cncf/kubernetes/operators/custom_object_launcher.py +++ b/airflow/providers/cncf/kubernetes/operators/custom_object_launcher.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Launches Custom object.""" + from __future__ import annotations import time diff --git a/airflow/providers/cncf/kubernetes/operators/job.py b/airflow/providers/cncf/kubernetes/operators/job.py index 6f06f88ea5cf5..7be3488033469 100644 --- a/airflow/providers/cncf/kubernetes/operators/job.py +++ b/airflow/providers/cncf/kubernetes/operators/job.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Executes a Kubernetes Job.""" + from __future__ import annotations import copy diff --git a/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py b/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py index f415d897d2f74..3b3e6f7d952d0 100644 --- a/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py +++ b/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module is deprecated. Please use :mod:`airflow.providers.cncf.kubernetes.operators.pod` instead.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/cncf/kubernetes/pod_generator.py b/airflow/providers/cncf/kubernetes/pod_generator.py index 2109e32e9476d..e9f413985fd0c 100644 --- a/airflow/providers/cncf/kubernetes/pod_generator.py +++ b/airflow/providers/cncf/kubernetes/pod_generator.py @@ -22,6 +22,7 @@ The advantage being that the full Kubernetes API is supported and no serialization need be written. """ + from __future__ import annotations import copy diff --git a/airflow/providers/cncf/kubernetes/pod_generator_deprecated.py b/airflow/providers/cncf/kubernetes/pod_generator_deprecated.py index d7d61ed14c2bc..92baf41e68ece 100644 --- a/airflow/providers/cncf/kubernetes/pod_generator_deprecated.py +++ b/airflow/providers/cncf/kubernetes/pod_generator_deprecated.py @@ -22,6 +22,7 @@ The advantage being that the full Kubernetes API is supported and no serialization need be written. """ + from __future__ import annotations import copy diff --git a/airflow/providers/cncf/kubernetes/pod_launcher_deprecated.py b/airflow/providers/cncf/kubernetes/pod_launcher_deprecated.py index b94a9c2b02b13..a1fcb3eaa2e7c 100644 --- a/airflow/providers/cncf/kubernetes/pod_launcher_deprecated.py +++ b/airflow/providers/cncf/kubernetes/pod_launcher_deprecated.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Launches pods.""" + from __future__ import annotations import json diff --git a/airflow/providers/cncf/kubernetes/python_kubernetes_script.py b/airflow/providers/cncf/kubernetes/python_kubernetes_script.py index 18ba98a753711..0a10234b001a0 100644 --- a/airflow/providers/cncf/kubernetes/python_kubernetes_script.py +++ b/airflow/providers/cncf/kubernetes/python_kubernetes_script.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Utilities for using the kubernetes decorator.""" + from __future__ import annotations import os diff --git a/airflow/providers/cncf/kubernetes/secret.py b/airflow/providers/cncf/kubernetes/secret.py index 4e0412743c3e0..692777de447cd 100644 --- a/airflow/providers/cncf/kubernetes/secret.py +++ b/airflow/providers/cncf/kubernetes/secret.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Classes for interacting with Kubernetes API.""" + from __future__ import annotations import copy diff --git a/airflow/providers/cncf/kubernetes/triggers/kubernetes_pod.py b/airflow/providers/cncf/kubernetes/triggers/kubernetes_pod.py index d6b1bbcaa5855..17ddc9aee8fa3 100644 --- a/airflow/providers/cncf/kubernetes/triggers/kubernetes_pod.py +++ b/airflow/providers/cncf/kubernetes/triggers/kubernetes_pod.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module is deprecated. Please use :mod:`airflow.providers.cncf.kubernetes.triggers.pod` instead.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/cncf/kubernetes/utils/pod_manager.py b/airflow/providers/cncf/kubernetes/utils/pod_manager.py index 80d7106b05d59..787757828de37 100644 --- a/airflow/providers/cncf/kubernetes/utils/pod_manager.py +++ b/airflow/providers/cncf/kubernetes/utils/pod_manager.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Launches PODs.""" + from __future__ import annotations import enum diff --git a/airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py b/airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py index 0fa3b61dd3f98..6cdc9febb0252 100644 --- a/airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py +++ b/airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Attach a sidecar container that blocks the pod from completing until Airflow pulls result data.""" + from __future__ import annotations import copy diff --git a/airflow/providers/common/sql/hooks/sql.py b/airflow/providers/common/sql/hooks/sql.py index 8bf37953e77c6..3b9e6fba1e63a 100644 --- a/airflow/providers/common/sql/hooks/sql.py +++ b/airflow/providers/common/sql/hooks/sql.py @@ -305,8 +305,7 @@ def run( handler: None = ..., split_statements: bool = ..., return_last: bool = ..., - ) -> None: - ... + ) -> None: ... @overload def run( @@ -317,8 +316,7 @@ def run( handler: Callable[[Any], T] = ..., split_statements: bool = ..., return_last: bool = ..., - ) -> tuple | list[tuple] | list[list[tuple] | tuple] | None: - ... + ) -> tuple | list[tuple] | list[list[tuple] | tuple] | None: ... def run( self, diff --git a/airflow/providers/databricks/hooks/databricks.py b/airflow/providers/databricks/hooks/databricks.py index 10390e7e88134..45b28ba0a2c4b 100644 --- a/airflow/providers/databricks/hooks/databricks.py +++ b/airflow/providers/databricks/hooks/databricks.py @@ -25,6 +25,7 @@ or the ``api/2.1/jobs/runs/submit`` `endpoint `_. """ + from __future__ import annotations import json diff --git a/airflow/providers/databricks/hooks/databricks_base.py b/airflow/providers/databricks/hooks/databricks_base.py index dfbd464b5ee62..32316d49bb6ee 100644 --- a/airflow/providers/databricks/hooks/databricks_base.py +++ b/airflow/providers/databricks/hooks/databricks_base.py @@ -22,6 +22,7 @@ operators talk to the ``api/2.0/jobs/runs/submit`` `endpoint `_. """ + from __future__ import annotations import copy diff --git a/airflow/providers/databricks/hooks/databricks_sql.py b/airflow/providers/databricks/hooks/databricks_sql.py index bc701c9975f2c..3115c6ef5e636 100644 --- a/airflow/providers/databricks/hooks/databricks_sql.py +++ b/airflow/providers/databricks/hooks/databricks_sql.py @@ -183,8 +183,7 @@ def run( handler: None = ..., split_statements: bool = ..., return_last: bool = ..., - ) -> None: - ... + ) -> None: ... @overload def run( @@ -195,8 +194,7 @@ def run( handler: Callable[[Any], T] = ..., split_statements: bool = ..., return_last: bool = ..., - ) -> tuple | list[tuple] | list[list[tuple] | tuple] | None: - ... + ) -> tuple | list[tuple] | list[list[tuple] | tuple] | None: ... def run( self, diff --git a/airflow/providers/databricks/operators/databricks.py b/airflow/providers/databricks/operators/databricks.py index 80fc77a41f02b..5e6527ccc9ee6 100644 --- a/airflow/providers/databricks/operators/databricks.py +++ b/airflow/providers/databricks/operators/databricks.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Databricks operators.""" + from __future__ import annotations import time diff --git a/airflow/providers/databricks/operators/databricks_repos.py b/airflow/providers/databricks/operators/databricks_repos.py index 67fd49323b157..42de7f290acb9 100644 --- a/airflow/providers/databricks/operators/databricks_repos.py +++ b/airflow/providers/databricks/operators/databricks_repos.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Databricks operators.""" + from __future__ import annotations import re diff --git a/airflow/providers/databricks/operators/databricks_sql.py b/airflow/providers/databricks/operators/databricks_sql.py index 8dc467d4a51c7..1975b4de2149d 100644 --- a/airflow/providers/databricks/operators/databricks_sql.py +++ b/airflow/providers/databricks/operators/databricks_sql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Databricks operators.""" + from __future__ import annotations import csv diff --git a/airflow/providers/docker/exceptions.py b/airflow/providers/docker/exceptions.py index 5162e180f8b68..b5eb0e6c11985 100644 --- a/airflow/providers/docker/exceptions.py +++ b/airflow/providers/docker/exceptions.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Exceptions used by Docker provider.""" + from __future__ import annotations from airflow.exceptions import AirflowException, AirflowSkipException diff --git a/airflow/providers/docker/operators/docker.py b/airflow/providers/docker/operators/docker.py index dcbb93748f0e2..4c79d82bf054f 100644 --- a/airflow/providers/docker/operators/docker.py +++ b/airflow/providers/docker/operators/docker.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Implements Docker operator.""" + from __future__ import annotations import ast diff --git a/airflow/providers/docker/operators/docker_swarm.py b/airflow/providers/docker/operators/docker_swarm.py index 54158db0ff72e..3e42708dccf23 100644 --- a/airflow/providers/docker/operators/docker_swarm.py +++ b/airflow/providers/docker/operators/docker_swarm.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Run ephemeral Docker Swarm services.""" + from __future__ import annotations import re diff --git a/airflow/providers/exasol/hooks/exasol.py b/airflow/providers/exasol/hooks/exasol.py index 81c9381b3af83..c35e57d8f8fa8 100644 --- a/airflow/providers/exasol/hooks/exasol.py +++ b/airflow/providers/exasol/hooks/exasol.py @@ -171,8 +171,7 @@ def run( handler: None = ..., split_statements: bool = ..., return_last: bool = ..., - ) -> None: - ... + ) -> None: ... @overload def run( @@ -183,8 +182,7 @@ def run( handler: Callable[[Any], T] = ..., split_statements: bool = ..., return_last: bool = ..., - ) -> tuple | list[tuple] | list[list[tuple] | tuple] | None: - ... + ) -> tuple | list[tuple] | list[list[tuple] | tuple] | None: ... def run( self, diff --git a/airflow/providers/fab/auth_manager/api/auth/backend/basic_auth.py b/airflow/providers/fab/auth_manager/api/auth/backend/basic_auth.py index d442352e934aa..ff7c2cc3b3742 100644 --- a/airflow/providers/fab/auth_manager/api/auth/backend/basic_auth.py +++ b/airflow/providers/fab/auth_manager/api/auth/backend/basic_auth.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Basic authentication backend.""" + from __future__ import annotations from functools import wraps diff --git a/airflow/providers/fab/auth_manager/cli_commands/role_command.py b/airflow/providers/fab/auth_manager/cli_commands/role_command.py index b94e61e2c523b..6bbebcb5a0a11 100644 --- a/airflow/providers/fab/auth_manager/cli_commands/role_command.py +++ b/airflow/providers/fab/auth_manager/cli_commands/role_command.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Roles sub-commands.""" + from __future__ import annotations import itertools diff --git a/airflow/providers/fab/auth_manager/cli_commands/sync_perm_command.py b/airflow/providers/fab/auth_manager/cli_commands/sync_perm_command.py index 550b2944ab5fc..da997a2cbe1c8 100644 --- a/airflow/providers/fab/auth_manager/cli_commands/sync_perm_command.py +++ b/airflow/providers/fab/auth_manager/cli_commands/sync_perm_command.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Sync permission command.""" + from __future__ import annotations from airflow.utils import cli as cli_utils diff --git a/airflow/providers/fab/auth_manager/cli_commands/user_command.py b/airflow/providers/fab/auth_manager/cli_commands/user_command.py index a9b48f79d9aff..3050a9e250e58 100644 --- a/airflow/providers/fab/auth_manager/cli_commands/user_command.py +++ b/airflow/providers/fab/auth_manager/cli_commands/user_command.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """User sub-commands.""" + from __future__ import annotations import functools diff --git a/airflow/providers/facebook/ads/hooks/ads.py b/airflow/providers/facebook/ads/hooks/ads.py index b8b9c8526dadd..a0ec0f42897ce 100644 --- a/airflow/providers/facebook/ads/hooks/ads.py +++ b/airflow/providers/facebook/ads/hooks/ads.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Facebook Ads Reporting hooks.""" + from __future__ import annotations import time diff --git a/airflow/providers/ftp/operators/ftp.py b/airflow/providers/ftp/operators/ftp.py index f38e663754fea..691df6824d345 100644 --- a/airflow/providers/ftp/operators/ftp.py +++ b/airflow/providers/ftp/operators/ftp.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains FTP operator.""" + from __future__ import annotations import os diff --git a/airflow/providers/github/hooks/github.py b/airflow/providers/github/hooks/github.py index cbd2d92522088..6be50fd31fec4 100644 --- a/airflow/providers/github/hooks/github.py +++ b/airflow/providers/github/hooks/github.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module allows you to connect to GitHub.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/ads/hooks/ads.py b/airflow/providers/google/ads/hooks/ads.py index 3323c15683130..6d598529af5e7 100644 --- a/airflow/providers/google/ads/hooks/ads.py +++ b/airflow/providers/google/ads/hooks/ads.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Ad hook.""" + from __future__ import annotations from functools import cached_property diff --git a/airflow/providers/google/ads/operators/ads.py b/airflow/providers/google/ads/operators/ads.py index fc05b1ad54e44..a1f2e9e1f6f6e 100644 --- a/airflow/providers/google/ads/operators/ads.py +++ b/airflow/providers/google/ads/operators/ads.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Ad to GCS operators.""" + from __future__ import annotations import csv diff --git a/airflow/providers/google/cloud/example_dags/example_cloud_sql_query.py b/airflow/providers/google/cloud/example_dags/example_cloud_sql_query.py index 040ce91515cfb..b883ed13cfd8d 100644 --- a/airflow/providers/google/cloud/example_dags/example_cloud_sql_query.py +++ b/airflow/providers/google/cloud/example_dags/example_cloud_sql_query.py @@ -35,6 +35,7 @@ * GCSQL_MYSQL_PUBLIC_IP - Public IP of the mysql database * GCSQL_MYSQL_PUBLIC_PORT - Port of the mysql database """ + from __future__ import annotations import os diff --git a/airflow/providers/google/cloud/example_dags/example_cloud_task.py b/airflow/providers/google/cloud/example_dags/example_cloud_task.py index 662199c23abc0..69755898767a2 100644 --- a/airflow/providers/google/cloud/example_dags/example_cloud_task.py +++ b/airflow/providers/google/cloud/example_dags/example_cloud_task.py @@ -24,6 +24,7 @@ * GCP_ZONE - Google Cloud zone where the cloud task queue exists. * QUEUE_NAME - Name of the cloud task queue. """ + from __future__ import annotations import os diff --git a/airflow/providers/google/cloud/example_dags/example_facebook_ads_to_gcs.py b/airflow/providers/google/cloud/example_dags/example_facebook_ads_to_gcs.py index a8b17ddeccac4..a47f272f85ed0 100644 --- a/airflow/providers/google/cloud/example_dags/example_facebook_ads_to_gcs.py +++ b/airflow/providers/google/cloud/example_dags/example_facebook_ads_to_gcs.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that shows how to use FacebookAdsReportToGcsOperator. """ + from __future__ import annotations import os diff --git a/airflow/providers/google/cloud/example_dags/example_looker.py b/airflow/providers/google/cloud/example_dags/example_looker.py index 1925d0fc2b78c..6171b825fed81 100644 --- a/airflow/providers/google/cloud/example_dags/example_looker.py +++ b/airflow/providers/google/cloud/example_dags/example_looker.py @@ -19,6 +19,7 @@ Example Airflow DAG that show how to use various Looker operators to submit PDT materialization job and manage it. """ + from __future__ import annotations from datetime import datetime diff --git a/airflow/providers/google/cloud/example_dags/example_presto_to_gcs.py b/airflow/providers/google/cloud/example_dags/example_presto_to_gcs.py index 3589976b46285..c94f0d4c54ac0 100644 --- a/airflow/providers/google/cloud/example_dags/example_presto_to_gcs.py +++ b/airflow/providers/google/cloud/example_dags/example_presto_to_gcs.py @@ -18,6 +18,7 @@ """ Example DAG using PrestoToGCSOperator. """ + from __future__ import annotations import os diff --git a/airflow/providers/google/cloud/example_dags/example_salesforce_to_gcs.py b/airflow/providers/google/cloud/example_dags/example_salesforce_to_gcs.py index 74a6b91cbe329..03b97c2cce189 100644 --- a/airflow/providers/google/cloud/example_dags/example_salesforce_to_gcs.py +++ b/airflow/providers/google/cloud/example_dags/example_salesforce_to_gcs.py @@ -17,6 +17,7 @@ """ Example Airflow DAG that shows how to use SalesforceToGcsOperator. """ + from __future__ import annotations import os diff --git a/airflow/providers/google/cloud/hooks/automl.py b/airflow/providers/google/cloud/hooks/automl.py index e6c80dc55304c..6dae1e36d6fab 100644 --- a/airflow/providers/google/cloud/hooks/automl.py +++ b/airflow/providers/google/cloud/hooks/automl.py @@ -22,6 +22,7 @@ PredictResponse """ + from __future__ import annotations from functools import cached_property diff --git a/airflow/providers/google/cloud/hooks/bigquery_dts.py b/airflow/providers/google/cloud/hooks/bigquery_dts.py index f2726197a2e87..c76956cac8772 100644 --- a/airflow/providers/google/cloud/hooks/bigquery_dts.py +++ b/airflow/providers/google/cloud/hooks/bigquery_dts.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a BigQuery Hook.""" + from __future__ import annotations from copy import copy diff --git a/airflow/providers/google/cloud/hooks/bigtable.py b/airflow/providers/google/cloud/hooks/bigtable.py index ef88f3d5d9b53..706cdfe5502a8 100644 --- a/airflow/providers/google/cloud/hooks/bigtable.py +++ b/airflow/providers/google/cloud/hooks/bigtable.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Bigtable Hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/cloud_build.py b/airflow/providers/google/cloud/hooks/cloud_build.py index dd02e5fd04628..2d6358a201aa7 100644 --- a/airflow/providers/google/cloud/hooks/cloud_build.py +++ b/airflow/providers/google/cloud/hooks/cloud_build.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Google Cloud Build service.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/cloud_memorystore.py b/airflow/providers/google/cloud/hooks/cloud_memorystore.py index 8337ed6897146..40126856704f6 100644 --- a/airflow/providers/google/cloud/hooks/cloud_memorystore.py +++ b/airflow/providers/google/cloud/hooks/cloud_memorystore.py @@ -25,6 +25,7 @@ pb memcache """ + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/cloud_sql.py b/airflow/providers/google/cloud/hooks/cloud_sql.py index b0c685ae9f42a..91d15811cfd7e 100644 --- a/airflow/providers/google/cloud/hooks/cloud_sql.py +++ b/airflow/providers/google/cloud/hooks/cloud_sql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud SQL Hook.""" + from __future__ import annotations import errno diff --git a/airflow/providers/google/cloud/hooks/compute.py b/airflow/providers/google/cloud/hooks/compute.py index 349029826bde3..de31c20c3b21d 100644 --- a/airflow/providers/google/cloud/hooks/compute.py +++ b/airflow/providers/google/cloud/hooks/compute.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Compute Engine Hook.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/hooks/dataflow.py b/airflow/providers/google/cloud/hooks/dataflow.py index cbce2b9bb8696..c19be1f50c83c 100644 --- a/airflow/providers/google/cloud/hooks/dataflow.py +++ b/airflow/providers/google/cloud/hooks/dataflow.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Dataflow Hook.""" + from __future__ import annotations import functools diff --git a/airflow/providers/google/cloud/hooks/datafusion.py b/airflow/providers/google/cloud/hooks/datafusion.py index a55737e588119..0ad99202fc859 100644 --- a/airflow/providers/google/cloud/hooks/datafusion.py +++ b/airflow/providers/google/cloud/hooks/datafusion.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google DataFusion hook.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/google/cloud/hooks/datapipeline.py b/airflow/providers/google/cloud/hooks/datapipeline.py index fc1abc9a56429..0e62562484043 100644 --- a/airflow/providers/google/cloud/hooks/datapipeline.py +++ b/airflow/providers/google/cloud/hooks/datapipeline.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Data Pipelines Hook.""" + from __future__ import annotations from typing import Sequence diff --git a/airflow/providers/google/cloud/hooks/dataplex.py b/airflow/providers/google/cloud/hooks/dataplex.py index 1e6709a8780f9..77d175f7d7573 100644 --- a/airflow/providers/google/cloud/hooks/dataplex.py +++ b/airflow/providers/google/cloud/hooks/dataplex.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataplex hook.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/hooks/dataprep.py b/airflow/providers/google/cloud/hooks/dataprep.py index 430d49696e137..ee6d55e0903df 100644 --- a/airflow/providers/google/cloud/hooks/dataprep.py +++ b/airflow/providers/google/cloud/hooks/dataprep.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataprep hook.""" + from __future__ import annotations import json diff --git a/airflow/providers/google/cloud/hooks/dataproc.py b/airflow/providers/google/cloud/hooks/dataproc.py index 4551b24384c7f..be03b5db1f7ab 100644 --- a/airflow/providers/google/cloud/hooks/dataproc.py +++ b/airflow/providers/google/cloud/hooks/dataproc.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Dataproc hook.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/hooks/dataproc_metastore.py b/airflow/providers/google/cloud/hooks/dataproc_metastore.py index 94549ea53f97c..9eff41240bab1 100644 --- a/airflow/providers/google/cloud/hooks/dataproc_metastore.py +++ b/airflow/providers/google/cloud/hooks/dataproc_metastore.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Dataproc Metastore hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Sequence diff --git a/airflow/providers/google/cloud/hooks/datastore.py b/airflow/providers/google/cloud/hooks/datastore.py index 90d971a10e753..345315c4532e4 100644 --- a/airflow/providers/google/cloud/hooks/datastore.py +++ b/airflow/providers/google/cloud/hooks/datastore.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Datastore hook.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/hooks/dlp.py b/airflow/providers/google/cloud/hooks/dlp.py index 41e609e1ad8ba..6d0ad9bb2d696 100644 --- a/airflow/providers/google/cloud/hooks/dlp.py +++ b/airflow/providers/google/cloud/hooks/dlp.py @@ -23,6 +23,7 @@ ImageRedactionConfig RedactImageRequest """ + from __future__ import annotations import re diff --git a/airflow/providers/google/cloud/hooks/functions.py b/airflow/providers/google/cloud/hooks/functions.py index a26c6bf56cf82..83c3d756b7d87 100644 --- a/airflow/providers/google/cloud/hooks/functions.py +++ b/airflow/providers/google/cloud/hooks/functions.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Functions Hook.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/hooks/gcs.py b/airflow/providers/google/cloud/hooks/gcs.py index 1547c41794056..d2d318cd05c5d 100644 --- a/airflow/providers/google/cloud/hooks/gcs.py +++ b/airflow/providers/google/cloud/hooks/gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Storage hook.""" + from __future__ import annotations import functools @@ -279,8 +280,7 @@ def download( timeout: int | None = DEFAULT_TIMEOUT, num_max_attempts: int | None = 1, user_project: str | None = None, - ) -> bytes: - ... + ) -> bytes: ... @overload def download( @@ -292,8 +292,7 @@ def download( timeout: int | None = DEFAULT_TIMEOUT, num_max_attempts: int | None = 1, user_project: str | None = None, - ) -> str: - ... + ) -> str: ... def download( self, diff --git a/airflow/providers/google/cloud/hooks/kms.py b/airflow/providers/google/cloud/hooks/kms.py index 4a2eac78d2a35..41a1ad64ab8b7 100644 --- a/airflow/providers/google/cloud/hooks/kms.py +++ b/airflow/providers/google/cloud/hooks/kms.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud KMS hook.""" + from __future__ import annotations import base64 diff --git a/airflow/providers/google/cloud/hooks/kubernetes_engine.py b/airflow/providers/google/cloud/hooks/kubernetes_engine.py index 0758a2b0d082a..011a6065f8347 100644 --- a/airflow/providers/google/cloud/hooks/kubernetes_engine.py +++ b/airflow/providers/google/cloud/hooks/kubernetes_engine.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Kubernetes Engine Hook.""" + from __future__ import annotations import contextlib diff --git a/airflow/providers/google/cloud/hooks/life_sciences.py b/airflow/providers/google/cloud/hooks/life_sciences.py index 6c2a0035b8589..b4fa0de9562e3 100644 --- a/airflow/providers/google/cloud/hooks/life_sciences.py +++ b/airflow/providers/google/cloud/hooks/life_sciences.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Google Cloud Life Sciences service.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/hooks/looker.py b/airflow/providers/google/cloud/hooks/looker.py index 98cb1f26cdcae..80d5a8ef64092 100644 --- a/airflow/providers/google/cloud/hooks/looker.py +++ b/airflow/providers/google/cloud/hooks/looker.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Looker hook.""" + from __future__ import annotations import json diff --git a/airflow/providers/google/cloud/hooks/mlengine.py b/airflow/providers/google/cloud/hooks/mlengine.py index 3a7739e8119cf..ac43c570c9228 100644 --- a/airflow/providers/google/cloud/hooks/mlengine.py +++ b/airflow/providers/google/cloud/hooks/mlengine.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google ML Engine Hook.""" + from __future__ import annotations import contextlib diff --git a/airflow/providers/google/cloud/hooks/natural_language.py b/airflow/providers/google/cloud/hooks/natural_language.py index 3d24261a69b2c..b4fbba5bebfd0 100644 --- a/airflow/providers/google/cloud/hooks/natural_language.py +++ b/airflow/providers/google/cloud/hooks/natural_language.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Natural Language Hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/os_login.py b/airflow/providers/google/cloud/hooks/os_login.py index 3b887eb395d34..053dd13b00d47 100644 --- a/airflow/providers/google/cloud/hooks/os_login.py +++ b/airflow/providers/google/cloud/hooks/os_login.py @@ -20,6 +20,7 @@ ImportSshPublicKeyResponse oslogin """ + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/pubsub.py b/airflow/providers/google/cloud/hooks/pubsub.py index 1da6a4c440638..3bccaa16df219 100644 --- a/airflow/providers/google/cloud/hooks/pubsub.py +++ b/airflow/providers/google/cloud/hooks/pubsub.py @@ -23,6 +23,7 @@ MessageStoragePolicy ReceivedMessage """ + from __future__ import annotations import warnings diff --git a/airflow/providers/google/cloud/hooks/secret_manager.py b/airflow/providers/google/cloud/hooks/secret_manager.py index 91d7cf11a0568..5bfea5ac5ef87 100644 --- a/airflow/providers/google/cloud/hooks/secret_manager.py +++ b/airflow/providers/google/cloud/hooks/secret_manager.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Secrets Manager service.""" + from __future__ import annotations from typing import Sequence diff --git a/airflow/providers/google/cloud/hooks/spanner.py b/airflow/providers/google/cloud/hooks/spanner.py index 5768368cd2af7..71715fba99d07 100644 --- a/airflow/providers/google/cloud/hooks/spanner.py +++ b/airflow/providers/google/cloud/hooks/spanner.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Spanner Hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Callable, NamedTuple, Sequence diff --git a/airflow/providers/google/cloud/hooks/speech_to_text.py b/airflow/providers/google/cloud/hooks/speech_to_text.py index fb2593f60a978..e346dfae65ebf 100644 --- a/airflow/providers/google/cloud/hooks/speech_to_text.py +++ b/airflow/providers/google/cloud/hooks/speech_to_text.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Speech Hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/stackdriver.py b/airflow/providers/google/cloud/hooks/stackdriver.py index d972d653c579c..751e978ab0e2b 100644 --- a/airflow/providers/google/cloud/hooks/stackdriver.py +++ b/airflow/providers/google/cloud/hooks/stackdriver.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Stackdriver operators.""" + from __future__ import annotations import contextlib diff --git a/airflow/providers/google/cloud/hooks/text_to_speech.py b/airflow/providers/google/cloud/hooks/text_to_speech.py index 3a04a7830cc15..ce7ead17bbc37 100644 --- a/airflow/providers/google/cloud/hooks/text_to_speech.py +++ b/airflow/providers/google/cloud/hooks/text_to_speech.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Text to Speech Hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/translate.py b/airflow/providers/google/cloud/hooks/translate.py index 145673ac84b1a..a97cc29d64879 100644 --- a/airflow/providers/google/cloud/hooks/translate.py +++ b/airflow/providers/google/cloud/hooks/translate.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Translate Hook.""" + from __future__ import annotations from typing import Sequence diff --git a/airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py b/airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py index 286fa63a1bd7c..5c6d56529d9fb 100644 --- a/airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +++ b/airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Vertex AI hook.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py b/airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py index 42437ecb5e753..f5494f9998c76 100644 --- a/airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py +++ b/airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Vertex AI hook.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py b/airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py index 3e4c8313b99d3..4f3743f95c376 100644 --- a/airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py +++ b/airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Vertex AI hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/vertex_ai/dataset.py b/airflow/providers/google/cloud/hooks/vertex_ai/dataset.py index 5db75b4f0919d..75ce0fd886630 100644 --- a/airflow/providers/google/cloud/hooks/vertex_ai/dataset.py +++ b/airflow/providers/google/cloud/hooks/vertex_ai/dataset.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Vertex AI hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py b/airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py index f8af5902a5cba..caa78a9a0f4f8 100644 --- a/airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py +++ b/airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Vertex AI hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py b/airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py index 880d45f821bc6..cdae323da3acf 100644 --- a/airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py +++ b/airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py @@ -22,6 +22,7 @@ JobServiceAsyncClient """ + from __future__ import annotations import asyncio diff --git a/airflow/providers/google/cloud/hooks/vertex_ai/pipeline_job.py b/airflow/providers/google/cloud/hooks/vertex_ai/pipeline_job.py index c1be11b6820bb..d38471e9fd380 100644 --- a/airflow/providers/google/cloud/hooks/vertex_ai/pipeline_job.py +++ b/airflow/providers/google/cloud/hooks/vertex_ai/pipeline_job.py @@ -21,6 +21,7 @@ aiplatform """ + from __future__ import annotations from typing import TYPE_CHECKING, Any, Sequence diff --git a/airflow/providers/google/cloud/hooks/video_intelligence.py b/airflow/providers/google/cloud/hooks/video_intelligence.py index a8cdb6b64ce74..8e37ab3e5622c 100644 --- a/airflow/providers/google/cloud/hooks/video_intelligence.py +++ b/airflow/providers/google/cloud/hooks/video_intelligence.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Video Intelligence Hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/hooks/vision.py b/airflow/providers/google/cloud/hooks/vision.py index 18615ae4223e4..47b033e7ef8e6 100644 --- a/airflow/providers/google/cloud/hooks/vision.py +++ b/airflow/providers/google/cloud/hooks/vision.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Vision Hook.""" + from __future__ import annotations from copy import deepcopy diff --git a/airflow/providers/google/cloud/links/automl.py b/airflow/providers/google/cloud/links/automl.py index cbb527cd06644..79561d5b48132 100644 --- a/airflow/providers/google/cloud/links/automl.py +++ b/airflow/providers/google/cloud/links/automl.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google AutoML links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/bigquery.py b/airflow/providers/google/cloud/links/bigquery.py index 2e6eb8b24cb45..3998a1c1f28be 100644 --- a/airflow/providers/google/cloud/links/bigquery.py +++ b/airflow/providers/google/cloud/links/bigquery.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google BigQuery links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/bigquery_dts.py b/airflow/providers/google/cloud/links/bigquery_dts.py index 4f8a5b32a5f8f..e8c57543da17b 100644 --- a/airflow/providers/google/cloud/links/bigquery_dts.py +++ b/airflow/providers/google/cloud/links/bigquery_dts.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google BigQuery Data Transfer links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/cloud_memorystore.py b/airflow/providers/google/cloud/links/cloud_memorystore.py index 1ab253f65ebf1..c9c9d468dd306 100644 --- a/airflow/providers/google/cloud/links/cloud_memorystore.py +++ b/airflow/providers/google/cloud/links/cloud_memorystore.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Cloud Memorystore links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/cloud_sql.py b/airflow/providers/google/cloud/links/cloud_sql.py index c3dd81b90370c..a2373e0d1619b 100644 --- a/airflow/providers/google/cloud/links/cloud_sql.py +++ b/airflow/providers/google/cloud/links/cloud_sql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud SQL links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/cloud_tasks.py b/airflow/providers/google/cloud/links/cloud_tasks.py index 07bb959cf2f7a..10a37b27e64c0 100644 --- a/airflow/providers/google/cloud/links/cloud_tasks.py +++ b/airflow/providers/google/cloud/links/cloud_tasks.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Tasks links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/compute.py b/airflow/providers/google/cloud/links/compute.py index 62eeaa6967ffa..12680baf816e6 100644 --- a/airflow/providers/google/cloud/links/compute.py +++ b/airflow/providers/google/cloud/links/compute.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Compute Engine links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/datacatalog.py b/airflow/providers/google/cloud/links/datacatalog.py index 695b0a643a2bf..4cc15dd97af75 100644 --- a/airflow/providers/google/cloud/links/datacatalog.py +++ b/airflow/providers/google/cloud/links/datacatalog.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Data Catalog links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/dataflow.py b/airflow/providers/google/cloud/links/dataflow.py index 3c8b8e92d8705..54325ee52e0d1 100644 --- a/airflow/providers/google/cloud/links/dataflow.py +++ b/airflow/providers/google/cloud/links/dataflow.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataflow links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/dataform.py b/airflow/providers/google/cloud/links/dataform.py index 99b316a325e0d..3d94f4c5b142a 100644 --- a/airflow/providers/google/cloud/links/dataform.py +++ b/airflow/providers/google/cloud/links/dataform.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataflow links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/datafusion.py b/airflow/providers/google/cloud/links/datafusion.py index c31cf09b42e65..8b325e7d3ed3e 100644 --- a/airflow/providers/google/cloud/links/datafusion.py +++ b/airflow/providers/google/cloud/links/datafusion.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Data Fusion links.""" + from __future__ import annotations from typing import TYPE_CHECKING, ClassVar diff --git a/airflow/providers/google/cloud/links/dataplex.py b/airflow/providers/google/cloud/links/dataplex.py index 1fe6af05f2bde..80d4b2cb9c07d 100644 --- a/airflow/providers/google/cloud/links/dataplex.py +++ b/airflow/providers/google/cloud/links/dataplex.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataplex links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/dataproc.py b/airflow/providers/google/cloud/links/dataproc.py index a7804d050d1db..5ca4bfdb0a965 100644 --- a/airflow/providers/google/cloud/links/dataproc.py +++ b/airflow/providers/google/cloud/links/dataproc.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataproc links.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/google/cloud/links/mlengine.py b/airflow/providers/google/cloud/links/mlengine.py index 20e2a447467dc..88a111a819d3a 100644 --- a/airflow/providers/google/cloud/links/mlengine.py +++ b/airflow/providers/google/cloud/links/mlengine.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google ML Engine links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/pubsub.py b/airflow/providers/google/cloud/links/pubsub.py index a8aed4fc8e23a..0ab8dd97e23e5 100644 --- a/airflow/providers/google/cloud/links/pubsub.py +++ b/airflow/providers/google/cloud/links/pubsub.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Pub/Sub links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/spanner.py b/airflow/providers/google/cloud/links/spanner.py index 85c669ba556c4..2a9d5e09bf155 100644 --- a/airflow/providers/google/cloud/links/spanner.py +++ b/airflow/providers/google/cloud/links/spanner.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Spanner links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/stackdriver.py b/airflow/providers/google/cloud/links/stackdriver.py index 2c516f932f761..0dbc27a0d5cf0 100644 --- a/airflow/providers/google/cloud/links/stackdriver.py +++ b/airflow/providers/google/cloud/links/stackdriver.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Stackdriver links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/links/workflows.py b/airflow/providers/google/cloud/links/workflows.py index 52e4b4c42d60e..f063c7de700e6 100644 --- a/airflow/providers/google/cloud/links/workflows.py +++ b/airflow/providers/google/cloud/links/workflows.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Workflows links.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/log/stackdriver_task_handler.py b/airflow/providers/google/cloud/log/stackdriver_task_handler.py index f214b85861acf..bfeee9f12ac18 100644 --- a/airflow/providers/google/cloud/log/stackdriver_task_handler.py +++ b/airflow/providers/google/cloud/log/stackdriver_task_handler.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Handler that integrates with Stackdriver.""" + from __future__ import annotations import logging diff --git a/airflow/providers/google/cloud/operators/automl.py b/airflow/providers/google/cloud/operators/automl.py index a30bd766453da..54d31025c0ca2 100644 --- a/airflow/providers/google/cloud/operators/automl.py +++ b/airflow/providers/google/cloud/operators/automl.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google AutoML operators.""" + from __future__ import annotations import ast diff --git a/airflow/providers/google/cloud/operators/bigquery.py b/airflow/providers/google/cloud/operators/bigquery.py index bb75b068b1250..47b6d228d5947 100644 --- a/airflow/providers/google/cloud/operators/bigquery.py +++ b/airflow/providers/google/cloud/operators/bigquery.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google BigQuery operators.""" + from __future__ import annotations import enum diff --git a/airflow/providers/google/cloud/operators/bigquery_dts.py b/airflow/providers/google/cloud/operators/bigquery_dts.py index 50948a0614a2c..32e05b6504a35 100644 --- a/airflow/providers/google/cloud/operators/bigquery_dts.py +++ b/airflow/providers/google/cloud/operators/bigquery_dts.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google BigQuery Data Transfer Service operators.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/operators/bigtable.py b/airflow/providers/google/cloud/operators/bigtable.py index ffdf96c36c135..7437fa79dec3a 100644 --- a/airflow/providers/google/cloud/operators/bigtable.py +++ b/airflow/providers/google/cloud/operators/bigtable.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Bigtable operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Iterable, Sequence diff --git a/airflow/providers/google/cloud/operators/cloud_base.py b/airflow/providers/google/cloud/operators/cloud_base.py index bca8734c9b19b..f5c7af50eba2d 100644 --- a/airflow/providers/google/cloud/operators/cloud_base.py +++ b/airflow/providers/google/cloud/operators/cloud_base.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google API base operator.""" + from __future__ import annotations from google.api_core.gapic_v1.method import DEFAULT diff --git a/airflow/providers/google/cloud/operators/cloud_build.py b/airflow/providers/google/cloud/operators/cloud_build.py index 6a10fd1b2d38d..b3af1316893a8 100644 --- a/airflow/providers/google/cloud/operators/cloud_build.py +++ b/airflow/providers/google/cloud/operators/cloud_build.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Operators that integrates with Google Cloud Build service.""" + from __future__ import annotations import json diff --git a/airflow/providers/google/cloud/operators/cloud_memorystore.py b/airflow/providers/google/cloud/operators/cloud_memorystore.py index 54e9ff7ef79c2..0a71f7a0c006c 100644 --- a/airflow/providers/google/cloud/operators/cloud_memorystore.py +++ b/airflow/providers/google/cloud/operators/cloud_memorystore.py @@ -23,6 +23,7 @@ FieldMask memcache """ + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/cloud_sql.py b/airflow/providers/google/cloud/operators/cloud_sql.py index 9589cfa42eb62..559577358924b 100644 --- a/airflow/providers/google/cloud/operators/cloud_sql.py +++ b/airflow/providers/google/cloud/operators/cloud_sql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud SQL operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Iterable, Mapping, Sequence diff --git a/airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py b/airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py index 077edc31d785e..a0d48778ce53b 100644 --- a/airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py +++ b/airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Transfer operators.""" + from __future__ import annotations from copy import deepcopy diff --git a/airflow/providers/google/cloud/operators/compute.py b/airflow/providers/google/cloud/operators/compute.py index ec7187e5988ad..fa4f1c3a8fe8e 100644 --- a/airflow/providers/google/cloud/operators/compute.py +++ b/airflow/providers/google/cloud/operators/compute.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Compute Engine operators.""" + from __future__ import annotations from copy import deepcopy diff --git a/airflow/providers/google/cloud/operators/dataflow.py b/airflow/providers/google/cloud/operators/dataflow.py index cdc1bca65a457..99d85860f7d5c 100644 --- a/airflow/providers/google/cloud/operators/dataflow.py +++ b/airflow/providers/google/cloud/operators/dataflow.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataflow operators.""" + from __future__ import annotations import copy diff --git a/airflow/providers/google/cloud/operators/datafusion.py b/airflow/providers/google/cloud/operators/datafusion.py index 9071d01e9566e..ce8fe6be17e14 100644 --- a/airflow/providers/google/cloud/operators/datafusion.py +++ b/airflow/providers/google/cloud/operators/datafusion.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google DataFusion operators.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/operators/datapipeline.py b/airflow/providers/google/cloud/operators/datapipeline.py index a6e371dc8e77f..d95ef579b9bcd 100644 --- a/airflow/providers/google/cloud/operators/datapipeline.py +++ b/airflow/providers/google/cloud/operators/datapipeline.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Data Pipelines operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/dataprep.py b/airflow/providers/google/cloud/operators/dataprep.py index 59710293e6b16..06b77db79177f 100644 --- a/airflow/providers/google/cloud/operators/dataprep.py +++ b/airflow/providers/google/cloud/operators/dataprep.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Dataprep operator.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/dataproc.py b/airflow/providers/google/cloud/operators/dataproc.py index 6c273b92a8a8e..cef7c6fdf3a2f 100644 --- a/airflow/providers/google/cloud/operators/dataproc.py +++ b/airflow/providers/google/cloud/operators/dataproc.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataproc operators.""" + from __future__ import annotations import inspect diff --git a/airflow/providers/google/cloud/operators/dataproc_metastore.py b/airflow/providers/google/cloud/operators/dataproc_metastore.py index af88728fb6566..10056cdff5d99 100644 --- a/airflow/providers/google/cloud/operators/dataproc_metastore.py +++ b/airflow/providers/google/cloud/operators/dataproc_metastore.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataproc Metastore operators.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/operators/datastore.py b/airflow/providers/google/cloud/operators/datastore.py index c093296e003a4..8617426f79c41 100644 --- a/airflow/providers/google/cloud/operators/datastore.py +++ b/airflow/providers/google/cloud/operators/datastore.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Datastore operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Sequence diff --git a/airflow/providers/google/cloud/operators/functions.py b/airflow/providers/google/cloud/operators/functions.py index c529cf3ac62b2..b7836160666f6 100644 --- a/airflow/providers/google/cloud/operators/functions.py +++ b/airflow/providers/google/cloud/operators/functions.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Functions operators.""" + from __future__ import annotations import re diff --git a/airflow/providers/google/cloud/operators/gcs.py b/airflow/providers/google/cloud/operators/gcs.py index c68988832e8bf..c311c8b4ed6b8 100644 --- a/airflow/providers/google/cloud/operators/gcs.py +++ b/airflow/providers/google/cloud/operators/gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Storage Bucket operator.""" + from __future__ import annotations import datetime diff --git a/airflow/providers/google/cloud/operators/kubernetes_engine.py b/airflow/providers/google/cloud/operators/kubernetes_engine.py index 0fc4db56c8aee..34bd44978f255 100644 --- a/airflow/providers/google/cloud/operators/kubernetes_engine.py +++ b/airflow/providers/google/cloud/operators/kubernetes_engine.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Kubernetes Engine operators.""" + from __future__ import annotations import re diff --git a/airflow/providers/google/cloud/operators/life_sciences.py b/airflow/providers/google/cloud/operators/life_sciences.py index ab21ef14d7e37..ce8f36ccdeb1a 100644 --- a/airflow/providers/google/cloud/operators/life_sciences.py +++ b/airflow/providers/google/cloud/operators/life_sciences.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Operators that interact with Google Cloud Life Sciences service.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/looker.py b/airflow/providers/google/cloud/operators/looker.py index 8cc22e9663652..ad18f2c2e9cb7 100644 --- a/airflow/providers/google/cloud/operators/looker.py +++ b/airflow/providers/google/cloud/operators/looker.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Looker operators.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/operators/natural_language.py b/airflow/providers/google/cloud/operators/natural_language.py index 0389350acc6d1..ea58ab9c33a40 100644 --- a/airflow/providers/google/cloud/operators/natural_language.py +++ b/airflow/providers/google/cloud/operators/natural_language.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Language operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence, Tuple diff --git a/airflow/providers/google/cloud/operators/pubsub.py b/airflow/providers/google/cloud/operators/pubsub.py index b4f2315dc794e..f076cb9ec0aae 100644 --- a/airflow/providers/google/cloud/operators/pubsub.py +++ b/airflow/providers/google/cloud/operators/pubsub.py @@ -22,6 +22,7 @@ MessageStoragePolicy """ + from __future__ import annotations from typing import TYPE_CHECKING, Any, Callable, Sequence diff --git a/airflow/providers/google/cloud/operators/spanner.py b/airflow/providers/google/cloud/operators/spanner.py index 187e022c5fefa..8e287625e24e1 100644 --- a/airflow/providers/google/cloud/operators/spanner.py +++ b/airflow/providers/google/cloud/operators/spanner.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Spanner operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/speech_to_text.py b/airflow/providers/google/cloud/operators/speech_to_text.py index 867ad0b1dde8c..bac79959f87d6 100644 --- a/airflow/providers/google/cloud/operators/speech_to_text.py +++ b/airflow/providers/google/cloud/operators/speech_to_text.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Speech to Text operator.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/text_to_speech.py b/airflow/providers/google/cloud/operators/text_to_speech.py index 398b4950e5bca..7c7678f7bbe99 100644 --- a/airflow/providers/google/cloud/operators/text_to_speech.py +++ b/airflow/providers/google/cloud/operators/text_to_speech.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Text to Speech operator.""" + from __future__ import annotations from tempfile import NamedTemporaryFile diff --git a/airflow/providers/google/cloud/operators/translate.py b/airflow/providers/google/cloud/operators/translate.py index ed854e0f9858f..2a17ebcafa91f 100644 --- a/airflow/providers/google/cloud/operators/translate.py +++ b/airflow/providers/google/cloud/operators/translate.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Translate operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/translate_speech.py b/airflow/providers/google/cloud/operators/translate_speech.py index 1edc9b6b4dad9..b74f7a7131a76 100644 --- a/airflow/providers/google/cloud/operators/translate_speech.py +++ b/airflow/providers/google/cloud/operators/translate_speech.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Translate Speech operator.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/vertex_ai/custom_job.py b/airflow/providers/google/cloud/operators/vertex_ai/custom_job.py index dcd5acbcad271..ba34f633acb31 100644 --- a/airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +++ b/airflow/providers/google/cloud/operators/vertex_ai/custom_job.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Vertex AI operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/vertex_ai/dataset.py b/airflow/providers/google/cloud/operators/vertex_ai/dataset.py index 900d926472def..5aae8b07e521a 100644 --- a/airflow/providers/google/cloud/operators/vertex_ai/dataset.py +++ b/airflow/providers/google/cloud/operators/vertex_ai/dataset.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Vertex AI operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py b/airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py index 1510f8fcfac19..b54496db61852 100644 --- a/airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py +++ b/airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Vertex AI operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Sequence diff --git a/airflow/providers/google/cloud/operators/video_intelligence.py b/airflow/providers/google/cloud/operators/video_intelligence.py index 8bf696fa2f0da..da524c872fde9 100644 --- a/airflow/providers/google/cloud/operators/video_intelligence.py +++ b/airflow/providers/google/cloud/operators/video_intelligence.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Vision operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/operators/vision.py b/airflow/providers/google/cloud/operators/vision.py index 7abada3928ee2..c7c8ef18c7e02 100644 --- a/airflow/providers/google/cloud/operators/vision.py +++ b/airflow/providers/google/cloud/operators/vision.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Vision operator.""" + from __future__ import annotations from copy import deepcopy diff --git a/airflow/providers/google/cloud/secrets/secret_manager.py b/airflow/providers/google/cloud/secrets/secret_manager.py index 9ed345b99ed8c..c507fe3ef9472 100644 --- a/airflow/providers/google/cloud/secrets/secret_manager.py +++ b/airflow/providers/google/cloud/secrets/secret_manager.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Objects relating to sourcing connections from Google Cloud Secrets Manager.""" + from __future__ import annotations import logging diff --git a/airflow/providers/google/cloud/sensors/bigquery.py b/airflow/providers/google/cloud/sensors/bigquery.py index a8aba52c772ff..72e03d7aba54e 100644 --- a/airflow/providers/google/cloud/sensors/bigquery.py +++ b/airflow/providers/google/cloud/sensors/bigquery.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google BigQuery sensors.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/google/cloud/sensors/bigquery_dts.py b/airflow/providers/google/cloud/sensors/bigquery_dts.py index 55cc6dc4aef0e..52095c198024d 100644 --- a/airflow/providers/google/cloud/sensors/bigquery_dts.py +++ b/airflow/providers/google/cloud/sensors/bigquery_dts.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google BigQuery Data Transfer Service sensor.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/sensors/bigtable.py b/airflow/providers/google/cloud/sensors/bigtable.py index 0b823f0a1a07d..57f825c005fbf 100644 --- a/airflow/providers/google/cloud/sensors/bigtable.py +++ b/airflow/providers/google/cloud/sensors/bigtable.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Bigtable sensor.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/sensors/cloud_storage_transfer_service.py b/airflow/providers/google/cloud/sensors/cloud_storage_transfer_service.py index 60edca6337d1f..639a5775a8067 100644 --- a/airflow/providers/google/cloud/sensors/cloud_storage_transfer_service.py +++ b/airflow/providers/google/cloud/sensors/cloud_storage_transfer_service.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Transfer sensor.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/sensors/dataflow.py b/airflow/providers/google/cloud/sensors/dataflow.py index c9f32588d54a6..10997a35f134c 100644 --- a/airflow/providers/google/cloud/sensors/dataflow.py +++ b/airflow/providers/google/cloud/sensors/dataflow.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Dataflow sensor.""" + from __future__ import annotations from typing import TYPE_CHECKING, Callable, Sequence diff --git a/airflow/providers/google/cloud/sensors/dataform.py b/airflow/providers/google/cloud/sensors/dataform.py index 45c74627a7c52..6ad72161c7eb8 100644 --- a/airflow/providers/google/cloud/sensors/dataform.py +++ b/airflow/providers/google/cloud/sensors/dataform.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Dataform sensor.""" + from __future__ import annotations from typing import TYPE_CHECKING, Iterable, Sequence diff --git a/airflow/providers/google/cloud/sensors/datafusion.py b/airflow/providers/google/cloud/sensors/datafusion.py index b151a6fae7ea0..47b9e529fcabc 100644 --- a/airflow/providers/google/cloud/sensors/datafusion.py +++ b/airflow/providers/google/cloud/sensors/datafusion.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Data Fusion sensors.""" + from __future__ import annotations from typing import TYPE_CHECKING, Iterable, Sequence diff --git a/airflow/providers/google/cloud/sensors/dataplex.py b/airflow/providers/google/cloud/sensors/dataplex.py index 05d25316bb2bd..97af1acf05ddf 100644 --- a/airflow/providers/google/cloud/sensors/dataplex.py +++ b/airflow/providers/google/cloud/sensors/dataplex.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataplex sensors.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/sensors/dataprep.py b/airflow/providers/google/cloud/sensors/dataprep.py index d30f6e18e872c..bcf7df05b1bed 100644 --- a/airflow/providers/google/cloud/sensors/dataprep.py +++ b/airflow/providers/google/cloud/sensors/dataprep.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Dataprep Job sensor.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/sensors/dataproc.py b/airflow/providers/google/cloud/sensors/dataproc.py index 2acd695dba110..5ae159558a9ad 100644 --- a/airflow/providers/google/cloud/sensors/dataproc.py +++ b/airflow/providers/google/cloud/sensors/dataproc.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Dataproc Job sensor.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/cloud/sensors/gcs.py b/airflow/providers/google/cloud/sensors/gcs.py index 92ec7b92cec39..bebd16121516b 100644 --- a/airflow/providers/google/cloud/sensors/gcs.py +++ b/airflow/providers/google/cloud/sensors/gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Storage sensors.""" + from __future__ import annotations import os diff --git a/airflow/providers/google/cloud/sensors/looker.py b/airflow/providers/google/cloud/sensors/looker.py index 55257346275b7..8c1f618b33675 100644 --- a/airflow/providers/google/cloud/sensors/looker.py +++ b/airflow/providers/google/cloud/sensors/looker.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Looker sensors.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/cloud/sensors/pubsub.py b/airflow/providers/google/cloud/sensors/pubsub.py index 077944b3b3080..47a442a820fad 100644 --- a/airflow/providers/google/cloud/sensors/pubsub.py +++ b/airflow/providers/google/cloud/sensors/pubsub.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google PubSub sensor.""" + from __future__ import annotations from datetime import timedelta diff --git a/airflow/providers/google/cloud/sensors/tasks.py b/airflow/providers/google/cloud/sensors/tasks.py index ce04884db08a2..059ddf75bb8fd 100644 --- a/airflow/providers/google/cloud/sensors/tasks.py +++ b/airflow/providers/google/cloud/sensors/tasks.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Task sensor.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py b/airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py index 671ad33488e27..7be147d09b607 100644 --- a/airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py +++ b/airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google BigQuery to BigQuery operator.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/cloud/transfers/bigquery_to_gcs.py b/airflow/providers/google/cloud/transfers/bigquery_to_gcs.py index c378a64a9ff8f..8167558ed0bd1 100644 --- a/airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +++ b/airflow/providers/google/cloud/transfers/bigquery_to_gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google BigQuery to Google Cloud Storage operator.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Sequence diff --git a/airflow/providers/google/cloud/transfers/bigquery_to_mssql.py b/airflow/providers/google/cloud/transfers/bigquery_to_mssql.py index e3720b3272e93..c251ec5615aa1 100644 --- a/airflow/providers/google/cloud/transfers/bigquery_to_mssql.py +++ b/airflow/providers/google/cloud/transfers/bigquery_to_mssql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google BigQuery to MSSQL operator.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/google/cloud/transfers/bigquery_to_mysql.py b/airflow/providers/google/cloud/transfers/bigquery_to_mysql.py index 66084a6fb3ca3..a2c77f70e18df 100644 --- a/airflow/providers/google/cloud/transfers/bigquery_to_mysql.py +++ b/airflow/providers/google/cloud/transfers/bigquery_to_mysql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google BigQuery to MySQL operator.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/google/cloud/transfers/bigquery_to_postgres.py b/airflow/providers/google/cloud/transfers/bigquery_to_postgres.py index 5918d48fa2445..3af38e0c922e7 100644 --- a/airflow/providers/google/cloud/transfers/bigquery_to_postgres.py +++ b/airflow/providers/google/cloud/transfers/bigquery_to_postgres.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google BigQuery to PostgreSQL operator.""" + from __future__ import annotations from airflow.providers.google.cloud.transfers.bigquery_to_sql import BigQueryToSqlBaseOperator diff --git a/airflow/providers/google/cloud/transfers/bigquery_to_sql.py b/airflow/providers/google/cloud/transfers/bigquery_to_sql.py index 42b6758d47eec..219e11c7cef48 100644 --- a/airflow/providers/google/cloud/transfers/bigquery_to_sql.py +++ b/airflow/providers/google/cloud/transfers/bigquery_to_sql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Base operator for BigQuery to SQL operators.""" + from __future__ import annotations import abc diff --git a/airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py b/airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py index 075066c6003b0..57769644ff563 100644 --- a/airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py +++ b/airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Facebook Ad Reporting to GCS operators.""" + from __future__ import annotations import csv diff --git a/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py b/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py index be4b65791db35..0632e54b79fd3 100644 --- a/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +++ b/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Storage to BigQuery operator.""" + from __future__ import annotations import json diff --git a/airflow/providers/google/cloud/transfers/gcs_to_gcs.py b/airflow/providers/google/cloud/transfers/gcs_to_gcs.py index addcb58f69558..8d07dca58b7b4 100644 --- a/airflow/providers/google/cloud/transfers/gcs_to_gcs.py +++ b/airflow/providers/google/cloud/transfers/gcs_to_gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Storage operator.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/google/cloud/transfers/gcs_to_sftp.py b/airflow/providers/google/cloud/transfers/gcs_to_sftp.py index b23fe03c5e16b..15be76a957870 100644 --- a/airflow/providers/google/cloud/transfers/gcs_to_sftp.py +++ b/airflow/providers/google/cloud/transfers/gcs_to_sftp.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Storage to SFTP operator.""" + from __future__ import annotations import os diff --git a/airflow/providers/google/cloud/transfers/local_to_gcs.py b/airflow/providers/google/cloud/transfers/local_to_gcs.py index c64d6c7824870..3bd2855bd046c 100644 --- a/airflow/providers/google/cloud/transfers/local_to_gcs.py +++ b/airflow/providers/google/cloud/transfers/local_to_gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains operator for uploading local file(s) to GCS.""" + from __future__ import annotations import os diff --git a/airflow/providers/google/cloud/transfers/mssql_to_gcs.py b/airflow/providers/google/cloud/transfers/mssql_to_gcs.py index ab05518fc5e51..7668f51e6cf65 100644 --- a/airflow/providers/google/cloud/transfers/mssql_to_gcs.py +++ b/airflow/providers/google/cloud/transfers/mssql_to_gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """MsSQL to GCS operator.""" + from __future__ import annotations import datetime diff --git a/airflow/providers/google/cloud/transfers/mysql_to_gcs.py b/airflow/providers/google/cloud/transfers/mysql_to_gcs.py index 877df731ca44c..a9a1f5130d9cf 100644 --- a/airflow/providers/google/cloud/transfers/mysql_to_gcs.py +++ b/airflow/providers/google/cloud/transfers/mysql_to_gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """MySQL to GCS operator.""" + from __future__ import annotations import base64 diff --git a/airflow/providers/google/cloud/transfers/postgres_to_gcs.py b/airflow/providers/google/cloud/transfers/postgres_to_gcs.py index f97c3c7eeec12..41e2938ad674d 100644 --- a/airflow/providers/google/cloud/transfers/postgres_to_gcs.py +++ b/airflow/providers/google/cloud/transfers/postgres_to_gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """PostgreSQL to GCS operator.""" + from __future__ import annotations import datetime diff --git a/airflow/providers/google/cloud/transfers/sftp_to_gcs.py b/airflow/providers/google/cloud/transfers/sftp_to_gcs.py index 833edcda91bc4..12d9f056a07fb 100644 --- a/airflow/providers/google/cloud/transfers/sftp_to_gcs.py +++ b/airflow/providers/google/cloud/transfers/sftp_to_gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains SFTP to Google Cloud Storage operator.""" + from __future__ import annotations import os diff --git a/airflow/providers/google/cloud/transfers/sql_to_gcs.py b/airflow/providers/google/cloud/transfers/sql_to_gcs.py index 11f9df4c9a96f..49e2daa2ca1c4 100644 --- a/airflow/providers/google/cloud/transfers/sql_to_gcs.py +++ b/airflow/providers/google/cloud/transfers/sql_to_gcs.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Base operator for SQL to GCS operators.""" + from __future__ import annotations import abc diff --git a/airflow/providers/google/cloud/triggers/cloud_sql.py b/airflow/providers/google/cloud/triggers/cloud_sql.py index be1cd739d242c..256b384c081c4 100644 --- a/airflow/providers/google/cloud/triggers/cloud_sql.py +++ b/airflow/providers/google/cloud/triggers/cloud_sql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud SQL triggers.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/google/cloud/triggers/dataplex.py b/airflow/providers/google/cloud/triggers/dataplex.py index 241981603ae8b..07ac958ef4261 100644 --- a/airflow/providers/google/cloud/triggers/dataplex.py +++ b/airflow/providers/google/cloud/triggers/dataplex.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataplex triggers.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/google/cloud/triggers/dataproc.py b/airflow/providers/google/cloud/triggers/dataproc.py index d9abe62a92333..b26157e8b2582 100644 --- a/airflow/providers/google/cloud/triggers/dataproc.py +++ b/airflow/providers/google/cloud/triggers/dataproc.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Dataproc triggers.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/google/cloud/triggers/pubsub.py b/airflow/providers/google/cloud/triggers/pubsub.py index 51a530922bdec..cd513d299d51e 100644 --- a/airflow/providers/google/cloud/triggers/pubsub.py +++ b/airflow/providers/google/cloud/triggers/pubsub.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Pubsub triggers.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/google/cloud/utils/field_sanitizer.py b/airflow/providers/google/cloud/utils/field_sanitizer.py index ef2150824c183..8de95d6c945a3 100644 --- a/airflow/providers/google/cloud/utils/field_sanitizer.py +++ b/airflow/providers/google/cloud/utils/field_sanitizer.py @@ -67,7 +67,7 @@ >>> }, >>> } >>> } ->>> sanitizer=GcpBodyFieldSanitizer(FIELDS_TO_SANITIZE) +>>> sanitizer = GcpBodyFieldSanitizer(FIELDS_TO_SANITIZE) >>> sanitizer.sanitize(body) >>> json.dumps(body, indent=2) { @@ -96,6 +96,7 @@ arrays - the sanitizer iterates through all dictionaries in the array and searches components in all elements of the array. """ + from __future__ import annotations from airflow.exceptions import AirflowException diff --git a/airflow/providers/google/cloud/utils/field_validator.py b/airflow/providers/google/cloud/utils/field_validator.py index 2e5d6cc4e9d7f..b88987187a5dd 100644 --- a/airflow/providers/google/cloud/utils/field_validator.py +++ b/airflow/providers/google/cloud/utils/field_validator.py @@ -129,6 +129,7 @@ backwards-incompatible changes that might sometimes occur in the APIs. """ + from __future__ import annotations import re diff --git a/airflow/providers/google/cloud/utils/helpers.py b/airflow/providers/google/cloud/utils/helpers.py index 4ade5474f3448..032be27002081 100644 --- a/airflow/providers/google/cloud/utils/helpers.py +++ b/airflow/providers/google/cloud/utils/helpers.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains helper functions for Google Cloud operators.""" + from __future__ import annotations diff --git a/airflow/providers/google/cloud/utils/mlengine_operator_utils.py b/airflow/providers/google/cloud/utils/mlengine_operator_utils.py index 683ddcaa28b92..0c94e11c741c3 100644 --- a/airflow/providers/google/cloud/utils/mlengine_operator_utils.py +++ b/airflow/providers/google/cloud/utils/mlengine_operator_utils.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains helper functions for MLEngine operators.""" + from __future__ import annotations import base64 diff --git a/airflow/providers/google/cloud/utils/mlengine_prediction_summary.py b/airflow/providers/google/cloud/utils/mlengine_prediction_summary.py index 1f1f3fff667eb..d0a13378b479d 100644 --- a/airflow/providers/google/cloud/utils/mlengine_prediction_summary.py +++ b/airflow/providers/google/cloud/utils/mlengine_prediction_summary.py @@ -106,6 +106,7 @@ def metric_fn(inst): pcoll """ + from __future__ import annotations import argparse diff --git a/airflow/providers/google/cloud/utils/openlineage.py b/airflow/providers/google/cloud/utils/openlineage.py index 3e96fffe5af33..2121ba4ad8465 100644 --- a/airflow/providers/google/cloud/utils/openlineage.py +++ b/airflow/providers/google/cloud/utils/openlineage.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains code related to OpenLineage and lineage extraction.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any diff --git a/airflow/providers/google/common/auth_backend/google_openid.py b/airflow/providers/google/common/auth_backend/google_openid.py index fdbd06164da43..4a3f45fa4a3a8 100644 --- a/airflow/providers/google/common/auth_backend/google_openid.py +++ b/airflow/providers/google/common/auth_backend/google_openid.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Authentication backend that use Google credentials for authorization.""" + from __future__ import annotations import logging diff --git a/airflow/providers/google/common/hooks/base_google.py b/airflow/providers/google/common/hooks/base_google.py index f45caeba5dad4..13543243cb56b 100644 --- a/airflow/providers/google/common/hooks/base_google.py +++ b/airflow/providers/google/common/hooks/base_google.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud API base hook.""" + from __future__ import annotations import datetime diff --git a/airflow/providers/google/common/hooks/discovery_api.py b/airflow/providers/google/common/hooks/discovery_api.py index b1316fc0c933c..42e95ef280544 100644 --- a/airflow/providers/google/common/hooks/discovery_api.py +++ b/airflow/providers/google/common/hooks/discovery_api.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module allows you to connect to the Google Discovery API Service and query it.""" + from __future__ import annotations from typing import Sequence diff --git a/airflow/providers/google/common/links/storage.py b/airflow/providers/google/common/links/storage.py index 6b4cb94690c28..562a79355c7bd 100644 --- a/airflow/providers/google/common/links/storage.py +++ b/airflow/providers/google/common/links/storage.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a link for GCS Storage assets.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/google/common/utils/id_token_credentials.py b/airflow/providers/google/common/utils/id_token_credentials.py index fc758569247c8..fb1bb25ccafa3 100644 --- a/airflow/providers/google/common/utils/id_token_credentials.py +++ b/airflow/providers/google/common/utils/id_token_credentials.py @@ -28,6 +28,7 @@ RefreshError """ + from __future__ import annotations import json diff --git a/airflow/providers/google/firebase/hooks/firestore.py b/airflow/providers/google/firebase/hooks/firestore.py index 660806844ba5e..5804081e29ace 100644 --- a/airflow/providers/google/firebase/hooks/firestore.py +++ b/airflow/providers/google/firebase/hooks/firestore.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Google Cloud Firestore service.""" + from __future__ import annotations import time diff --git a/airflow/providers/google/go_module_utils.py b/airflow/providers/google/go_module_utils.py index 8e1f608191c3d..4c9b938819992 100644 --- a/airflow/providers/google/go_module_utils.py +++ b/airflow/providers/google/go_module_utils.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Utilities initializing and managing Go modules.""" + from __future__ import annotations import os diff --git a/airflow/providers/google/leveldb/hooks/leveldb.py b/airflow/providers/google/leveldb/hooks/leveldb.py index dffc4665ba706..db58308fbab59 100644 --- a/airflow/providers/google/leveldb/hooks/leveldb.py +++ b/airflow/providers/google/leveldb/hooks/leveldb.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Level DB.""" + from __future__ import annotations from airflow.exceptions import AirflowException, AirflowOptionalProviderFeatureException diff --git a/airflow/providers/google/marketing_platform/example_dags/example_display_video.py b/airflow/providers/google/marketing_platform/example_dags/example_display_video.py index a54d7e575be11..33abc67b639d2 100644 --- a/airflow/providers/google/marketing_platform/example_dags/example_display_video.py +++ b/airflow/providers/google/marketing_platform/example_dags/example_display_video.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that shows how to use DisplayVideo. """ + from __future__ import annotations import os diff --git a/airflow/providers/google/marketing_platform/hooks/analytics_admin.py b/airflow/providers/google/marketing_platform/hooks/analytics_admin.py index cff9e0e409681..55391535d4e86 100644 --- a/airflow/providers/google/marketing_platform/hooks/analytics_admin.py +++ b/airflow/providers/google/marketing_platform/hooks/analytics_admin.py @@ -24,6 +24,7 @@ ListAccountsPager ListGoogleAdsLinksPager """ + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/marketing_platform/hooks/campaign_manager.py b/airflow/providers/google/marketing_platform/hooks/campaign_manager.py index 72c34ff34af0b..08365e41b1c54 100644 --- a/airflow/providers/google/marketing_platform/hooks/campaign_manager.py +++ b/airflow/providers/google/marketing_platform/hooks/campaign_manager.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Campaign Manager hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Sequence diff --git a/airflow/providers/google/marketing_platform/hooks/display_video.py b/airflow/providers/google/marketing_platform/hooks/display_video.py index 373b3824eb6cb..f70f1009c35df 100644 --- a/airflow/providers/google/marketing_platform/hooks/display_video.py +++ b/airflow/providers/google/marketing_platform/hooks/display_video.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google DisplayVideo hook.""" + from __future__ import annotations from typing import Any, Sequence diff --git a/airflow/providers/google/marketing_platform/hooks/search_ads.py b/airflow/providers/google/marketing_platform/hooks/search_ads.py index 22ee48bea8642..85cc25c4583ec 100644 --- a/airflow/providers/google/marketing_platform/hooks/search_ads.py +++ b/airflow/providers/google/marketing_platform/hooks/search_ads.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Search Ads 360 hook.""" + from __future__ import annotations from typing import Any, Sequence diff --git a/airflow/providers/google/marketing_platform/operators/analytics.py b/airflow/providers/google/marketing_platform/operators/analytics.py index fb1609d4b0698..1d024e35605b7 100644 --- a/airflow/providers/google/marketing_platform/operators/analytics.py +++ b/airflow/providers/google/marketing_platform/operators/analytics.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Analytics 360 operators.""" + from __future__ import annotations import csv diff --git a/airflow/providers/google/marketing_platform/operators/analytics_admin.py b/airflow/providers/google/marketing_platform/operators/analytics_admin.py index a0138099f1a73..642315a3af174 100644 --- a/airflow/providers/google/marketing_platform/operators/analytics_admin.py +++ b/airflow/providers/google/marketing_platform/operators/analytics_admin.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Analytics 4 (GA4) operators.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Sequence diff --git a/airflow/providers/google/marketing_platform/operators/campaign_manager.py b/airflow/providers/google/marketing_platform/operators/campaign_manager.py index 739d1328892ae..918aa389dff7a 100644 --- a/airflow/providers/google/marketing_platform/operators/campaign_manager.py +++ b/airflow/providers/google/marketing_platform/operators/campaign_manager.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google CampaignManager operators.""" + from __future__ import annotations import json diff --git a/airflow/providers/google/marketing_platform/operators/display_video.py b/airflow/providers/google/marketing_platform/operators/display_video.py index 2df18939b8eb0..015f3f2db265a 100644 --- a/airflow/providers/google/marketing_platform/operators/display_video.py +++ b/airflow/providers/google/marketing_platform/operators/display_video.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google DisplayVideo operators.""" + from __future__ import annotations import csv diff --git a/airflow/providers/google/marketing_platform/operators/search_ads.py b/airflow/providers/google/marketing_platform/operators/search_ads.py index 87f3e14be7105..87b5b3f970071 100644 --- a/airflow/providers/google/marketing_platform/operators/search_ads.py +++ b/airflow/providers/google/marketing_platform/operators/search_ads.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Search Ads operators.""" + from __future__ import annotations import json diff --git a/airflow/providers/google/marketing_platform/sensors/campaign_manager.py b/airflow/providers/google/marketing_platform/sensors/campaign_manager.py index 0bc5ae1d8b556..446426280a643 100644 --- a/airflow/providers/google/marketing_platform/sensors/campaign_manager.py +++ b/airflow/providers/google/marketing_platform/sensors/campaign_manager.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Campaign Manager sensor.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/marketing_platform/sensors/display_video.py b/airflow/providers/google/marketing_platform/sensors/display_video.py index b002682a14b6e..e6f1298ab8f56 100644 --- a/airflow/providers/google/marketing_platform/sensors/display_video.py +++ b/airflow/providers/google/marketing_platform/sensors/display_video.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Sensor for detecting the completion of DV360 reports.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/marketing_platform/sensors/search_ads.py b/airflow/providers/google/marketing_platform/sensors/search_ads.py index b978c6706ecd9..6b044f7e2a00b 100644 --- a/airflow/providers/google/marketing_platform/sensors/search_ads.py +++ b/airflow/providers/google/marketing_platform/sensors/search_ads.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Search Ads sensor.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/suite/hooks/calendar.py b/airflow/providers/google/suite/hooks/calendar.py index 3359300c50741..09697233cbb94 100644 --- a/airflow/providers/google/suite/hooks/calendar.py +++ b/airflow/providers/google/suite/hooks/calendar.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Calendar API hook.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Sequence diff --git a/airflow/providers/google/suite/hooks/drive.py b/airflow/providers/google/suite/hooks/drive.py index 1e4f58b5f724b..8c7884dc08b97 100644 --- a/airflow/providers/google/suite/hooks/drive.py +++ b/airflow/providers/google/suite/hooks/drive.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Google Drive service.""" + from __future__ import annotations from typing import IO, Any, Sequence diff --git a/airflow/providers/google/suite/hooks/sheets.py b/airflow/providers/google/suite/hooks/sheets.py index 050b9527345e2..7b8de0be6538e 100644 --- a/airflow/providers/google/suite/hooks/sheets.py +++ b/airflow/providers/google/suite/hooks/sheets.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Sheets API hook.""" + from __future__ import annotations from typing import Any, Sequence diff --git a/airflow/providers/google/suite/sensors/drive.py b/airflow/providers/google/suite/sensors/drive.py index df3ca230f165a..3c223f3df8fa8 100644 --- a/airflow/providers/google/suite/sensors/drive.py +++ b/airflow/providers/google/suite/sensors/drive.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Drive sensors.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/google/suite/transfers/gcs_to_gdrive.py b/airflow/providers/google/suite/transfers/gcs_to_gdrive.py index e9df2d4a065f0..39b58bc1424bb 100644 --- a/airflow/providers/google/suite/transfers/gcs_to_gdrive.py +++ b/airflow/providers/google/suite/transfers/gcs_to_gdrive.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains a Google Cloud Storage to Google Drive transfer operator.""" + from __future__ import annotations import tempfile diff --git a/airflow/providers/google/suite/transfers/local_to_drive.py b/airflow/providers/google/suite/transfers/local_to_drive.py index cd09260ed84ff..92f7fd393afcd 100644 --- a/airflow/providers/google/suite/transfers/local_to_drive.py +++ b/airflow/providers/google/suite/transfers/local_to_drive.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This file contains Google Drive operators.""" + from __future__ import annotations import os diff --git a/airflow/providers/grpc/hooks/grpc.py b/airflow/providers/grpc/hooks/grpc.py index eb9a1c1de3a4e..49317814247b3 100644 --- a/airflow/providers/grpc/hooks/grpc.py +++ b/airflow/providers/grpc/hooks/grpc.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """GRPC Hook.""" + from __future__ import annotations from typing import Any, Callable, Generator diff --git a/airflow/providers/hashicorp/hooks/vault.py b/airflow/providers/hashicorp/hooks/vault.py index 115cdcf5fb95e..ccee598d6cc14 100644 --- a/airflow/providers/hashicorp/hooks/vault.py +++ b/airflow/providers/hashicorp/hooks/vault.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Hook for HashiCorp Vault.""" + from __future__ import annotations import json diff --git a/airflow/providers/hashicorp/secrets/vault.py b/airflow/providers/hashicorp/secrets/vault.py index 9a5ac88ad3be2..348992a7f6949 100644 --- a/airflow/providers/hashicorp/secrets/vault.py +++ b/airflow/providers/hashicorp/secrets/vault.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Objects relating to sourcing connections & variables from Hashicorp Vault.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/imap/hooks/imap.py b/airflow/providers/imap/hooks/imap.py index f67b81e862412..d95419816e97e 100644 --- a/airflow/providers/imap/hooks/imap.py +++ b/airflow/providers/imap/hooks/imap.py @@ -20,6 +20,7 @@ It uses the imaplib library that is already integrated in python 3. """ + from __future__ import annotations import email diff --git a/airflow/providers/imap/sensors/imap_attachment.py b/airflow/providers/imap/sensors/imap_attachment.py index 6451930e17e26..9eea63cebb523 100644 --- a/airflow/providers/imap/sensors/imap_attachment.py +++ b/airflow/providers/imap/sensors/imap_attachment.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module allows you to poke for attachments on a mail server.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/influxdb/hooks/influxdb.py b/airflow/providers/influxdb/hooks/influxdb.py index f5b1d4b6926ed..619ae538c8eef 100644 --- a/airflow/providers/influxdb/hooks/influxdb.py +++ b/airflow/providers/influxdb/hooks/influxdb.py @@ -22,6 +22,7 @@ FluxTable """ + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/airflow/providers/microsoft/azure/hooks/adx.py b/airflow/providers/microsoft/azure/hooks/adx.py index 87872e84577b6..8ad4095970146 100644 --- a/airflow/providers/microsoft/azure/hooks/adx.py +++ b/airflow/providers/microsoft/azure/hooks/adx.py @@ -23,6 +23,7 @@ KustoResponseDataSetV kusto """ + from __future__ import annotations import warnings diff --git a/airflow/providers/microsoft/azure/hooks/container_registry.py b/airflow/providers/microsoft/azure/hooks/container_registry.py index 1903e9c347523..d860a5a567e95 100644 --- a/airflow/providers/microsoft/azure/hooks/container_registry.py +++ b/airflow/providers/microsoft/azure/hooks/container_registry.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Azure Container Registry.""" + from __future__ import annotations from functools import cached_property diff --git a/airflow/providers/microsoft/azure/hooks/cosmos.py b/airflow/providers/microsoft/azure/hooks/cosmos.py index a33213c8b11ab..fe4aa88b5f7a5 100644 --- a/airflow/providers/microsoft/azure/hooks/cosmos.py +++ b/airflow/providers/microsoft/azure/hooks/cosmos.py @@ -23,6 +23,7 @@ login (=Endpoint uri), password (=secret key) and extra fields database_name and collection_name to specify the default database and collection to use (see connection `azure_cosmos_default` for an example). """ + from __future__ import annotations import uuid diff --git a/airflow/providers/microsoft/azure/hooks/data_factory.py b/airflow/providers/microsoft/azure/hooks/data_factory.py index c6f20cd64e50e..86ad2088fc90f 100644 --- a/airflow/providers/microsoft/azure/hooks/data_factory.py +++ b/airflow/providers/microsoft/azure/hooks/data_factory.py @@ -29,6 +29,7 @@ DataFlowResource mgmt """ + from __future__ import annotations import inspect diff --git a/airflow/providers/microsoft/azure/hooks/wasb.py b/airflow/providers/microsoft/azure/hooks/wasb.py index f4919758ba10d..d53e3ccd9285b 100644 --- a/airflow/providers/microsoft/azure/hooks/wasb.py +++ b/airflow/providers/microsoft/azure/hooks/wasb.py @@ -23,6 +23,7 @@ login (=Storage account name) and password (=KEY), or login and SAS token in the extra field (see connection `wasb_default` for an example). """ + from __future__ import annotations import logging diff --git a/airflow/providers/microsoft/azure/operators/adx.py b/airflow/providers/microsoft/azure/operators/adx.py index b37c104775011..1621fde3489eb 100644 --- a/airflow/providers/microsoft/azure/operators/adx.py +++ b/airflow/providers/microsoft/azure/operators/adx.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Azure Data Explorer operators.""" + from __future__ import annotations from functools import cached_property diff --git a/airflow/providers/microsoft/azure/transfers/sftp_to_wasb.py b/airflow/providers/microsoft/azure/transfers/sftp_to_wasb.py index 740884181c665..e11f1f443b418 100644 --- a/airflow/providers/microsoft/azure/transfers/sftp_to_wasb.py +++ b/airflow/providers/microsoft/azure/transfers/sftp_to_wasb.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains SFTP to Azure Blob Storage operator.""" + from __future__ import annotations import os diff --git a/airflow/providers/microsoft/mssql/hooks/mssql.py b/airflow/providers/microsoft/mssql/hooks/mssql.py index 1adbe41943d3a..91952f5b37e40 100644 --- a/airflow/providers/microsoft/mssql/hooks/mssql.py +++ b/airflow/providers/microsoft/mssql/hooks/mssql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Microsoft SQLServer hook module.""" + from __future__ import annotations from typing import Any diff --git a/airflow/providers/microsoft/winrm/hooks/winrm.py b/airflow/providers/microsoft/winrm/hooks/winrm.py index b8a2b56d465b4..96abdf8e9bf06 100644 --- a/airflow/providers/microsoft/winrm/hooks/winrm.py +++ b/airflow/providers/microsoft/winrm/hooks/winrm.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for winrm remote execution.""" + from __future__ import annotations from winrm.protocol import Protocol diff --git a/airflow/providers/mongo/hooks/mongo.py b/airflow/providers/mongo/hooks/mongo.py index 95d141aaec6e5..06c3df6bd9e35 100644 --- a/airflow/providers/mongo/hooks/mongo.py +++ b/airflow/providers/mongo/hooks/mongo.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Mongo DB.""" + from __future__ import annotations import warnings @@ -200,8 +201,7 @@ def find( mongo_db: str | None = None, projection: list | dict | None = None, **kwargs, - ) -> pymongo.cursor.Cursor: - ... + ) -> pymongo.cursor.Cursor: ... @overload def find( @@ -212,8 +212,7 @@ def find( mongo_db: str | None = None, projection: list | dict | None = None, **kwargs, - ) -> Any | None: - ... + ) -> Any | None: ... def find( self, diff --git a/airflow/providers/mysql/hooks/mysql.py b/airflow/providers/mysql/hooks/mysql.py index 8176653fdd0a8..ebf88c6557e23 100644 --- a/airflow/providers/mysql/hooks/mysql.py +++ b/airflow/providers/mysql/hooks/mysql.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module allows to connect to a MySQL database.""" + from __future__ import annotations import json diff --git a/airflow/providers/neo4j/hooks/neo4j.py b/airflow/providers/neo4j/hooks/neo4j.py index 59c00e08aa5fc..5f58f802086f9 100644 --- a/airflow/providers/neo4j/hooks/neo4j.py +++ b/airflow/providers/neo4j/hooks/neo4j.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module allows to connect to a Neo4j database.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any diff --git a/airflow/providers/odbc/hooks/odbc.py b/airflow/providers/odbc/hooks/odbc.py index 33fd57eee27b1..a14e64d6df658 100644 --- a/airflow/providers/odbc/hooks/odbc.py +++ b/airflow/providers/odbc/hooks/odbc.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module contains ODBC hook.""" + from __future__ import annotations from collections import namedtuple diff --git a/airflow/providers/openlineage/extractors/base.py b/airflow/providers/openlineage/extractors/base.py index 5165c1c910132..f5cb27027db74 100644 --- a/airflow/providers/openlineage/extractors/base.py +++ b/airflow/providers/openlineage/extractors/base.py @@ -79,8 +79,7 @@ def _is_operator_disabled(self) -> bool: return fully_qualified_class_name in self.disabled_operators @abstractmethod - def _execute_extraction(self) -> OperatorLineage | None: - ... + def _execute_extraction(self) -> OperatorLineage | None: ... def extract(self) -> OperatorLineage | None: if self._is_operator_disabled: diff --git a/airflow/providers/pagerduty/hooks/pagerduty.py b/airflow/providers/pagerduty/hooks/pagerduty.py index 244314fa3461e..6f07a590a1817 100644 --- a/airflow/providers/pagerduty/hooks/pagerduty.py +++ b/airflow/providers/pagerduty/hooks/pagerduty.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for sending or receiving data from PagerDuty as well as creating PagerDuty incidents.""" + from __future__ import annotations from typing import Any diff --git a/airflow/providers/pagerduty/hooks/pagerduty_events.py b/airflow/providers/pagerduty/hooks/pagerduty_events.py index dbbfcfe4c6b32..6719a0ff38007 100644 --- a/airflow/providers/pagerduty/hooks/pagerduty_events.py +++ b/airflow/providers/pagerduty/hooks/pagerduty_events.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for sending or receiving data from PagerDuty as well as creating PagerDuty incidents.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any diff --git a/airflow/providers/pinecone/hooks/pinecone.py b/airflow/providers/pinecone/hooks/pinecone.py index 6a116250f4922..3d11c74b647a2 100644 --- a/airflow/providers/pinecone/hooks/pinecone.py +++ b/airflow/providers/pinecone/hooks/pinecone.py @@ -16,6 +16,7 @@ # under the License. """Hook for Pinecone.""" + from __future__ import annotations import itertools diff --git a/airflow/providers/presto/transfers/gcs_to_presto.py b/airflow/providers/presto/transfers/gcs_to_presto.py index fd4701e56e57e..e1ecd2c0f5cb2 100644 --- a/airflow/providers/presto/transfers/gcs_to_presto.py +++ b/airflow/providers/presto/transfers/gcs_to_presto.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Storage to Presto operator.""" + from __future__ import annotations import csv diff --git a/airflow/providers/redis/hooks/redis.py b/airflow/providers/redis/hooks/redis.py index 6fbe2e24ac6bd..10890f36b0eb1 100644 --- a/airflow/providers/redis/hooks/redis.py +++ b/airflow/providers/redis/hooks/redis.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """RedisHook module.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/salesforce/hooks/salesforce.py b/airflow/providers/salesforce/hooks/salesforce.py index 61678e2a6c81f..12b220bc57089 100644 --- a/airflow/providers/salesforce/hooks/salesforce.py +++ b/airflow/providers/salesforce/hooks/salesforce.py @@ -21,6 +21,7 @@ .. note:: this hook also relies on the simple_salesforce package: https://github.com/simple-salesforce/simple-salesforce """ + from __future__ import annotations import logging diff --git a/airflow/providers/samba/transfers/gcs_to_samba.py b/airflow/providers/samba/transfers/gcs_to_samba.py index da18849430ee5..fb1cb6ad98b07 100644 --- a/airflow/providers/samba/transfers/gcs_to_samba.py +++ b/airflow/providers/samba/transfers/gcs_to_samba.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Storage to Samba operator.""" + from __future__ import annotations import os diff --git a/airflow/providers/segment/hooks/segment.py b/airflow/providers/segment/hooks/segment.py index 3d93f51fa8fc7..2c47eea995693 100644 --- a/airflow/providers/segment/hooks/segment.py +++ b/airflow/providers/segment/hooks/segment.py @@ -21,6 +21,7 @@ NOTE: this hook also relies on the Segment analytics package: https://github.com/segmentio/analytics-python """ + from __future__ import annotations import analytics diff --git a/airflow/providers/sendgrid/utils/emailer.py b/airflow/providers/sendgrid/utils/emailer.py index 66856738b6717..b82aad35db9b6 100644 --- a/airflow/providers/sendgrid/utils/emailer.py +++ b/airflow/providers/sendgrid/utils/emailer.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Airflow module for email backend using sendgrid.""" + from __future__ import annotations import base64 diff --git a/airflow/providers/sftp/hooks/sftp.py b/airflow/providers/sftp/hooks/sftp.py index e7630fd10c67e..0eedcb10ed789 100644 --- a/airflow/providers/sftp/hooks/sftp.py +++ b/airflow/providers/sftp/hooks/sftp.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains SFTP hook.""" + from __future__ import annotations import datetime diff --git a/airflow/providers/sftp/operators/sftp.py b/airflow/providers/sftp/operators/sftp.py index d357cfbbc74d0..13a12979040e4 100644 --- a/airflow/providers/sftp/operators/sftp.py +++ b/airflow/providers/sftp/operators/sftp.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains SFTP operator.""" + from __future__ import annotations import os diff --git a/airflow/providers/sftp/sensors/sftp.py b/airflow/providers/sftp/sensors/sftp.py index af13b4fab317e..02055f31e3f81 100644 --- a/airflow/providers/sftp/sensors/sftp.py +++ b/airflow/providers/sftp/sensors/sftp.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains SFTP sensor.""" + from __future__ import annotations import os diff --git a/airflow/providers/slack/notifications/slack_notifier.py b/airflow/providers/slack/notifications/slack_notifier.py index df8e41523055a..03483ceee0f41 100644 --- a/airflow/providers/slack/notifications/slack_notifier.py +++ b/airflow/providers/slack/notifications/slack_notifier.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """This module is deprecated. Please use :mod:`airflow.providers.slack.notifications.slack`.""" + from __future__ import annotations import warnings diff --git a/airflow/providers/smtp/hooks/smtp.py b/airflow/providers/smtp/hooks/smtp.py index 7433cd5dd753e..ac72fcc2148b3 100644 --- a/airflow/providers/smtp/hooks/smtp.py +++ b/airflow/providers/smtp/hooks/smtp.py @@ -20,6 +20,7 @@ It uses the smtplib library that is already integrated in python 3. """ + from __future__ import annotations import collections.abc diff --git a/airflow/providers/snowflake/hooks/snowflake.py b/airflow/providers/snowflake/hooks/snowflake.py index f7e989665315e..075ae21e3014a 100644 --- a/airflow/providers/snowflake/hooks/snowflake.py +++ b/airflow/providers/snowflake/hooks/snowflake.py @@ -321,8 +321,7 @@ def run( split_statements: bool = ..., return_last: bool = ..., return_dictionaries: bool = ..., - ) -> None: - ... + ) -> None: ... @overload def run( @@ -334,8 +333,7 @@ def run( split_statements: bool = ..., return_last: bool = ..., return_dictionaries: bool = ..., - ) -> tuple | list[tuple] | list[list[tuple] | tuple] | None: - ... + ) -> tuple | list[tuple] | list[list[tuple] | tuple] | None: ... def run( self, diff --git a/airflow/providers/snowflake/transfers/copy_into_snowflake.py b/airflow/providers/snowflake/transfers/copy_into_snowflake.py index 50b1ed6af3e71..ef35d231d3326 100644 --- a/airflow/providers/snowflake/transfers/copy_into_snowflake.py +++ b/airflow/providers/snowflake/transfers/copy_into_snowflake.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Abstract operator that child classes implement ``COPY INTO SQL in Snowflake``.""" + from __future__ import annotations from typing import Any, Sequence diff --git a/airflow/providers/ssh/hooks/ssh.py b/airflow/providers/ssh/hooks/ssh.py index 788f5f3f0aede..326967561ca71 100644 --- a/airflow/providers/ssh/hooks/ssh.py +++ b/airflow/providers/ssh/hooks/ssh.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for SSH connections.""" + from __future__ import annotations import os diff --git a/airflow/providers/telegram/hooks/telegram.py b/airflow/providers/telegram/hooks/telegram.py index 514e0f7875d25..143574bf52252 100644 --- a/airflow/providers/telegram/hooks/telegram.py +++ b/airflow/providers/telegram/hooks/telegram.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Hook for Telegram.""" + from __future__ import annotations import asyncio diff --git a/airflow/providers/telegram/operators/telegram.py b/airflow/providers/telegram/operators/telegram.py index 363b3433dc8ef..f330d2a84fa59 100644 --- a/airflow/providers/telegram/operators/telegram.py +++ b/airflow/providers/telegram/operators/telegram.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Operator for Telegram.""" + from __future__ import annotations from typing import TYPE_CHECKING, Sequence diff --git a/airflow/providers/teradata/hooks/teradata.py b/airflow/providers/teradata/hooks/teradata.py index 1ede21203d6f4..73c4fb8ff0523 100644 --- a/airflow/providers/teradata/hooks/teradata.py +++ b/airflow/providers/teradata/hooks/teradata.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """An Airflow Hook for interacting with Teradata SQL Server.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any diff --git a/airflow/providers/trino/operators/trino.py b/airflow/providers/trino/operators/trino.py index f13d0ab0d35dd..76856728a4836 100644 --- a/airflow/providers/trino/operators/trino.py +++ b/airflow/providers/trino/operators/trino.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains the Trino operator.""" + from __future__ import annotations from typing import Any, Sequence diff --git a/airflow/providers/trino/transfers/gcs_to_trino.py b/airflow/providers/trino/transfers/gcs_to_trino.py index 7535881fed3be..a322c63c9e83d 100644 --- a/airflow/providers/trino/transfers/gcs_to_trino.py +++ b/airflow/providers/trino/transfers/gcs_to_trino.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module contains Google Cloud Storage to Trino operator.""" + from __future__ import annotations import csv diff --git a/airflow/providers/vertica/hooks/vertica.py b/airflow/providers/vertica/hooks/vertica.py index 191fa10a8bdf3..1c77d2fd2470c 100644 --- a/airflow/providers/vertica/hooks/vertica.py +++ b/airflow/providers/vertica/hooks/vertica.py @@ -141,8 +141,7 @@ def run( handler: None = ..., split_statements: bool = ..., return_last: bool = ..., - ) -> None: - ... + ) -> None: ... @overload def run( @@ -153,8 +152,7 @@ def run( handler: Callable[[Any], Any] = ..., split_statements: bool = ..., return_last: bool = ..., - ) -> Any | list[Any]: - ... + ) -> Any | list[Any]: ... def run( self, diff --git a/airflow/providers/yandex/secrets/lockbox.py b/airflow/providers/yandex/secrets/lockbox.py index 2bfef152c743c..16a28a3917f47 100644 --- a/airflow/providers/yandex/secrets/lockbox.py +++ b/airflow/providers/yandex/secrets/lockbox.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Objects relating to sourcing secrets from Yandex Cloud Lockbox.""" + from __future__ import annotations from functools import cached_property diff --git a/airflow/providers_manager.py b/airflow/providers_manager.py index 1491231c13312..9552a8a526752 100644 --- a/airflow/providers_manager.py +++ b/airflow/providers_manager.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Manages all providers.""" + from __future__ import annotations import fnmatch @@ -1151,9 +1152,7 @@ def _discover_config(self) -> None: """Retrieve all configs defined in the providers.""" for provider_package, provider in self._provider_dict.items(): if provider.data.get("config"): - self._provider_configs[provider_package] = ( - provider.data.get("config") # type: ignore[assignment] - ) + self._provider_configs[provider_package] = provider.data.get("config") # type: ignore[assignment] def _discover_plugins(self) -> None: """Retrieve all plugins defined in the providers.""" diff --git a/airflow/secrets/__init__.py b/airflow/secrets/__init__.py index 57022fc8162e1..e59c1f5e74ca0 100644 --- a/airflow/secrets/__init__.py +++ b/airflow/secrets/__init__.py @@ -24,6 +24,7 @@ * Metastore database * Local Filesystem Secrets Backend """ + from __future__ import annotations __all__ = ["BaseSecretsBackend", "DEFAULT_SECRETS_SEARCH_PATH"] diff --git a/airflow/secrets/environment_variables.py b/airflow/secrets/environment_variables.py index 8e62e9f891d20..69d3174b72334 100644 --- a/airflow/secrets/environment_variables.py +++ b/airflow/secrets/environment_variables.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Objects relating to sourcing connections from environment variables.""" + from __future__ import annotations import os diff --git a/airflow/secrets/local_filesystem.py b/airflow/secrets/local_filesystem.py index 742b5c4589065..f9ea4ad3554cb 100644 --- a/airflow/secrets/local_filesystem.py +++ b/airflow/secrets/local_filesystem.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Objects relating to retrieving connections and variables from local file.""" + from __future__ import annotations import json diff --git a/airflow/secrets/metastore.py b/airflow/secrets/metastore.py index 481b7aaf3a8fb..1c812cc0c5076 100644 --- a/airflow/secrets/metastore.py +++ b/airflow/secrets/metastore.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Objects relating to sourcing connections from metastore database.""" + from __future__ import annotations import warnings diff --git a/airflow/sentry.py b/airflow/sentry.py index 73a1fb99aac7e..d5fbf3c04d211 100644 --- a/airflow/sentry.py +++ b/airflow/sentry.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Sentry Integration.""" + from __future__ import annotations import logging diff --git a/airflow/serialization/enums.py b/airflow/serialization/enums.py index 963dec580ef5c..2a4387eeb4809 100644 --- a/airflow/serialization/enums.py +++ b/airflow/serialization/enums.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Enums for DAG serialization.""" + from __future__ import annotations from enum import Enum, unique diff --git a/airflow/serialization/helpers.py b/airflow/serialization/helpers.py index 80f949dee3555..aa3ceb644e96b 100644 --- a/airflow/serialization/helpers.py +++ b/airflow/serialization/helpers.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Serialized DAG and BaseOperator.""" + from __future__ import annotations from typing import Any diff --git a/airflow/serialization/json_schema.py b/airflow/serialization/json_schema.py index 91c66d8d661d0..32f3b9e0d108c 100644 --- a/airflow/serialization/json_schema.py +++ b/airflow/serialization/json_schema.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """jsonschema for validating serialized DAG and operator.""" + from __future__ import annotations import pkgutil diff --git a/airflow/serialization/serialized_objects.py b/airflow/serialization/serialized_objects.py index a917557a4b589..d17c76c0af5fa 100644 --- a/airflow/serialization/serialized_objects.py +++ b/airflow/serialization/serialized_objects.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Serialized DAG and BaseOperator.""" + from __future__ import annotations import collections.abc diff --git a/airflow/task/priority_strategy.py b/airflow/task/priority_strategy.py index 556539e220f4d..46aa354471742 100644 --- a/airflow/task/priority_strategy.py +++ b/airflow/task/priority_strategy.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Priority weight strategies for task scheduling.""" + from __future__ import annotations from abc import ABC, abstractmethod diff --git a/airflow/task/task_runner/base_task_runner.py b/airflow/task/task_runner/base_task_runner.py index a0029ebc5064d..8a332fd4e3ba2 100644 --- a/airflow/task/task_runner/base_task_runner.py +++ b/airflow/task/task_runner/base_task_runner.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Base task runner.""" + from __future__ import annotations import os diff --git a/airflow/task/task_runner/cgroup_task_runner.py b/airflow/task/task_runner/cgroup_task_runner.py index 3ec1fccaa54b5..41715fdbc6d5b 100644 --- a/airflow/task/task_runner/cgroup_task_runner.py +++ b/airflow/task/task_runner/cgroup_task_runner.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Task runner for cgroup to run Airflow task.""" + from __future__ import annotations import os diff --git a/airflow/task/task_runner/standard_task_runner.py b/airflow/task/task_runner/standard_task_runner.py index a2e4ec1319ea5..a4b8bbdc040b9 100644 --- a/airflow/task/task_runner/standard_task_runner.py +++ b/airflow/task/task_runner/standard_task_runner.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Standard task runner.""" + from __future__ import annotations import logging diff --git a/airflow/ti_deps/deps/dagrun_backfill_dep.py b/airflow/ti_deps/deps/dagrun_backfill_dep.py index 6d0a1efad2629..ba359929a8cb6 100644 --- a/airflow/ti_deps/deps/dagrun_backfill_dep.py +++ b/airflow/ti_deps/deps/dagrun_backfill_dep.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module defines dep for making sure DagRun not a backfill.""" + from __future__ import annotations from airflow.ti_deps.deps.base_ti_dep import BaseTIDep diff --git a/airflow/ti_deps/deps/pool_slots_available_dep.py b/airflow/ti_deps/deps/pool_slots_available_dep.py index 840cfa2780446..0b053848824c3 100644 --- a/airflow/ti_deps/deps/pool_slots_available_dep.py +++ b/airflow/ti_deps/deps/pool_slots_available_dep.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module defines dep for pool slots availability.""" + from __future__ import annotations from sqlalchemy import select diff --git a/airflow/ti_deps/deps/task_not_running_dep.py b/airflow/ti_deps/deps/task_not_running_dep.py index eaecb811a4dca..3319fb69bf61d 100644 --- a/airflow/ti_deps/deps/task_not_running_dep.py +++ b/airflow/ti_deps/deps/task_not_running_dep.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Contains the TaskNotRunningDep.""" + from __future__ import annotations from airflow.ti_deps.deps.base_ti_dep import BaseTIDep diff --git a/airflow/typing_compat.py b/airflow/typing_compat.py index bbe688cc0b6a0..5ae2d236abc07 100644 --- a/airflow/typing_compat.py +++ b/airflow/typing_compat.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This module provides helper code to make type annotation within Airflow codebase easier.""" + from __future__ import annotations __all__ = [ diff --git a/airflow/utils/cli.py b/airflow/utils/cli.py index 03aa290e8bf05..cc7ffd942cd7a 100644 --- a/airflow/utils/cli.py +++ b/airflow/utils/cli.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Utilities module for cli.""" + from __future__ import annotations import functools diff --git a/airflow/utils/cli_action_loggers.py b/airflow/utils/cli_action_loggers.py index 63db7501a1026..da56f7db7e6ef 100644 --- a/airflow/utils/cli_action_loggers.py +++ b/airflow/utils/cli_action_loggers.py @@ -21,6 +21,7 @@ Singleton pattern has been applied into this module so that registered callbacks can be used all through the same python process. """ + from __future__ import annotations import json diff --git a/airflow/utils/context.py b/airflow/utils/context.py index 632126062b0b5..46ed3ef5a88e3 100644 --- a/airflow/utils/context.py +++ b/airflow/utils/context.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Jinja2 template rendering context helper.""" + from __future__ import annotations import contextlib diff --git a/airflow/utils/dag_cycle_tester.py b/airflow/utils/dag_cycle_tester.py index 3fb47371dc516..f457190502229 100644 --- a/airflow/utils/dag_cycle_tester.py +++ b/airflow/utils/dag_cycle_tester.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """DAG Cycle tester.""" + from __future__ import annotations from collections import defaultdict, deque diff --git a/airflow/utils/db_cleanup.py b/airflow/utils/db_cleanup.py index 04dfe79c07160..e6bbf2978ebd4 100644 --- a/airflow/utils/db_cleanup.py +++ b/airflow/utils/db_cleanup.py @@ -20,6 +20,7 @@ See: (https://github.com/teamclairvoyant/airflow-maintenance-dags/blob/4e5c7682a808082561d60cbc9cafaa477b0d8c65/db-cleanup/airflow-db-cleanup.py). """ + from __future__ import annotations import csv diff --git a/airflow/utils/dot_renderer.py b/airflow/utils/dot_renderer.py index 4d44d1e2ecf14..6e20609067555 100644 --- a/airflow/utils/dot_renderer.py +++ b/airflow/utils/dot_renderer.py @@ -17,6 +17,7 @@ # specific language governing permissions and limitations # under the License. """Renderer DAG (tasks and dependencies) to the graphviz object.""" + from __future__ import annotations import warnings diff --git a/airflow/utils/file.py b/airflow/utils/file.py index c66358a10aebf..5b55cff432657 100644 --- a/airflow/utils/file.py +++ b/airflow/utils/file.py @@ -158,13 +158,11 @@ def mkdirs(path, mode): @overload -def correct_maybe_zipped(fileloc: None) -> None: - ... +def correct_maybe_zipped(fileloc: None) -> None: ... @overload -def correct_maybe_zipped(fileloc: str | Path) -> str | Path: - ... +def correct_maybe_zipped(fileloc: str | Path) -> str | Path: ... def correct_maybe_zipped(fileloc: None | str | Path) -> None | str | Path: diff --git a/airflow/utils/log/colored_log.py b/airflow/utils/log/colored_log.py index 2ed4fb4ed8054..d27b4be242382 100644 --- a/airflow/utils/log/colored_log.py +++ b/airflow/utils/log/colored_log.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Class responsible for colouring logs based on log level.""" + from __future__ import annotations import sys diff --git a/airflow/utils/log/file_task_handler.py b/airflow/utils/log/file_task_handler.py index 74af67e841459..7596805bb9e5e 100644 --- a/airflow/utils/log/file_task_handler.py +++ b/airflow/utils/log/file_task_handler.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """File logging handler for tasks.""" + from __future__ import annotations import inspect diff --git a/airflow/utils/log/json_formatter.py b/airflow/utils/log/json_formatter.py index eb19fe8969437..4dd0eab343080 100644 --- a/airflow/utils/log/json_formatter.py +++ b/airflow/utils/log/json_formatter.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """json_formatter module stores all related to ElasticSearch specific logger classes.""" + from __future__ import annotations import json diff --git a/airflow/utils/log/secrets_masker.py b/airflow/utils/log/secrets_masker.py index 0b1b65f8405c1..3bf5d92adf0dc 100644 --- a/airflow/utils/log/secrets_masker.py +++ b/airflow/utils/log/secrets_masker.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Mask sensitive information from logs.""" + from __future__ import annotations import collections.abc diff --git a/airflow/utils/log/task_handler_with_custom_formatter.py b/airflow/utils/log/task_handler_with_custom_formatter.py index 272c4f7a69fbb..3fdda914c5d7e 100644 --- a/airflow/utils/log/task_handler_with_custom_formatter.py +++ b/airflow/utils/log/task_handler_with_custom_formatter.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Custom logging formatter for Airflow.""" + from __future__ import annotations import logging diff --git a/airflow/utils/platform.py b/airflow/utils/platform.py index 2ee11c548f049..7945e2b945382 100644 --- a/airflow/utils/platform.py +++ b/airflow/utils/platform.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Platform and system specific function.""" + from __future__ import annotations import getpass diff --git a/airflow/utils/process_utils.py b/airflow/utils/process_utils.py index 18798e85d027c..06004a355e898 100644 --- a/airflow/utils/process_utils.py +++ b/airflow/utils/process_utils.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Utilities for running or stopping processes.""" + from __future__ import annotations import errno diff --git a/airflow/utils/python_virtualenv.py b/airflow/utils/python_virtualenv.py index d49ac2b9b44ea..4a03c2d18ef80 100644 --- a/airflow/utils/python_virtualenv.py +++ b/airflow/utils/python_virtualenv.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Utilities for creating a virtual environment.""" + from __future__ import annotations import os diff --git a/airflow/utils/retries.py b/airflow/utils/retries.py index 5b67feec439de..b1d29ddd177f9 100644 --- a/airflow/utils/retries.py +++ b/airflow/utils/retries.py @@ -49,13 +49,11 @@ def run_with_db_retries(max_retries: int = MAX_DB_RETRIES, logger: logging.Logge @overload -def retry_db_transaction(*, retries: int = MAX_DB_RETRIES) -> Callable[[F], F]: - ... +def retry_db_transaction(*, retries: int = MAX_DB_RETRIES) -> Callable[[F], F]: ... @overload -def retry_db_transaction(_func: F) -> F: - ... +def retry_db_transaction(_func: F) -> F: ... def retry_db_transaction(_func: Callable | None = None, *, retries: int = MAX_DB_RETRIES, **retry_kwargs): diff --git a/airflow/utils/serve_logs.py b/airflow/utils/serve_logs.py index a99c894b07577..31ef86600da79 100644 --- a/airflow/utils/serve_logs.py +++ b/airflow/utils/serve_logs.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Serve logs process.""" + from __future__ import annotations import logging diff --git a/airflow/utils/sqlalchemy.py b/airflow/utils/sqlalchemy.py index 2055eb55e829d..a9572afe25356 100644 --- a/airflow/utils/sqlalchemy.py +++ b/airflow/utils/sqlalchemy.py @@ -482,8 +482,7 @@ def is_lock_not_available_error(error: OperationalError): def tuple_in_condition( columns: tuple[ColumnElement, ...], collection: Iterable[Any], -) -> ColumnOperators: - ... +) -> ColumnOperators: ... @overload @@ -492,8 +491,7 @@ def tuple_in_condition( collection: Select, *, session: Session, -) -> ColumnOperators: - ... +) -> ColumnOperators: ... def tuple_in_condition( @@ -517,8 +515,7 @@ def tuple_in_condition( def tuple_not_in_condition( columns: tuple[ColumnElement, ...], collection: Iterable[Any], -) -> ColumnOperators: - ... +) -> ColumnOperators: ... @overload @@ -527,8 +524,7 @@ def tuple_not_in_condition( collection: Select, *, session: Session, -) -> ColumnOperators: - ... +) -> ColumnOperators: ... def tuple_not_in_condition( diff --git a/airflow/utils/strings.py b/airflow/utils/strings.py index e2ad9ddfcf641..8552e762d5614 100644 --- a/airflow/utils/strings.py +++ b/airflow/utils/strings.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Common utility functions with strings.""" + from __future__ import annotations import random diff --git a/airflow/utils/task_group.py b/airflow/utils/task_group.py index 732205f479d46..5f79600c47d66 100644 --- a/airflow/utils/task_group.py +++ b/airflow/utils/task_group.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """A collection of closely related tasks on the same DAG that should be grouped together visually.""" + from __future__ import annotations import copy diff --git a/airflow/utils/timezone.py b/airflow/utils/timezone.py index 7fc4bd6ac12ee..29873166edeec 100644 --- a/airflow/utils/timezone.py +++ b/airflow/utils/timezone.py @@ -79,13 +79,11 @@ def utc_epoch() -> dt.datetime: @overload -def convert_to_utc(value: None) -> None: - ... +def convert_to_utc(value: None) -> None: ... @overload -def convert_to_utc(value: dt.datetime) -> DateTime: - ... +def convert_to_utc(value: dt.datetime) -> DateTime: ... def convert_to_utc(value: dt.datetime | None) -> DateTime | None: @@ -106,18 +104,15 @@ def convert_to_utc(value: dt.datetime | None) -> DateTime | None: @overload -def make_aware(value: None, timezone: dt.tzinfo | None = None) -> None: - ... +def make_aware(value: None, timezone: dt.tzinfo | None = None) -> None: ... @overload -def make_aware(value: DateTime, timezone: dt.tzinfo | None = None) -> DateTime: - ... +def make_aware(value: DateTime, timezone: dt.tzinfo | None = None) -> DateTime: ... @overload -def make_aware(value: dt.datetime, timezone: dt.tzinfo | None = None) -> dt.datetime: - ... +def make_aware(value: dt.datetime, timezone: dt.tzinfo | None = None) -> dt.datetime: ... def make_aware(value: dt.datetime | None, timezone: dt.tzinfo | None = None) -> dt.datetime | None: @@ -210,18 +205,15 @@ def parse(string: str, timezone=None, *, strict=False) -> DateTime: @overload -def coerce_datetime(v: None, tz: dt.tzinfo | None = None) -> None: - ... +def coerce_datetime(v: None, tz: dt.tzinfo | None = None) -> None: ... @overload -def coerce_datetime(v: DateTime, tz: dt.tzinfo | None = None) -> DateTime: - ... +def coerce_datetime(v: DateTime, tz: dt.tzinfo | None = None) -> DateTime: ... @overload -def coerce_datetime(v: dt.datetime, tz: dt.tzinfo | None = None) -> DateTime: - ... +def coerce_datetime(v: dt.datetime, tz: dt.tzinfo | None = None) -> DateTime: ... def coerce_datetime(v: dt.datetime | None, tz: dt.tzinfo | None = None) -> DateTime | None: diff --git a/airflow/utils/weekday.py b/airflow/utils/weekday.py index 1e6f698f69c94..d148858cc5fef 100644 --- a/airflow/utils/weekday.py +++ b/airflow/utils/weekday.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Get the ISO standard day number of the week from a given day string.""" + from __future__ import annotations import enum diff --git a/airflow/utils/yaml.py b/airflow/utils/yaml.py index 28e117fcd5877..2ee88c2178825 100644 --- a/airflow/utils/yaml.py +++ b/airflow/utils/yaml.py @@ -25,6 +25,7 @@ And then be used directly in place of the normal python module. """ + from __future__ import annotations from typing import TYPE_CHECKING, Any, BinaryIO, TextIO, cast diff --git a/dev/assign_cherry_picked_prs_with_milestone.py b/dev/assign_cherry_picked_prs_with_milestone.py index 0ffb57d92dfa7..135e944af2a2c 100755 --- a/dev/assign_cherry_picked_prs_with_milestone.py +++ b/dev/assign_cherry_picked_prs_with_milestone.py @@ -55,8 +55,7 @@ @click.group(context_settings={"help_option_names": ["-h", "--help"], "max_content_width": 500}) -def cli(): - ... +def cli(): ... option_verbose = click.option( diff --git a/dev/breeze/src/airflow_breeze/branch_defaults.py b/dev/breeze/src/airflow_breeze/branch_defaults.py index c9dbaa80801ed..e8639d348cd8f 100644 --- a/dev/breeze/src/airflow_breeze/branch_defaults.py +++ b/dev/breeze/src/airflow_breeze/branch_defaults.py @@ -35,6 +35,7 @@ DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH = "constraints-2-2" """ + from __future__ import annotations AIRFLOW_BRANCH = "main" diff --git a/dev/breeze/src/airflow_breeze/global_constants.py b/dev/breeze/src/airflow_breeze/global_constants.py index c36e75c40642e..7b39c2c27c480 100644 --- a/dev/breeze/src/airflow_breeze/global_constants.py +++ b/dev/breeze/src/airflow_breeze/global_constants.py @@ -17,6 +17,7 @@ """ Global constants that are used by all other Breeze components. """ + from __future__ import annotations import json diff --git a/dev/breeze/src/airflow_breeze/utils/cache.py b/dev/breeze/src/airflow_breeze/utils/cache.py index a52b17ac97129..ab0ec543820a4 100644 --- a/dev/breeze/src/airflow_breeze/utils/cache.py +++ b/dev/breeze/src/airflow_breeze/utils/cache.py @@ -21,6 +21,7 @@ This allows to not remember what was the last version of Python used, if you just want to enter the shell with the same version as the "previous run". """ + from __future__ import annotations import sys diff --git a/dev/breeze/src/airflow_breeze/utils/console.py b/dev/breeze/src/airflow_breeze/utils/console.py index d579e58176f9b..1083875c372a4 100644 --- a/dev/breeze/src/airflow_breeze/utils/console.py +++ b/dev/breeze/src/airflow_breeze/utils/console.py @@ -18,6 +18,7 @@ Console used by all processes. We are forcing colors and terminal output as Breeze is supposed to be only run in CI or real development terminal - in both cases we want to have colors on. """ + from __future__ import annotations import os diff --git a/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py b/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py index 8f6519c17799b..3ad92a19e52ed 100644 --- a/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py +++ b/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Various utils to prepare docker and docker compose commands.""" + from __future__ import annotations import copy diff --git a/dev/breeze/src/airflow_breeze/utils/host_info_utils.py b/dev/breeze/src/airflow_breeze/utils/host_info_utils.py index 13e49f7f8f12c..0034983172346 100644 --- a/dev/breeze/src/airflow_breeze/utils/host_info_utils.py +++ b/dev/breeze/src/airflow_breeze/utils/host_info_utils.py @@ -17,6 +17,7 @@ """ Returns information about Host that should be passed to the docker-compose. """ + from __future__ import annotations import platform diff --git a/dev/breeze/src/airflow_breeze/utils/md5_build_check.py b/dev/breeze/src/airflow_breeze/utils/md5_build_check.py index 9901d6b1da91e..9475461812187 100644 --- a/dev/breeze/src/airflow_breeze/utils/md5_build_check.py +++ b/dev/breeze/src/airflow_breeze/utils/md5_build_check.py @@ -17,6 +17,7 @@ """ Utilities to check - with MD5 - whether files have been modified since the last successful build. """ + from __future__ import annotations import hashlib diff --git a/dev/breeze/src/airflow_breeze/utils/path_utils.py b/dev/breeze/src/airflow_breeze/utils/path_utils.py index 549dfdb2ec2d9..8c3c7814bb351 100644 --- a/dev/breeze/src/airflow_breeze/utils/path_utils.py +++ b/dev/breeze/src/airflow_breeze/utils/path_utils.py @@ -17,6 +17,7 @@ """ Useful tools for various Paths used inside Airflow Sources. """ + from __future__ import annotations import hashlib diff --git a/dev/breeze/src/airflow_breeze/utils/run_utils.py b/dev/breeze/src/airflow_breeze/utils/run_utils.py index f3956bc07dd6b..6c72f85671cf5 100644 --- a/dev/breeze/src/airflow_breeze/utils/run_utils.py +++ b/dev/breeze/src/airflow_breeze/utils/run_utils.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Useful tools for running commands.""" + from __future__ import annotations import atexit diff --git a/dev/breeze/src/airflow_breeze/utils/visuals.py b/dev/breeze/src/airflow_breeze/utils/visuals.py index 660811c503a9e..215c8234ca70f 100644 --- a/dev/breeze/src/airflow_breeze/utils/visuals.py +++ b/dev/breeze/src/airflow_breeze/utils/visuals.py @@ -17,6 +17,7 @@ """ Visuals displayed to the user when entering Breeze shell. """ + from __future__ import annotations from airflow_breeze.global_constants import ( diff --git a/dev/chart/build_changelog_annotations.py b/dev/chart/build_changelog_annotations.py index 5652662b4ac1a..0a7e57844dd3a 100755 --- a/dev/chart/build_changelog_annotations.py +++ b/dev/chart/build_changelog_annotations.py @@ -35,6 +35,7 @@ - name: "#19263" url: https://github.com/apache/airflow/pull/19263 """ + from __future__ import annotations import re diff --git a/dev/perf/dags/perf_dag_1.py b/dev/perf/dags/perf_dag_1.py index edd6ebf5252ee..f54b763e13f30 100644 --- a/dev/perf/dags/perf_dag_1.py +++ b/dev/perf/dags/perf_dag_1.py @@ -18,6 +18,7 @@ """ This dag tests performance of simple bash commands executed with Airflow. """ + from __future__ import annotations import datetime diff --git a/dev/perf/dags/perf_dag_2.py b/dev/perf/dags/perf_dag_2.py index 9bacbcec830af..641bb7565c8f3 100644 --- a/dev/perf/dags/perf_dag_2.py +++ b/dev/perf/dags/perf_dag_2.py @@ -18,6 +18,7 @@ """ This dag tests performance of simple bash commands executed with Airflow. """ + from __future__ import annotations import datetime diff --git a/dev/prepare_bulk_issues.py b/dev/prepare_bulk_issues.py index 405cf4ca0b6d5..e6c26f82f3baa 100755 --- a/dev/prepare_bulk_issues.py +++ b/dev/prepare_bulk_issues.py @@ -47,8 +47,7 @@ @click.group(context_settings={"help_option_names": ["-h", "--help"], "max_content_width": 500}) -def cli(): - ... +def cli(): ... def render_template_file( diff --git a/dev/stats/calculate_statistics_provider_testing_issues.py b/dev/stats/calculate_statistics_provider_testing_issues.py index 5d306389c4143..2cfaf3bf5cc89 100755 --- a/dev/stats/calculate_statistics_provider_testing_issues.py +++ b/dev/stats/calculate_statistics_provider_testing_issues.py @@ -44,8 +44,7 @@ @click.group(context_settings={"help_option_names": ["-h", "--help"], "max_content_width": 500}) -def cli(): - ... +def cli(): ... option_table = click.option( diff --git a/docs/apache-airflow/empty_plugin/empty_plugin.py b/docs/apache-airflow/empty_plugin/empty_plugin.py index 31a782d2a44cb..6cfb9c2196c86 100644 --- a/docs/apache-airflow/empty_plugin/empty_plugin.py +++ b/docs/apache-airflow/empty_plugin/empty_plugin.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Plugins example""" + from __future__ import annotations from flask import Blueprint diff --git a/docs/build_docs.py b/docs/build_docs.py index 3035b9458be08..7520c247c6a52 100755 --- a/docs/build_docs.py +++ b/docs/build_docs.py @@ -20,6 +20,7 @@ # isort:skip_file (needed to workaround isort bug) """ + from __future__ import annotations import argparse diff --git a/docs/conf.py b/docs/conf.py index f2065439750dd..90c9b68e6f0ea 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,6 +17,7 @@ # specific language governing permissions and limitations # under the License. """Configuration of Airflow Docs""" + from __future__ import annotations # Airflow documentation build configuration file, created by diff --git a/docs/docker-stack/docker-examples/extending/embedding-dags/test_dag.py b/docs/docker-stack/docker-examples/extending/embedding-dags/test_dag.py index 54f59331e0c33..70b68487c2af3 100644 --- a/docs/docker-stack/docker-examples/extending/embedding-dags/test_dag.py +++ b/docs/docker-stack/docker-examples/extending/embedding-dags/test_dag.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """This dag only runs some simple tasks to test Airflow's task execution.""" + from __future__ import annotations # [START dag] diff --git a/docs/exts/docroles.py b/docs/exts/docroles.py index e0b0647d11368..e40e21cfbe30b 100644 --- a/docs/exts/docroles.py +++ b/docs/exts/docroles.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Document roles""" + from __future__ import annotations # diff --git a/docs/exts/provider_init_hack.py b/docs/exts/provider_init_hack.py index 33188c5db8046..819a78b95d7bf 100644 --- a/docs/exts/provider_init_hack.py +++ b/docs/exts/provider_init_hack.py @@ -19,6 +19,7 @@ which has implicit namespace support. Until that time, we make it look like a real package for building docs """ + from __future__ import annotations import os diff --git a/docs/exts/providers_extensions.py b/docs/exts/providers_extensions.py index 2a564a9ddc3c2..87c37f66406d8 100644 --- a/docs/exts/providers_extensions.py +++ b/docs/exts/providers_extensions.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Module for provider's custom Sphinx extensions that will be loaded in all providers' documentation.""" + from __future__ import annotations import ast diff --git a/docs/exts/redirects.py b/docs/exts/redirects.py index 373187f951081..2c69313d479cb 100644 --- a/docs/exts/redirects.py +++ b/docs/exts/redirects.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Based on: https://github.com/sphinx-contrib/redirects""" + from __future__ import annotations import os diff --git a/docs/exts/removemarktransform.py b/docs/exts/removemarktransform.py index 4706b1f1e8e0d..6e53dff2ffa58 100644 --- a/docs/exts/removemarktransform.py +++ b/docs/exts/removemarktransform.py @@ -17,6 +17,7 @@ # specific language governing permissions and limitations # under the License. """Remove Transform Mark for Sphinx""" + from __future__ import annotations import re diff --git a/pyproject.toml b/pyproject.toml index 02db8b616384c..97aceac2afad5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -339,7 +339,7 @@ devel-sentry = [ devel-static-checks = [ "black>=23.12.0", "pre-commit>=3.5.0", - "ruff==0.2.1", + "ruff==0.3.3", "yamllint>=1.33.0", ] devel-tests = [ diff --git a/scripts/ci/pre_commit/pre_commit_changelog_duplicates.py b/scripts/ci/pre_commit/pre_commit_changelog_duplicates.py index a84e27d1e9905..b96526f2e85d7 100755 --- a/scripts/ci/pre_commit/pre_commit_changelog_duplicates.py +++ b/scripts/ci/pre_commit/pre_commit_changelog_duplicates.py @@ -19,6 +19,7 @@ """ Make sure there aren't duplicate entries in changelogs """ + from __future__ import annotations import re diff --git a/scripts/ci/pre_commit/pre_commit_check_extra_packages_ref.py b/scripts/ci/pre_commit/pre_commit_check_extra_packages_ref.py index 1dbd2d9fbe8a6..dbeca287de4cb 100755 --- a/scripts/ci/pre_commit/pre_commit_check_extra_packages_ref.py +++ b/scripts/ci/pre_commit/pre_commit_check_extra_packages_ref.py @@ -19,6 +19,7 @@ """ Checks if all the libraries in setup.py are listed in installation.rst file """ + from __future__ import annotations import re diff --git a/scripts/ci/pre_commit/pre_commit_check_integrations_list.py b/scripts/ci/pre_commit/pre_commit_check_integrations_list.py index 5ad9974d4cbbd..8466c2e897ada 100755 --- a/scripts/ci/pre_commit/pre_commit_check_integrations_list.py +++ b/scripts/ci/pre_commit/pre_commit_check_integrations_list.py @@ -22,6 +22,7 @@ Compare the contents of the integrations table and the docker-compose integration files, if there is a mismatch, the table is generated. """ + from __future__ import annotations import re diff --git a/scripts/ci/pre_commit/pre_commit_check_order_dockerfile_extras.py b/scripts/ci/pre_commit/pre_commit_check_order_dockerfile_extras.py index a57eee9a89818..3ff8822f3a689 100755 --- a/scripts/ci/pre_commit/pre_commit_check_order_dockerfile_extras.py +++ b/scripts/ci/pre_commit/pre_commit_check_order_dockerfile_extras.py @@ -19,6 +19,7 @@ """ Check if extras in Dockerfile are reflected in docker build-arg-ref.rst and global constants. """ + from __future__ import annotations import sys diff --git a/scripts/ci/pre_commit/pre_commit_check_order_pyproject_toml.py b/scripts/ci/pre_commit/pre_commit_check_order_pyproject_toml.py index 0fbdf357f3aaf..46fa056c537f5 100755 --- a/scripts/ci/pre_commit/pre_commit_check_order_pyproject_toml.py +++ b/scripts/ci/pre_commit/pre_commit_check_order_pyproject_toml.py @@ -19,6 +19,7 @@ """ Test for an order of dependencies in setup.py """ + from __future__ import annotations import re diff --git a/scripts/ci/pre_commit/pre_commit_check_pre_commit_hooks.py b/scripts/ci/pre_commit/pre_commit_check_pre_commit_hooks.py index 8929440703cf5..727b4d4bc0425 100755 --- a/scripts/ci/pre_commit/pre_commit_check_pre_commit_hooks.py +++ b/scripts/ci/pre_commit/pre_commit_check_pre_commit_hooks.py @@ -19,6 +19,7 @@ """ Module to check pre-commit hook names for length """ + from __future__ import annotations import argparse diff --git a/scripts/ci/pre_commit/pre_commit_newsfragments.py b/scripts/ci/pre_commit/pre_commit_newsfragments.py index 2742d6ddbf703..ecd03a6d8e39b 100755 --- a/scripts/ci/pre_commit/pre_commit_newsfragments.py +++ b/scripts/ci/pre_commit/pre_commit_newsfragments.py @@ -20,6 +20,7 @@ Check things about newsfragments: - Only a single line, except for `significant` changes which can have a blank line, then the body """ + from __future__ import annotations import sys diff --git a/scripts/ci/pre_commit/pre_commit_update_chart_dependencies.py b/scripts/ci/pre_commit/pre_commit_update_chart_dependencies.py index 51e859e076dc8..939c2278972df 100755 --- a/scripts/ci/pre_commit/pre_commit_update_chart_dependencies.py +++ b/scripts/ci/pre_commit/pre_commit_update_chart_dependencies.py @@ -74,7 +74,7 @@ def get_latest_prometheus_statsd_exporter_version() -> str: result_lines.append("") VALUES_YAML_FILE.write_text("\n".join(result_lines)) schema_file = json.loads(VALUES_SCHEMA_FILE.read_text()) - schema_file["properties"]["images"]["properties"]["statsd"]["properties"]["tag"][ - "default" - ] = latest_prometheus_statsd_exporter_version + schema_file["properties"]["images"]["properties"]["statsd"]["properties"]["tag"]["default"] = ( + latest_prometheus_statsd_exporter_version + ) VALUES_SCHEMA_FILE.write_text(json.dumps(schema_file, indent=4) + "\n") diff --git a/scripts/in_container/run_migration_reference.py b/scripts/in_container/run_migration_reference.py index c96768e616221..8a3ad52e1f6f9 100755 --- a/scripts/in_container/run_migration_reference.py +++ b/scripts/in_container/run_migration_reference.py @@ -19,6 +19,7 @@ """ Module to update db migration information in Airflow """ + from __future__ import annotations import os diff --git a/scripts/in_container/run_prepare_er_diagram.py b/scripts/in_container/run_prepare_er_diagram.py index 282cc03324a33..1f4578bf2235a 100755 --- a/scripts/in_container/run_prepare_er_diagram.py +++ b/scripts/in_container/run_prepare_er_diagram.py @@ -19,6 +19,7 @@ """ Module to update db migration information in Airflow """ + from __future__ import annotations import os diff --git a/tests/api_connexion/endpoints/test_plugin_endpoint.py b/tests/api_connexion/endpoints/test_plugin_endpoint.py index 57c3387ae0759..f56d04a764433 100644 --- a/tests/api_connexion/endpoints/test_plugin_endpoint.py +++ b/tests/api_connexion/endpoints/test_plugin_endpoint.py @@ -36,12 +36,10 @@ pytestmark = pytest.mark.db_test -class PluginHook(BaseHook): - ... +class PluginHook(BaseHook): ... -def plugin_macro(): - ... +def plugin_macro(): ... class MockOperatorLink(BaseOperatorLink): @@ -54,8 +52,7 @@ def get_link(self, operator, *, ti_key) -> str: bp = Blueprint("mock_blueprint", __name__, url_prefix="/mock_blueprint") -class MockView(BaseView): - ... +class MockView(BaseView): ... mockview = MockView() diff --git a/tests/api_connexion/schemas/test_plugin_schema.py b/tests/api_connexion/schemas/test_plugin_schema.py index 0511072585f26..a7560ea6b7b05 100644 --- a/tests/api_connexion/schemas/test_plugin_schema.py +++ b/tests/api_connexion/schemas/test_plugin_schema.py @@ -29,12 +29,10 @@ from airflow.plugins_manager import AirflowPlugin -class PluginHook(BaseHook): - ... +class PluginHook(BaseHook): ... -def plugin_macro(): - ... +def plugin_macro(): ... class MockOperatorLink(BaseOperatorLink): @@ -47,8 +45,7 @@ def get_link(self, operator, *, ti_key) -> str: bp = Blueprint("mock_blueprint", __name__, url_prefix="/mock_blueprint") -class MockView(BaseView): - ... +class MockView(BaseView): ... appbuilder_menu_items = { diff --git a/tests/conftest.py b/tests/conftest.py index c1d846f8bc9b5..bb6b37ea40d8f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -539,15 +539,10 @@ def skip_if_integration_disabled(marker, item): environment_variable_value = os.environ.get(environment_variable_name) if not environment_variable_value or environment_variable_value != "true": pytest.skip( - "The test requires {integration_name} integration started and " - "{name} environment variable to be set to true (it is '{value}')." - " It can be set by specifying '--integration {integration_name}' at breeze startup" - ": {item}".format( - name=environment_variable_name, - value=environment_variable_value, - integration_name=integration_name, - item=item, - ) + f"The test requires {integration_name} integration started and " + f"{environment_variable_name} environment variable to be set to true (it is '{environment_variable_value}')." + f" It can be set by specifying '--integration {integration_name}' at breeze startup" + f": {item}" ) @@ -1360,15 +1355,12 @@ def configure_warning_output(config): # pytest-mock @pytest.fixture - def mocker() -> MockerFixture: - ... + def mocker() -> MockerFixture: ... # requests-mock @pytest.fixture - def requests_mock() -> RequestsMockFixture: - ... + def requests_mock() -> RequestsMockFixture: ... # time-machine @pytest.fixture # type: ignore[no-redef] - def time_machine() -> TimeMachineFixture: - ... + def time_machine() -> TimeMachineFixture: ... diff --git a/tests/dags/test_issue_1225.py b/tests/dags/test_issue_1225.py index 0930d7ebda294..f4312a42c4d8c 100644 --- a/tests/dags/test_issue_1225.py +++ b/tests/dags/test_issue_1225.py @@ -20,6 +20,7 @@ by a BackfillJob. Addresses issue #1225. """ + from __future__ import annotations from datetime import datetime, timedelta diff --git a/tests/dags/test_miscellaneous.py b/tests/dags/test_miscellaneous.py index 50240ae92bab4..c19277a617571 100644 --- a/tests/dags/test_miscellaneous.py +++ b/tests/dags/test_miscellaneous.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the BashOperator.""" + from __future__ import annotations import datetime diff --git a/tests/dags/test_subdag.py b/tests/dags/test_subdag.py index 02ff02cfb2f93..ca418569c3e73 100644 --- a/tests/dags/test_subdag.py +++ b/tests/dags/test_subdag.py @@ -18,6 +18,7 @@ """ A DAG with subdag for testing purpose. """ + from __future__ import annotations import warnings diff --git a/tests/dags/test_task_view_type_check.py b/tests/dags/test_task_view_type_check.py index d7d65fb29419e..cb81e410fdb24 100644 --- a/tests/dags/test_task_view_type_check.py +++ b/tests/dags/test_task_view_type_check.py @@ -18,6 +18,7 @@ """ DAG designed to test a PythonOperator that calls a functool.partial """ + from __future__ import annotations import functools diff --git a/tests/decorators/test_bash.py b/tests/decorators/test_bash.py index d745c6ac1053b..612e6a3327256 100644 --- a/tests/decorators/test_bash.py +++ b/tests/decorators/test_bash.py @@ -70,8 +70,7 @@ def test_bash_decorator_init(self): with self.dag: @task.bash - def bash(): - ... + def bash(): ... bash_task = bash() diff --git a/tests/decorators/test_python.py b/tests/decorators/test_python.py index 758aec63178f1..fde79a4784572 100644 --- a/tests/decorators/test_python.py +++ b/tests/decorators/test_python.py @@ -134,11 +134,9 @@ def t1() -> Union[str, None]: def test_infer_multiple_outputs_forward_annotation(self): if TYPE_CHECKING: - class FakeTypeCheckingOnlyClass: - ... + class FakeTypeCheckingOnlyClass: ... - class UnresolveableName: - ... + class UnresolveableName: ... @task_decorator def t1(x: "FakeTypeCheckingOnlyClass", y: int) -> Dict[int, int]: # type: ignore[empty-body] @@ -158,10 +156,9 @@ def t2(x: "FakeTypeCheckingOnlyClass", y: int) -> "Dict[int, int]": # type: ign def t3( # type: ignore[empty-body] x: "FakeTypeCheckingOnlyClass", y: int, - ) -> "UnresolveableName[int, int]": - ... + ) -> "UnresolveableName[int, int]": ... - line = sys._getframe().f_lineno - 6 if PY38 else sys._getframe().f_lineno - 3 + line = sys._getframe().f_lineno - 5 if PY38 else sys._getframe().f_lineno - 2 if PY311: # extra line explaining the error location in Py311 line = line - 1 @@ -729,8 +726,7 @@ def task1(): return ["x"] @task_decorator - def task2(arg1, arg2): - ... + def task2(arg1, arg2): ... task2.partial(arg1=1).expand(arg2=task1()) @@ -757,8 +753,7 @@ def task1(arg): return ["x" * arg] @task_decorator(retry_delay=30) - def task2(arg1, arg2): - ... + def task2(arg1, arg2): ... task2.partial(arg1=1).expand(arg2=task1.expand(arg=[1, 2])) @@ -782,8 +777,7 @@ def task2(arg1, arg2): def test_mapped_render_template_fields(dag_maker, session): @task_decorator - def fn(arg1, arg2): - ... + def fn(arg1, arg2): ... with set_current_task_instance_session(session=session): with dag_maker(session=session): @@ -921,8 +915,7 @@ def some_task(): return 1 @task_decorator - def other(x): - ... + def other(x): ... with DAG(dag_id="test", start_date=DEFAULT_DATE, schedule=None): other(some_task()) diff --git a/tests/decorators/test_short_circuit.py b/tests/decorators/test_short_circuit.py index f5ad68bdeac79..8ac289a4c6bcd 100644 --- a/tests/decorators/test_short_circuit.py +++ b/tests/decorators/test_short_circuit.py @@ -34,8 +34,7 @@ def test_short_circuit_decorator(dag_maker): with dag_maker(): @task - def empty(): - ... + def empty(): ... @task.short_circuit() def short_circuit(condition): diff --git a/tests/decorators/test_task_group.py b/tests/decorators/test_task_group.py index 20f1f0e60ee3d..39e6fcf464304 100644 --- a/tests/decorators/test_task_group.py +++ b/tests/decorators/test_task_group.py @@ -38,8 +38,7 @@ def test_task_group_with_overridden_kwargs(): }, add_suffix_on_collision=True, ) - def simple_tg(): - ... + def simple_tg(): ... tg_with_overridden_kwargs = simple_tg.override( group_id="custom_group_id", diff --git a/tests/hooks/test_package_index.py b/tests/hooks/test_package_index.py index 169d6cce5da05..34a218290426d 100644 --- a/tests/hooks/test_package_index.py +++ b/tests/hooks/test_package_index.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Test for Package Index Hook.""" + from __future__ import annotations import pytest diff --git a/tests/jobs/test_backfill_job.py b/tests/jobs/test_backfill_job.py index 0802f11aa9b31..18f6a47ce0884 100644 --- a/tests/jobs/test_backfill_job.py +++ b/tests/jobs/test_backfill_job.py @@ -879,12 +879,12 @@ def test_backfill_retry_intermittent_failed_task(self, dag_maker): dag_maker.create_dagrun(state=None) executor = MockExecutor(parallelism=16) - executor.mock_task_results[ - TaskInstanceKey(dag.dag_id, task1.task_id, DEFAULT_DATE, try_number=1) - ] = State.UP_FOR_RETRY - executor.mock_task_results[ - TaskInstanceKey(dag.dag_id, task1.task_id, DEFAULT_DATE, try_number=2) - ] = State.UP_FOR_RETRY + executor.mock_task_results[TaskInstanceKey(dag.dag_id, task1.task_id, DEFAULT_DATE, try_number=1)] = ( + State.UP_FOR_RETRY + ) + executor.mock_task_results[TaskInstanceKey(dag.dag_id, task1.task_id, DEFAULT_DATE, try_number=2)] = ( + State.UP_FOR_RETRY + ) job = Job(executor=executor) job_runner = BackfillJobRunner( job=job, @@ -907,9 +907,9 @@ def test_backfill_retry_always_failed_task(self, dag_maker): dr = dag_maker.create_dagrun(state=None) executor = MockExecutor(parallelism=16) - executor.mock_task_results[ - TaskInstanceKey(dag.dag_id, task1.task_id, dr.run_id, try_number=1) - ] = State.UP_FOR_RETRY + executor.mock_task_results[TaskInstanceKey(dag.dag_id, task1.task_id, dr.run_id, try_number=1)] = ( + State.UP_FOR_RETRY + ) executor.mock_task_fail(dag.dag_id, task1.task_id, dr.run_id, try_number=2) job = Job(executor=executor) job_runner = BackfillJobRunner( diff --git a/tests/models/test_baseoperator.py b/tests/models/test_baseoperator.py index 959bea7209be1..989e772074eee 100644 --- a/tests/models/test_baseoperator.py +++ b/tests/models/test_baseoperator.py @@ -86,8 +86,7 @@ class DummyClass(metaclass=BaseOperatorMeta): def __init__(self, test_param, params=None, default_args=None): self.test_param = test_param - def set_xcomargs_dependencies(self): - ... + def set_xcomargs_dependencies(self): ... class DummySubClass(DummyClass): diff --git a/tests/models/test_dag.py b/tests/models/test_dag.py index 2836fb827fb29..27a4be3ce6cfe 100644 --- a/tests/models/test_dag.py +++ b/tests/models/test_dag.py @@ -3050,8 +3050,7 @@ def teardown_method(self): def test_fileloc(self): @dag_decorator(default_args=self.DEFAULT_ARGS) - def noop_pipeline(): - ... + def noop_pipeline(): ... dag = noop_pipeline() assert isinstance(dag, DAG) @@ -3062,8 +3061,7 @@ def test_set_dag_id(self): """Test that checks you can set dag_id from decorator.""" @dag_decorator("test", default_args=self.DEFAULT_ARGS) - def noop_pipeline(): - ... + def noop_pipeline(): ... dag = noop_pipeline() assert isinstance(dag, DAG) @@ -3073,8 +3071,7 @@ def test_default_dag_id(self): """Test that @dag uses function name as default dag id.""" @dag_decorator(default_args=self.DEFAULT_ARGS) - def noop_pipeline(): - ... + def noop_pipeline(): ... dag = noop_pipeline() assert isinstance(dag, DAG) @@ -3130,8 +3127,7 @@ def test_resolve_documentation_template_file_rendered(self, tmp_path): @dag_decorator( "test-dag", start_date=DEFAULT_DATE, template_searchpath=os.fspath(path.parent), doc_md=path.name ) - def markdown_docs(): - ... + def markdown_docs(): ... dag = markdown_docs() assert isinstance(dag, DAG) @@ -3227,8 +3223,7 @@ def return_num(num): def test_warning_location(self): # NOTE: This only works as long as there is some warning we can emit from `DAG()` @dag_decorator(schedule_interval=None) - def mydag(): - ... + def mydag(): ... with pytest.warns(RemovedInAirflow3Warning) as warnings: line = sys._getframe().f_lineno + 1 @@ -4106,16 +4101,13 @@ def test_clearing_setup_clears_teardown_taskflow(self, upstream, downstream, exp with DAG(dag_id="test_dag", start_date=pendulum.now()) as dag: @setup - def my_setup(): - ... + def my_setup(): ... @task_decorator - def my_work(): - ... + def my_work(): ... @teardown - def my_teardown(): - ... + def my_teardown(): ... s1 = my_setup() w1 = my_work() diff --git a/tests/models/test_dagrun.py b/tests/models/test_dagrun.py index 7a76871718904..80b3a5165320a 100644 --- a/tests/models/test_dagrun.py +++ b/tests/models/test_dagrun.py @@ -1042,8 +1042,7 @@ def test_mapped_literal_verify_integrity(dag_maker, session): with dag_maker(session=session) as dag: @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=[1, 2, 3, 4]) @@ -1079,8 +1078,7 @@ def test_mapped_literal_to_xcom_arg_verify_integrity(dag_maker, session): t1 = BaseOperator(task_id="task_1") @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=[1, 2, 3, 4]) @@ -1120,8 +1118,7 @@ def test_mapped_literal_length_increase_adds_additional_ti(dag_maker, session): with dag_maker(session=session) as dag: @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=[1, 2, 3, 4]) @@ -1166,8 +1163,7 @@ def test_mapped_literal_length_reduction_adds_removed_state(dag_maker, session): with dag_maker(session=session) as dag: @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=[1, 2, 3, 4]) @@ -1219,8 +1215,7 @@ def task_1(): with dag_maker(session=session) as dag: @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=task_1()) @@ -1284,8 +1279,7 @@ def task_1(): with dag_maker(session=session) as dag: @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=task_1()) @@ -1346,8 +1340,7 @@ def task_1(): return [1, 2] @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=task_1()) @@ -1381,8 +1374,7 @@ def task_1(): with dag_maker(session=session) as dag: @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=task_1()) @@ -1439,8 +1431,7 @@ def task_1(): with dag_maker(session=session) as dag: @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=task_1()) @@ -1527,8 +1518,7 @@ def task_1(): with dag_maker(session=session) as dag: @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=task_1()) @@ -1607,8 +1597,7 @@ def task_1(): with dag_maker(session=session) as dag: @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=task_1()) @@ -1689,8 +1678,7 @@ def task_1(): with dag_maker(session=session) as dag: @task - def task_2(arg2): - ... + def task_2(arg2): ... task_2.expand(arg2=task_1()) diff --git a/tests/models/test_mappedoperator.py b/tests/models/test_mappedoperator.py index 5bd7d9a0c1062..64304cf3069ab 100644 --- a/tests/models/test_mappedoperator.py +++ b/tests/models/test_mappedoperator.py @@ -1658,8 +1658,7 @@ def double(n): return n * 2 @task - def last(n): - ... + def last(n): ... @task_group def group(n: int) -> None: @@ -1686,8 +1685,7 @@ def double(n): return n * 2 @task - def last(n): - ... + def last(n): ... @task_group def group(n: int) -> None: diff --git a/tests/models/test_renderedtifields.py b/tests/models/test_renderedtifields.py index 2652218e1d42d..a7b25a317119b 100644 --- a/tests/models/test_renderedtifields.py +++ b/tests/models/test_renderedtifields.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Unit tests for RenderedTaskInstanceFields.""" + from __future__ import annotations import os diff --git a/tests/models/test_serialized_dag.py b/tests/models/test_serialized_dag.py index 1967c74f1a25a..627943c6fd4bd 100644 --- a/tests/models/test_serialized_dag.py +++ b/tests/models/test_serialized_dag.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Unit tests for SerializedDagModel.""" + from __future__ import annotations from unittest import mock diff --git a/tests/models/test_skipmixin.py b/tests/models/test_skipmixin.py index f69f588bc1581..de37d9a8f3bd3 100644 --- a/tests/models/test_skipmixin.py +++ b/tests/models/test_skipmixin.py @@ -141,8 +141,7 @@ def test_mapped_tasks_skip_all_except(self, dag_maker): with dag_maker("dag_test_skip_all_except") as dag: @task - def branch_op(k): - ... + def branch_op(k): ... @task_group def task_group_op(k): diff --git a/tests/plugins/workday.py b/tests/plugins/workday.py index a73cf12a555c8..2ee2ba6effe25 100644 --- a/tests/plugins/workday.py +++ b/tests/plugins/workday.py @@ -20,6 +20,7 @@ This simply forwards the timetable from ``airflow.example_dags``, so we can make it discoverable to unit tests without exposing the entire subpackage. """ + from __future__ import annotations from airflow.example_dags.plugins.workday import AfterWorkdayTimetable, WorkdayTimetablePlugin diff --git a/tests/providers/amazon/aws/executors/batch/test_batch_executor.py b/tests/providers/amazon/aws/executors/batch/test_batch_executor.py index abfe0da1afb8d..c34b696210695 100644 --- a/tests/providers/amazon/aws/executors/batch/test_batch_executor.py +++ b/tests/providers/amazon/aws/executors/batch/test_batch_executor.py @@ -532,9 +532,9 @@ def test_start_health_check_config(self, set_env_vars): batch_mock.describe_jobs.side_effect = {} executor.batch = batch_mock - os.environ[ - f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllBatchConfigKeys.CHECK_HEALTH_ON_STARTUP}".upper() - ] = "False" + os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllBatchConfigKeys.CHECK_HEALTH_ON_STARTUP}".upper()] = ( + "False" + ) executor.start() diff --git a/tests/providers/amazon/aws/executors/ecs/test_ecs_executor.py b/tests/providers/amazon/aws/executors/ecs/test_ecs_executor.py index 35ce4f0a9b6f2..c4c7c6c9c7351 100644 --- a/tests/providers/amazon/aws/executors/ecs/test_ecs_executor.py +++ b/tests/providers/amazon/aws/executors/ecs/test_ecs_executor.py @@ -1076,12 +1076,12 @@ def test_subnets_required(self): os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.REGION_NAME}".upper()] = "us-west-1" os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CLUSTER}".upper()] = "some-cluster" - os.environ[ - f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CONTAINER_NAME}".upper() - ] = "container-name" - os.environ[ - f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.TASK_DEFINITION}".upper() - ] = "some-task-def" + os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CONTAINER_NAME}".upper()] = ( + "container-name" + ) + os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.TASK_DEFINITION}".upper()] = ( + "some-task-def" + ) os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.LAUNCH_TYPE}".upper()] = "FARGATE" os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.PLATFORM_VERSION}".upper()] = "LATEST" os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.ASSIGN_PUBLIC_IP}".upper()] = "False" @@ -1092,9 +1092,9 @@ def test_subnets_required(self): assert raised.match("At least one subnet is required to run a task.") def test_config_defaults_are_applied(self, assign_subnets): - os.environ[ - f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CONTAINER_NAME}".upper() - ] = "container-name" + os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CONTAINER_NAME}".upper()] = ( + "container-name" + ) from airflow.providers.amazon.aws.executors.ecs import ecs_executor_config task_kwargs = _recursive_flatten_dict(ecs_executor_config.build_task_kwargs()) @@ -1298,18 +1298,18 @@ def test_start_health_check_config(self, set_env_vars): executor.ecs = ecs_mock - os.environ[ - f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CHECK_HEALTH_ON_STARTUP}".upper() - ] = "False" + os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CHECK_HEALTH_ON_STARTUP}".upper()] = ( + "False" + ) executor.start() ecs_mock.stop_task.assert_not_called() def test_providing_both_capacity_provider_and_launch_type_fails(self, set_env_vars): - os.environ[ - f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CAPACITY_PROVIDER_STRATEGY}".upper() - ] = "[{'capacityProvider': 'cp1', 'weight': 5}, {'capacityProvider': 'cp2', 'weight': 1}]" + os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CAPACITY_PROVIDER_STRATEGY}".upper()] = ( + "[{'capacityProvider': 'cp1', 'weight': 5}, {'capacityProvider': 'cp2', 'weight': 1}]" + ) expected_error = ( "capacity_provider_strategy and launch_type are mutually exclusive, you can not provide both." ) @@ -1324,9 +1324,9 @@ def test_providing_capacity_provider(self, set_env_vars): "[{'capacityProvider': 'cp1', 'weight': 5}, {'capacityProvider': 'cp2', 'weight': 1}]" ) - os.environ[ - f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CAPACITY_PROVIDER_STRATEGY}".upper() - ] = valid_capacity_provider + os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.CAPACITY_PROVIDER_STRATEGY}".upper()] = ( + valid_capacity_provider + ) os.environ.pop(f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllEcsConfigKeys.LAUNCH_TYPE}".upper()) from airflow.providers.amazon.aws.executors.ecs import ecs_executor_config diff --git a/tests/providers/amazon/aws/hooks/test_s3.py b/tests/providers/amazon/aws/hooks/test_s3.py index 9ee5e05a9a2d3..5404ae02c3d71 100644 --- a/tests/providers/amazon/aws/hooks/test_s3.py +++ b/tests/providers/amazon/aws/hooks/test_s3.py @@ -320,7 +320,7 @@ def test_get_key(self, s3_bucket): def test_read_key(self, s3_bucket): hook = S3Hook() bucket = hook.get_bucket(s3_bucket) - bucket.put_object(Key="my_key", Body=b"Cont\xC3\xA9nt") + bucket.put_object(Key="my_key", Body=b"Cont\xc3\xa9nt") assert hook.read_key("my_key", s3_bucket) == "Contént" @@ -328,7 +328,7 @@ def test_read_key(self, s3_bucket): @mock.patch("airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook.get_client_type") def test_select_key(self, mock_get_client_type, s3_bucket): mock_get_client_type.return_value.select_object_content.return_value = { - "Payload": [{"Records": {"Payload": b"Cont\xC3"}}, {"Records": {"Payload": b"\xA9nt"}}] + "Payload": [{"Records": {"Payload": b"Cont\xc3"}}, {"Records": {"Payload": b"\xa9nt"}}] } hook = S3Hook() assert hook.select_key("my_key", s3_bucket) == "Contént" @@ -386,14 +386,14 @@ def test_load_string(self, s3_bucket): hook = S3Hook() hook.load_string("Contént", "my_key", s3_bucket) resource = boto3.resource("s3").Object(s3_bucket, "my_key") - assert resource.get()["Body"].read() == b"Cont\xC3\xA9nt" + assert resource.get()["Body"].read() == b"Cont\xc3\xa9nt" def test_load_string_compress(self, s3_bucket): hook = S3Hook() hook.load_string("Contént", "my_key", s3_bucket, compression="gzip") resource = boto3.resource("s3").Object(s3_bucket, "my_key") data = gz.decompress(resource.get()["Body"].read()) - assert data == b"Cont\xC3\xA9nt" + assert data == b"Cont\xc3\xa9nt" def test_load_string_compress_exception(self, s3_bucket): hook = S3Hook() diff --git a/tests/providers/amazon/aws/operators/test_base_aws.py b/tests/providers/amazon/aws/operators/test_base_aws.py index 4cc9080029e4f..ce2c1e41add4a 100644 --- a/tests/providers/amazon/aws/operators/test_base_aws.py +++ b/tests/providers/amazon/aws/operators/test_base_aws.py @@ -147,8 +147,7 @@ def test_conflicting_region_name(self): ) def test_no_aws_hook_class_attr(self): - class NoAwsHookClassOperator(AwsBaseOperator): - ... + class NoAwsHookClassOperator(AwsBaseOperator): ... error_match = r"Class attribute 'NoAwsHookClassOperator\.aws_hook_class' should be set" with pytest.raises(AttributeError, match=error_match): diff --git a/tests/providers/amazon/aws/sensors/test_base_aws.py b/tests/providers/amazon/aws/sensors/test_base_aws.py index a5cbe23a49824..50ea5d1bd4c75 100644 --- a/tests/providers/amazon/aws/sensors/test_base_aws.py +++ b/tests/providers/amazon/aws/sensors/test_base_aws.py @@ -149,8 +149,7 @@ def test_conflicting_region_name(self): ) def test_no_aws_hook_class_attr(self): - class NoAwsHookClassSensor(AwsBaseSensor): - ... + class NoAwsHookClassSensor(AwsBaseSensor): ... error_match = r"Class attribute 'NoAwsHookClassSensor\.aws_hook_class' should be set" with pytest.raises(AttributeError, match=error_match): diff --git a/tests/providers/amazon/aws/system/utils/test_helpers.py b/tests/providers/amazon/aws/system/utils/test_helpers.py index 9ed07dcaa26fd..30575cb083e0f 100644 --- a/tests/providers/amazon/aws/system/utils/test_helpers.py +++ b/tests/providers/amazon/aws/system/utils/test_helpers.py @@ -18,6 +18,7 @@ This module contains the unit tests for the helper methods included in the Amazon System Tests found at tests/system/providers/amazon/aws/utils/__init__.py """ + from __future__ import annotations import os diff --git a/tests/providers/amazon/aws/transfers/test_exasol_to_s3.py b/tests/providers/amazon/aws/transfers/test_exasol_to_s3.py index fd95eb88a3d86..2b2b05db7b6f1 100644 --- a/tests/providers/amazon/aws/transfers/test_exasol_to_s3.py +++ b/tests/providers/amazon/aws/transfers/test_exasol_to_s3.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Transfers data from Exasol database into a S3 Bucket.""" + from __future__ import annotations from unittest import mock diff --git a/tests/providers/amazon/aws/utils/eks_test_constants.py b/tests/providers/amazon/aws/utils/eks_test_constants.py index 63ff4cca5d72e..5e8888ca7bc08 100644 --- a/tests/providers/amazon/aws/utils/eks_test_constants.py +++ b/tests/providers/amazon/aws/utils/eks_test_constants.py @@ -18,6 +18,7 @@ """ This file should only contain constants used for the EKS tests. """ + from __future__ import annotations import re diff --git a/tests/providers/cncf/kubernetes/hooks/test_kubernetes.py b/tests/providers/cncf/kubernetes/hooks/test_kubernetes.py index 036cd6bda3a73..a1239364e4bb2 100644 --- a/tests/providers/cncf/kubernetes/hooks/test_kubernetes.py +++ b/tests/providers/cncf/kubernetes/hooks/test_kubernetes.py @@ -52,8 +52,7 @@ POLL_INTERVAL = 100 -class DeprecationRemovalRequired(AirflowException): - ... +class DeprecationRemovalRequired(AirflowException): ... DEFAULT_CONN_ID = "kubernetes_default" diff --git a/tests/providers/elasticsearch/log/test_es_task_handler.py b/tests/providers/elasticsearch/log/test_es_task_handler.py index 901ef77c5fb76..18a1ccb967f95 100644 --- a/tests/providers/elasticsearch/log/test_es_task_handler.py +++ b/tests/providers/elasticsearch/log/test_es_task_handler.py @@ -646,8 +646,7 @@ def test_dynamic_offset(self, stdout_mock, ti, time_machine): def test_safe_attrgetter(): - class A: - ... + class A: ... a = A() a.b = "b" diff --git a/tests/providers/google/cloud/hooks/test_bigquery_system.py b/tests/providers/google/cloud/hooks/test_bigquery_system.py index 16dca6840e2ef..3076f4a123e37 100644 --- a/tests/providers/google/cloud/hooks/test_bigquery_system.py +++ b/tests/providers/google/cloud/hooks/test_bigquery_system.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """System tests for Google BigQuery hooks""" + from __future__ import annotations import pytest diff --git a/tests/providers/google/cloud/hooks/test_cloud_build.py b/tests/providers/google/cloud/hooks/test_cloud_build.py index c6da23c8878d6..7fb00f279f7cc 100644 --- a/tests/providers/google/cloud/hooks/test_cloud_build.py +++ b/tests/providers/google/cloud/hooks/test_cloud_build.py @@ -19,6 +19,7 @@ This module contains various unit tests for functions in CloudBuildHook """ + from __future__ import annotations from concurrent.futures import Future diff --git a/tests/providers/google/cloud/hooks/test_dlp.py b/tests/providers/google/cloud/hooks/test_dlp.py index 90efdba01790c..186d5de1732b3 100644 --- a/tests/providers/google/cloud/hooks/test_dlp.py +++ b/tests/providers/google/cloud/hooks/test_dlp.py @@ -19,6 +19,7 @@ This module contains various unit tests for functions in CloudDLPHook """ + from __future__ import annotations from typing import Any diff --git a/tests/providers/google/cloud/hooks/test_life_sciences.py b/tests/providers/google/cloud/hooks/test_life_sciences.py index 63ebbff4ddb1e..582b856b22c8b 100644 --- a/tests/providers/google/cloud/hooks/test_life_sciences.py +++ b/tests/providers/google/cloud/hooks/test_life_sciences.py @@ -18,6 +18,7 @@ """ Tests for Google Cloud Life Sciences Hook """ + from __future__ import annotations from unittest import mock diff --git a/tests/providers/google/cloud/operators/test_cloud_build.py b/tests/providers/google/cloud/operators/test_cloud_build.py index b5c2622c16be2..8fbc5af4661c4 100644 --- a/tests/providers/google/cloud/operators/test_cloud_build.py +++ b/tests/providers/google/cloud/operators/test_cloud_build.py @@ -18,6 +18,7 @@ """ This module contains various unit tests for GCP Cloud Build Operators """ + from __future__ import annotations import json diff --git a/tests/providers/google/cloud/operators/test_cloud_run.py b/tests/providers/google/cloud/operators/test_cloud_run.py index 855190efd149c..cfd37a16bb174 100644 --- a/tests/providers/google/cloud/operators/test_cloud_run.py +++ b/tests/providers/google/cloud/operators/test_cloud_run.py @@ -18,6 +18,7 @@ """ This module contains various unit tests for GCP Cloud Build Operators """ + from __future__ import annotations from unittest import mock diff --git a/tests/providers/google/cloud/operators/test_dlp.py b/tests/providers/google/cloud/operators/test_dlp.py index 091fe9d1dc32f..585bea5308997 100644 --- a/tests/providers/google/cloud/operators/test_dlp.py +++ b/tests/providers/google/cloud/operators/test_dlp.py @@ -18,6 +18,7 @@ """ This module contains various unit tests for Google Cloud DLP Operators """ + from __future__ import annotations from unittest import mock diff --git a/tests/providers/google/cloud/operators/test_life_sciences.py b/tests/providers/google/cloud/operators/test_life_sciences.py index edb11432bea7e..b5b33e58f6fe4 100644 --- a/tests/providers/google/cloud/operators/test_life_sciences.py +++ b/tests/providers/google/cloud/operators/test_life_sciences.py @@ -15,7 +15,8 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Tests for Google Life Sciences Run Pipeline operator """ +"""Tests for Google Life Sciences Run Pipeline operator""" + from __future__ import annotations from unittest import mock diff --git a/tests/providers/google/firebase/hooks/test_firestore.py b/tests/providers/google/firebase/hooks/test_firestore.py index fee7595426733..e6c17105a60fc 100644 --- a/tests/providers/google/firebase/hooks/test_firestore.py +++ b/tests/providers/google/firebase/hooks/test_firestore.py @@ -17,6 +17,7 @@ """ Tests for Google Cloud Firestore """ + from __future__ import annotations from unittest import mock diff --git a/tests/providers/google/suite/hooks/test_calendar.py b/tests/providers/google/suite/hooks/test_calendar.py index 8ad68f6d1f5af..e072043f6ea5d 100644 --- a/tests/providers/google/suite/hooks/test_calendar.py +++ b/tests/providers/google/suite/hooks/test_calendar.py @@ -18,6 +18,7 @@ """ Unit Tests for the Google Calendar Hook """ + from __future__ import annotations from unittest import mock diff --git a/tests/providers/google/suite/hooks/test_sheets.py b/tests/providers/google/suite/hooks/test_sheets.py index 86355f078640a..ca3159d7d1c93 100644 --- a/tests/providers/google/suite/hooks/test_sheets.py +++ b/tests/providers/google/suite/hooks/test_sheets.py @@ -18,6 +18,7 @@ """ Unit Tests for the GSheets Hook """ + from __future__ import annotations from unittest import mock diff --git a/tests/providers/sendgrid/utils/test_emailer.py b/tests/providers/sendgrid/utils/test_emailer.py index e3428e349efa7..d9165a13d3055 100644 --- a/tests/providers/sendgrid/utils/test_emailer.py +++ b/tests/providers/sendgrid/utils/test_emailer.py @@ -49,9 +49,9 @@ def setup_method(self): self.categories = ["cat1", "cat2"] # extras self.expected_mail_data_extras = copy.deepcopy(self.expected_mail_data) - self.expected_mail_data_extras["personalizations"][0][ - "custom_args" - ] = self.personalization_custom_args + self.expected_mail_data_extras["personalizations"][0]["custom_args"] = ( + self.personalization_custom_args + ) self.expected_mail_data_extras["categories"] = ["cat2", "cat1"] self.expected_mail_data_extras["from"] = { "name": "Foo", diff --git a/tests/serialization/test_dag_serialization.py b/tests/serialization/test_dag_serialization.py index a9fe733688313..7fbf6c31f3483 100644 --- a/tests/serialization/test_dag_serialization.py +++ b/tests/serialization/test_dag_serialization.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Unit tests for stringified DAGs.""" + from __future__ import annotations import copy diff --git a/tests/system/providers/airbyte/example_airbyte_trigger_job.py b/tests/system/providers/airbyte/example_airbyte_trigger_job.py index 84238f4ca1855..4ff2b5e0d48cd 100644 --- a/tests/system/providers/airbyte/example_airbyte_trigger_job.py +++ b/tests/system/providers/airbyte/example_airbyte_trigger_job.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the AirbyteTriggerSyncOperator.""" + from __future__ import annotations import os diff --git a/tests/system/providers/amazon/aws/example_google_api_sheets_to_s3.py b/tests/system/providers/amazon/aws/example_google_api_sheets_to_s3.py index 401fb86634865..b736308324f6e 100644 --- a/tests/system/providers/amazon/aws/example_google_api_sheets_to_s3.py +++ b/tests/system/providers/amazon/aws/example_google_api_sheets_to_s3.py @@ -18,6 +18,7 @@ This is a basic example dag for using `GoogleApiToS3Operator` to retrieve Google Sheets data You need to set all env variables to request the data. """ + from __future__ import annotations import os diff --git a/tests/system/providers/amazon/aws/example_google_api_youtube_to_s3.py b/tests/system/providers/amazon/aws/example_google_api_youtube_to_s3.py index cb2447cd7cdfd..f6195f78018da 100644 --- a/tests/system/providers/amazon/aws/example_google_api_youtube_to_s3.py +++ b/tests/system/providers/amazon/aws/example_google_api_youtube_to_s3.py @@ -45,6 +45,7 @@ This can be set via the environment variable AIRFLOW_CONN_GOOGLE_CLOUD_DEFAULT, or by creating a custom connection. """ + from __future__ import annotations import json diff --git a/tests/system/providers/amazon/aws/example_hive_to_dynamodb.py b/tests/system/providers/amazon/aws/example_hive_to_dynamodb.py index bdc5c26b646af..6b35b9dfca8e4 100644 --- a/tests/system/providers/amazon/aws/example_hive_to_dynamodb.py +++ b/tests/system/providers/amazon/aws/example_hive_to_dynamodb.py @@ -15,10 +15,11 @@ # specific language governing permissions and limitations # under the License. """ - This DAG will not work unless you create an Amazon EMR cluster running - Apache Hive and copy data into it following steps 1-4 (inclusive) here: - https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/EMRforDynamoDB.Tutorial.html +This DAG will not work unless you create an Amazon EMR cluster running +Apache Hive and copy data into it following steps 1-4 (inclusive) here: +https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/EMRforDynamoDB.Tutorial.html """ + from __future__ import annotations from datetime import datetime diff --git a/tests/system/providers/amazon/aws/example_imap_attachment_to_s3.py b/tests/system/providers/amazon/aws/example_imap_attachment_to_s3.py index 6453e3fdff554..7b7fc1bb387d2 100644 --- a/tests/system/providers/amazon/aws/example_imap_attachment_to_s3.py +++ b/tests/system/providers/amazon/aws/example_imap_attachment_to_s3.py @@ -18,6 +18,7 @@ This is an example dag for using `ImapAttachmentToS3Operator` to transfer an email attachment via IMAP protocol from a mail server to S3 Bucket. """ + from __future__ import annotations from datetime import datetime diff --git a/tests/system/providers/amazon/aws/example_salesforce_to_s3.py b/tests/system/providers/amazon/aws/example_salesforce_to_s3.py index 96c585661c5a7..112be85c5ad29 100644 --- a/tests/system/providers/amazon/aws/example_salesforce_to_s3.py +++ b/tests/system/providers/amazon/aws/example_salesforce_to_s3.py @@ -18,6 +18,7 @@ This is a basic example DAG for using `SalesforceToS3Operator` to retrieve Salesforce account data and upload it to an Amazon S3 bucket. """ + from __future__ import annotations from datetime import datetime diff --git a/tests/system/providers/apache/beam/example_beam.py b/tests/system/providers/apache/beam/example_beam.py index b89e7187b14b0..b0c62bbc00baa 100644 --- a/tests/system/providers/apache/beam/example_beam.py +++ b/tests/system/providers/apache/beam/example_beam.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Apache Beam operators """ + from __future__ import annotations from airflow import models diff --git a/tests/system/providers/apache/beam/example_beam_java_flink.py b/tests/system/providers/apache/beam/example_beam_java_flink.py index 70792624df6e1..42cfad2bdc8c6 100644 --- a/tests/system/providers/apache/beam/example_beam_java_flink.py +++ b/tests/system/providers/apache/beam/example_beam_java_flink.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Apache Beam operators """ + from __future__ import annotations from airflow import models diff --git a/tests/system/providers/apache/beam/example_beam_java_spark.py b/tests/system/providers/apache/beam/example_beam_java_spark.py index 715c22021b0c3..29259dd63a253 100644 --- a/tests/system/providers/apache/beam/example_beam_java_spark.py +++ b/tests/system/providers/apache/beam/example_beam_java_spark.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Apache Beam operators """ + from __future__ import annotations from airflow import models diff --git a/tests/system/providers/apache/beam/example_go.py b/tests/system/providers/apache/beam/example_go.py index 6c9a734c26c1f..f5fc70ff1e917 100644 --- a/tests/system/providers/apache/beam/example_go.py +++ b/tests/system/providers/apache/beam/example_go.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Apache Beam operators """ + from __future__ import annotations from airflow import models diff --git a/tests/system/providers/apache/beam/example_go_dataflow.py b/tests/system/providers/apache/beam/example_go_dataflow.py index 841bcb1c8956c..4cc81d9263042 100644 --- a/tests/system/providers/apache/beam/example_go_dataflow.py +++ b/tests/system/providers/apache/beam/example_go_dataflow.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Apache Beam operators """ + from __future__ import annotations from airflow import models diff --git a/tests/system/providers/apache/beam/example_java_dataflow.py b/tests/system/providers/apache/beam/example_java_dataflow.py index 1c6405b4c17b4..0a941eb32a5a3 100644 --- a/tests/system/providers/apache/beam/example_java_dataflow.py +++ b/tests/system/providers/apache/beam/example_java_dataflow.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Apache Beam operators """ + from __future__ import annotations from airflow import models diff --git a/tests/system/providers/apache/beam/example_python.py b/tests/system/providers/apache/beam/example_python.py index 59e3a09326205..12907df08f5ac 100644 --- a/tests/system/providers/apache/beam/example_python.py +++ b/tests/system/providers/apache/beam/example_python.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Apache Beam operators """ + from __future__ import annotations from airflow import models diff --git a/tests/system/providers/apache/beam/example_python_async.py b/tests/system/providers/apache/beam/example_python_async.py index 62e2afe91a293..ab2e9a8063ea4 100644 --- a/tests/system/providers/apache/beam/example_python_async.py +++ b/tests/system/providers/apache/beam/example_python_async.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Apache Beam operators """ + from __future__ import annotations from airflow import models diff --git a/tests/system/providers/apache/beam/example_python_dataflow.py b/tests/system/providers/apache/beam/example_python_dataflow.py index 931711595b87e..9b849e3900d9c 100644 --- a/tests/system/providers/apache/beam/example_python_dataflow.py +++ b/tests/system/providers/apache/beam/example_python_dataflow.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Apache Beam operators """ + from __future__ import annotations from airflow import models diff --git a/tests/system/providers/apache/beam/utils.py b/tests/system/providers/apache/beam/utils.py index d852c8fe8b357..e85e9790fc922 100644 --- a/tests/system/providers/apache/beam/utils.py +++ b/tests/system/providers/apache/beam/utils.py @@ -18,6 +18,7 @@ """ Example Utils for Apache Beam operator example DAG's """ + from __future__ import annotations import os diff --git a/tests/system/providers/apache/cassandra/example_cassandra_dag.py b/tests/system/providers/apache/cassandra/example_cassandra_dag.py index 1a305c5014715..79e9918b446bf 100644 --- a/tests/system/providers/apache/cassandra/example_cassandra_dag.py +++ b/tests/system/providers/apache/cassandra/example_cassandra_dag.py @@ -19,6 +19,7 @@ Example Airflow DAG to check if a Cassandra Table and a Records exists or not using `CassandraTableSensor` and `CassandraRecordSensor`. """ + from __future__ import annotations import os diff --git a/tests/system/providers/apache/drill/example_drill_dag.py b/tests/system/providers/apache/drill/example_drill_dag.py index e9c602c9e1bdb..3ca4a6111a6c6 100644 --- a/tests/system/providers/apache/drill/example_drill_dag.py +++ b/tests/system/providers/apache/drill/example_drill_dag.py @@ -18,6 +18,7 @@ """ Example Airflow DAG to execute SQL in an Apache Drill environment using the `DrillOperator`. """ + from __future__ import annotations import os diff --git a/tests/system/providers/apache/druid/example_druid_dag.py b/tests/system/providers/apache/druid/example_druid_dag.py index 1c22f87948e0c..1426a12456bae 100644 --- a/tests/system/providers/apache/druid/example_druid_dag.py +++ b/tests/system/providers/apache/druid/example_druid_dag.py @@ -18,6 +18,7 @@ """ Example Airflow DAG to submit Apache Druid json index file using `DruidOperator` """ + from __future__ import annotations import os diff --git a/tests/system/providers/apache/hive/example_twitter_dag.py b/tests/system/providers/apache/hive/example_twitter_dag.py index 8db8319e1cf84..53b824f50923e 100644 --- a/tests/system/providers/apache/hive/example_twitter_dag.py +++ b/tests/system/providers/apache/hive/example_twitter_dag.py @@ -18,6 +18,7 @@ """ This is an example dag for managing twitter data. """ + from __future__ import annotations import os diff --git a/tests/system/providers/apache/kylin/example_kylin_dag.py b/tests/system/providers/apache/kylin/example_kylin_dag.py index ad804900d38b0..c851ad7c5e3df 100644 --- a/tests/system/providers/apache/kylin/example_kylin_dag.py +++ b/tests/system/providers/apache/kylin/example_kylin_dag.py @@ -19,6 +19,7 @@ This is an example DAG which uses the KylinCubeOperator. The tasks below include kylin build, refresh, merge operation. """ + from __future__ import annotations import os diff --git a/tests/system/providers/apache/livy/example_livy.py b/tests/system/providers/apache/livy/example_livy.py index f8ff27f416edc..507bbaefede43 100644 --- a/tests/system/providers/apache/livy/example_livy.py +++ b/tests/system/providers/apache/livy/example_livy.py @@ -19,6 +19,7 @@ The tasks below trigger the computation of pi on the Spark instance using the Java and Python executables provided in the example library. """ + from __future__ import annotations import os diff --git a/tests/system/providers/apache/pig/example_pig.py b/tests/system/providers/apache/pig/example_pig.py index 18842eb0fa079..938987f32e78f 100644 --- a/tests/system/providers/apache/pig/example_pig.py +++ b/tests/system/providers/apache/pig/example_pig.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the PigOperator.""" + from __future__ import annotations import os diff --git a/tests/system/providers/apache/spark/example_spark_dag.py b/tests/system/providers/apache/spark/example_spark_dag.py index 3f9958058eabf..00bb415585c0b 100644 --- a/tests/system/providers/apache/spark/example_spark_dag.py +++ b/tests/system/providers/apache/spark/example_spark_dag.py @@ -19,6 +19,7 @@ Example Airflow DAG to submit Apache Spark applications using `SparkSubmitOperator`, `SparkJDBCOperator` and `SparkSqlOperator`. """ + from __future__ import annotations import os diff --git a/tests/system/providers/asana/example_asana.py b/tests/system/providers/asana/example_asana.py index 4a528ffcf2f82..79a3636a1cb77 100644 --- a/tests/system/providers/asana/example_asana.py +++ b/tests/system/providers/asana/example_asana.py @@ -17,6 +17,7 @@ """ Example DAG showing how to use Asana TaskOperators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/cncf/kubernetes/example_kubernetes.py b/tests/system/providers/cncf/kubernetes/example_kubernetes.py index ef7d6db19a5c1..57bab063a9e62 100644 --- a/tests/system/providers/cncf/kubernetes/example_kubernetes.py +++ b/tests/system/providers/cncf/kubernetes/example_kubernetes.py @@ -18,6 +18,7 @@ """ This is an example dag for using the KubernetesPodOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/cncf/kubernetes/example_kubernetes_job.py b/tests/system/providers/cncf/kubernetes/example_kubernetes_job.py index 8801f5ddaf6a6..f74f5e71ee7d4 100644 --- a/tests/system/providers/cncf/kubernetes/example_kubernetes_job.py +++ b/tests/system/providers/cncf/kubernetes/example_kubernetes_job.py @@ -18,6 +18,7 @@ """ This is an example dag for using the KubernetesJobOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/cncf/kubernetes/example_kubernetes_resource.py b/tests/system/providers/cncf/kubernetes/example_kubernetes_resource.py index 7be0a8099106b..2133d6e7a79af 100644 --- a/tests/system/providers/cncf/kubernetes/example_kubernetes_resource.py +++ b/tests/system/providers/cncf/kubernetes/example_kubernetes_resource.py @@ -21,6 +21,7 @@ The first task is to create a PVC on Kubernetes cluster. and the second task is to delete the PVC. """ + from __future__ import annotations import os diff --git a/tests/system/providers/cncf/kubernetes/example_spark_kubernetes.py b/tests/system/providers/cncf/kubernetes/example_spark_kubernetes.py index 00d2a2361f621..4584d653e4fa1 100644 --- a/tests/system/providers/cncf/kubernetes/example_spark_kubernetes.py +++ b/tests/system/providers/cncf/kubernetes/example_spark_kubernetes.py @@ -24,6 +24,7 @@ Spark-on-k8s operator is required to be already installed on Kubernetes https://github.com/GoogleCloudPlatform/spark-on-k8s-operator """ + from __future__ import annotations import os diff --git a/tests/system/providers/databricks/example_databricks.py b/tests/system/providers/databricks/example_databricks.py index 3a7ed3e53b2e0..d2fe87db301f9 100644 --- a/tests/system/providers/databricks/example_databricks.py +++ b/tests/system/providers/databricks/example_databricks.py @@ -30,6 +30,7 @@ For more information about the state of a run refer to https://docs.databricks.com/api/latest/jobs.html#runstate """ + from __future__ import annotations import os diff --git a/tests/system/providers/databricks/example_databricks_sql.py b/tests/system/providers/databricks/example_databricks_sql.py index 636a263ddcd9c..3f7ed0858c82e 100644 --- a/tests/system/providers/databricks/example_databricks_sql.py +++ b/tests/system/providers/databricks/example_databricks_sql.py @@ -25,6 +25,7 @@ final task using DatabricksCopyIntoOperator loads the data from the file_location passed into Delta table. """ + from __future__ import annotations import os diff --git a/tests/system/providers/dingding/example_dingding.py b/tests/system/providers/dingding/example_dingding.py index 9165f5e370c08..240a732805d3e 100644 --- a/tests/system/providers/dingding/example_dingding.py +++ b/tests/system/providers/dingding/example_dingding.py @@ -18,6 +18,7 @@ """ This is an example dag for using the DingdingOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/docker/example_docker_copy_data.py b/tests/system/providers/docker/example_docker_copy_data.py index 1154790bdcbc9..50373af792515 100644 --- a/tests/system/providers/docker/example_docker_copy_data.py +++ b/tests/system/providers/docker/example_docker_copy_data.py @@ -23,6 +23,7 @@ TODO: Review the workflow, change it accordingly to your environment & enable the code. """ + from __future__ import annotations import os diff --git a/tests/system/providers/elasticsearch/example_elasticsearch_query.py b/tests/system/providers/elasticsearch/example_elasticsearch_query.py index 595bdeb269dea..7947b39779848 100644 --- a/tests/system/providers/elasticsearch/example_elasticsearch_query.py +++ b/tests/system/providers/elasticsearch/example_elasticsearch_query.py @@ -17,6 +17,7 @@ """ Example Airflow DAG for Elasticsearch Query. """ + from __future__ import annotations import os diff --git a/tests/system/providers/ftp/example_ftp.py b/tests/system/providers/ftp/example_ftp.py index cfecccf61ca20..bdc9399e46887 100644 --- a/tests/system/providers/ftp/example_ftp.py +++ b/tests/system/providers/ftp/example_ftp.py @@ -17,6 +17,7 @@ """ This is an example dag for using the FTPFileTransmitOperator and FTPSFileTransmitOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/ads/example_ads.py b/tests/system/providers/google/ads/example_ads.py index 5dd336e7df449..90564ae0a02fc 100644 --- a/tests/system/providers/google/ads/example_ads.py +++ b/tests/system/providers/google/ads/example_ads.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that shows how to use GoogleAdsToGcsOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/automl/example_automl_dataset.py b/tests/system/providers/google/cloud/automl/example_automl_dataset.py index 1b0c687a2d56c..1c2691657e19b 100644 --- a/tests/system/providers/google/cloud/automl/example_automl_dataset.py +++ b/tests/system/providers/google/cloud/automl/example_automl_dataset.py @@ -19,6 +19,7 @@ """ Example Airflow DAG for Google AutoML service testing dataset operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/automl/example_automl_model.py b/tests/system/providers/google/cloud/automl/example_automl_model.py index fbcbcb1898cb2..59ec91c8790d5 100644 --- a/tests/system/providers/google/cloud/automl/example_automl_model.py +++ b/tests/system/providers/google/cloud/automl/example_automl_model.py @@ -19,6 +19,7 @@ """ Example Airflow DAG for Google AutoML service testing model operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/automl/example_automl_nl_text_classification.py b/tests/system/providers/google/cloud/automl/example_automl_nl_text_classification.py index 54b2fa1330096..9ef04db81882b 100644 --- a/tests/system/providers/google/cloud/automl/example_automl_nl_text_classification.py +++ b/tests/system/providers/google/cloud/automl/example_automl_nl_text_classification.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google AutoML services. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/automl/example_automl_nl_text_extraction.py b/tests/system/providers/google/cloud/automl/example_automl_nl_text_extraction.py index 47727cb80d688..8f8564f62c209 100644 --- a/tests/system/providers/google/cloud/automl/example_automl_nl_text_extraction.py +++ b/tests/system/providers/google/cloud/automl/example_automl_nl_text_extraction.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google AutoML services. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/automl/example_automl_nl_text_sentiment.py b/tests/system/providers/google/cloud/automl/example_automl_nl_text_sentiment.py index b593e6043bce6..94f349c6c3702 100644 --- a/tests/system/providers/google/cloud/automl/example_automl_nl_text_sentiment.py +++ b/tests/system/providers/google/cloud/automl/example_automl_nl_text_sentiment.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google AutoML services. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/automl/example_automl_translation.py b/tests/system/providers/google/cloud/automl/example_automl_translation.py index d3e55a64bd7e4..ba36f556c427d 100644 --- a/tests/system/providers/google/cloud/automl/example_automl_translation.py +++ b/tests/system/providers/google/cloud/automl/example_automl_translation.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google AutoML services. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/automl/example_automl_video_classification.py b/tests/system/providers/google/cloud/automl/example_automl_video_classification.py index efec1185a0d23..b16f475ea446b 100644 --- a/tests/system/providers/google/cloud/automl/example_automl_video_classification.py +++ b/tests/system/providers/google/cloud/automl/example_automl_video_classification.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google AutoML services. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/automl/example_automl_video_tracking.py b/tests/system/providers/google/cloud/automl/example_automl_video_tracking.py index 46b873ee119e9..3a9b5d90f8f60 100644 --- a/tests/system/providers/google/cloud/automl/example_automl_video_tracking.py +++ b/tests/system/providers/google/cloud/automl/example_automl_video_tracking.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google AutoML services. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/automl/example_automl_vision_classification.py b/tests/system/providers/google/cloud/automl/example_automl_vision_classification.py index e99fc5caf7717..d4740ac05ba92 100644 --- a/tests/system/providers/google/cloud/automl/example_automl_vision_classification.py +++ b/tests/system/providers/google/cloud/automl/example_automl_vision_classification.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google AutoML services. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/automl/example_automl_vision_object_detection.py b/tests/system/providers/google/cloud/automl/example_automl_vision_object_detection.py index 6f690a2311c0c..061b8efea6f60 100644 --- a/tests/system/providers/google/cloud/automl/example_automl_vision_object_detection.py +++ b/tests/system/providers/google/cloud/automl/example_automl_vision_object_detection.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google AutoML services. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_dataset.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_dataset.py index 2f3357cafaf64..03a157abb4798 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_dataset.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_dataset.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google BigQuery service testing dataset operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_dts.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_dts.py index 5f81429abbc93..34575f2025457 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_dts.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_dts.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that creates and deletes Bigquery data transfer configurations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_operations.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_operations.py index b4e6306170bb0..8c4e714625f29 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_operations.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_operations.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google BigQuery service local file upload and external table creation. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_operations_location.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_operations_location.py index 7c7b72643531f..a5f0c415b8426 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_operations_location.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_operations_location.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google BigQuery service testing data structures with location. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_queries.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_queries.py index 7898088046651..0d9d501be7a52 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_queries.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_queries.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google BigQuery service. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_queries_async.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_queries_async.py index 4ec675de38b98..e859d06d0fd7f 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_queries_async.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_queries_async.py @@ -18,6 +18,7 @@ Example Airflow DAG for Google BigQuery service. Uses Async version of the Big Query Operators """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_sensors.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_sensors.py index c04248c28d38a..a780615e36985 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_sensors.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_sensors.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google BigQuery Sensors. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_tables.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_tables.py index 83815c3fd2da5..52740c417b012 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_tables.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_tables.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google BigQuery service testing tables. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_bigquery.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_bigquery.py index 716c89cd51948..cc721f2da0866 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_bigquery.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_bigquery.py @@ -18,6 +18,7 @@ """ Airflow System Test DAG that verifies BigQueryToBigQueryOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_gcs.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_gcs.py index bc86701a4cf22..2620582722308 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_gcs.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_gcs.py @@ -18,6 +18,7 @@ """ Airflow System Test DAG that verifies BigQueryToGCSOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_gcs_async.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_gcs_async.py index e8a9f942d4df4..04384f238dd4f 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_gcs_async.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_gcs_async.py @@ -18,6 +18,7 @@ """ Airflow System Test DAG that verifies BigQueryToGCSOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_mssql.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_mssql.py index c02c7a36cbc19..822020df28b66 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_mssql.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_mssql.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google BigQuery service. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_mysql.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_mysql.py index c5e7fd2e218ae..1ab5ef6577214 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_mysql.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_mysql.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google BigQuery service. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_postgres.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_postgres.py index c0d365091a178..e78b0301e767c 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_to_postgres.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_to_postgres.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google BigQuery service. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigquery/example_bigquery_transfer.py b/tests/system/providers/google/cloud/bigquery/example_bigquery_transfer.py index acbc312189375..b42ddb62b1f21 100644 --- a/tests/system/providers/google/cloud/bigquery/example_bigquery_transfer.py +++ b/tests/system/providers/google/cloud/bigquery/example_bigquery_transfer.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google BigQuery service. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/bigtable/example_bigtable.py b/tests/system/providers/google/cloud/bigtable/example_bigtable.py index af06226637997..7faeabfbd749e 100644 --- a/tests/system/providers/google/cloud/bigtable/example_bigtable.py +++ b/tests/system/providers/google/cloud/bigtable/example_bigtable.py @@ -41,6 +41,7 @@ * CBT_TABLE_ID - desired ID of the Table * CBT_POKE_INTERVAL - number of seconds between every attempt of Sensor check """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/cloud_batch/example_cloud_batch.py b/tests/system/providers/google/cloud/cloud_batch/example_cloud_batch.py index 362b0cc1bab96..7598b1c4239fd 100644 --- a/tests/system/providers/google/cloud/cloud_batch/example_cloud_batch.py +++ b/tests/system/providers/google/cloud/cloud_batch/example_cloud_batch.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google Cloud Batch Operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/cloud_build/example_cloud_build.py b/tests/system/providers/google/cloud/cloud_build/example_cloud_build.py index ab57e23923e20..8a17de5ed6eda 100644 --- a/tests/system/providers/google/cloud/cloud_build/example_cloud_build.py +++ b/tests/system/providers/google/cloud/cloud_build/example_cloud_build.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that displays interactions with Google Cloud Build. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/cloud_build/example_cloud_build_trigger.py b/tests/system/providers/google/cloud/cloud_build/example_cloud_build_trigger.py index a6c5718f180a0..5c97503e74be9 100644 --- a/tests/system/providers/google/cloud/cloud_build/example_cloud_build_trigger.py +++ b/tests/system/providers/google/cloud/cloud_build/example_cloud_build_trigger.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that displays interactions with Google Cloud Build. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/cloud_memorystore/example_cloud_memorystore_memcached.py b/tests/system/providers/google/cloud/cloud_memorystore/example_cloud_memorystore_memcached.py index 7a6830e6dc121..78f8d49ae4296 100644 --- a/tests/system/providers/google/cloud/cloud_memorystore/example_cloud_memorystore_memcached.py +++ b/tests/system/providers/google/cloud/cloud_memorystore/example_cloud_memorystore_memcached.py @@ -23,6 +23,7 @@ * AIRFLOW__API__GOOGLE_KEY_PATH - Path to service account key file. Note, you can skip this variable if you run this DAG in a Composer environment. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/cloud_memorystore/example_cloud_memorystore_redis.py b/tests/system/providers/google/cloud/cloud_memorystore/example_cloud_memorystore_redis.py index 3b6c1f46415d7..734cf48d7bd63 100644 --- a/tests/system/providers/google/cloud/cloud_memorystore/example_cloud_memorystore_redis.py +++ b/tests/system/providers/google/cloud/cloud_memorystore/example_cloud_memorystore_redis.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Memorystore service. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/cloud_run/example_cloud_run.py b/tests/system/providers/google/cloud/cloud_run/example_cloud_run.py index 4230e69cf7e35..47d193efb12b5 100644 --- a/tests/system/providers/google/cloud/cloud_run/example_cloud_run.py +++ b/tests/system/providers/google/cloud/cloud_run/example_cloud_run.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google Cloud Run Operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql.py b/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql.py index b11208c022fdd..52ba7d40253eb 100644 --- a/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql.py +++ b/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql.py @@ -20,6 +20,7 @@ creates, patches and deletes a database inside the instance, in Google Cloud. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql_query_mysql.py b/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql_query_mysql.py index f66242dd2a326..f869ac6f379f3 100644 --- a/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql_query_mysql.py +++ b/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql_query_mysql.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that performs query in a Cloud SQL instance for MySQL. """ + from __future__ import annotations import logging diff --git a/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql_query_postgres.py b/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql_query_postgres.py index fae820ed590ab..e1f2d72e5890a 100644 --- a/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql_query_postgres.py +++ b/tests/system/providers/google/cloud/cloud_sql/example_cloud_sql_query_postgres.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that performs query in a Cloud SQL instance for Postgres. """ + from __future__ import annotations import logging diff --git a/tests/system/providers/google/cloud/compute/example_compute_igm.py b/tests/system/providers/google/cloud/compute/example_compute_igm.py index 68f4bd37f434c..262ee15f1e4f8 100644 --- a/tests/system/providers/google/cloud/compute/example_compute_igm.py +++ b/tests/system/providers/google/cloud/compute/example_compute_igm.py @@ -22,6 +22,7 @@ * updates existing template in Instance Group Manager """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataflow/example_dataflow_go.py b/tests/system/providers/google/cloud/dataflow/example_dataflow_go.py index 71985a2f835f7..55fdae3388810 100644 --- a/tests/system/providers/google/cloud/dataflow/example_dataflow_go.py +++ b/tests/system/providers/google/cloud/dataflow/example_dataflow_go.py @@ -21,6 +21,7 @@ Requirements: This test requires the gcloud and go commands to run. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataflow/example_dataflow_native_java.py b/tests/system/providers/google/cloud/dataflow/example_dataflow_native_java.py index 12047bae5b404..d4299c0d65ac2 100644 --- a/tests/system/providers/google/cloud/dataflow/example_dataflow_native_java.py +++ b/tests/system/providers/google/cloud/dataflow/example_dataflow_native_java.py @@ -31,6 +31,7 @@ Requirements: These operators require the gcloud command and Java's JRE to run. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataflow/example_dataflow_native_python.py b/tests/system/providers/google/cloud/dataflow/example_dataflow_native_python.py index 957fe9afbe85a..dc8449cb316eb 100644 --- a/tests/system/providers/google/cloud/dataflow/example_dataflow_native_python.py +++ b/tests/system/providers/google/cloud/dataflow/example_dataflow_native_python.py @@ -19,6 +19,7 @@ """ Example Airflow DAG for testing Google Dataflow Beam Pipeline Operator with Python. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataflow/example_dataflow_native_python_async.py b/tests/system/providers/google/cloud/dataflow/example_dataflow_native_python_async.py index 05695eab31c31..01a7bce74ccc7 100644 --- a/tests/system/providers/google/cloud/dataflow/example_dataflow_native_python_async.py +++ b/tests/system/providers/google/cloud/dataflow/example_dataflow_native_python_async.py @@ -19,6 +19,7 @@ """ Example Airflow DAG for testing Google Dataflow Beam Pipeline Operator with Asynchronous Python. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataflow/example_dataflow_sql.py b/tests/system/providers/google/cloud/dataflow/example_dataflow_sql.py index 86afc9fa38b7d..67384de61ed4e 100644 --- a/tests/system/providers/google/cloud/dataflow/example_dataflow_sql.py +++ b/tests/system/providers/google/cloud/dataflow/example_dataflow_sql.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Dataflow service """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataflow/example_dataflow_streaming_python.py b/tests/system/providers/google/cloud/dataflow/example_dataflow_streaming_python.py index 0489117e5d8ea..63e5c780e3ee6 100644 --- a/tests/system/providers/google/cloud/dataflow/example_dataflow_streaming_python.py +++ b/tests/system/providers/google/cloud/dataflow/example_dataflow_streaming_python.py @@ -19,6 +19,7 @@ """ Example Airflow DAG for testing Google Dataflow Beam Pipeline Operator with Python for Streaming job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataflow/example_dataflow_template.py b/tests/system/providers/google/cloud/dataflow/example_dataflow_template.py index 9182834fbb5c4..b6eec97a16e55 100644 --- a/tests/system/providers/google/cloud/dataflow/example_dataflow_template.py +++ b/tests/system/providers/google/cloud/dataflow/example_dataflow_template.py @@ -20,6 +20,7 @@ Example Airflow DAG for testing Google Dataflow :class:`~airflow.providers.google.cloud.operators.dataflow.DataflowTemplatedJobStartOperator` operator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataform/example_dataform.py b/tests/system/providers/google/cloud/dataform/example_dataform.py index 8cb017d978f3b..fb2f74ab2af43 100644 --- a/tests/system/providers/google/cloud/dataform/example_dataform.py +++ b/tests/system/providers/google/cloud/dataform/example_dataform.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Dataform service """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/datafusion/example_datafusion.py b/tests/system/providers/google/cloud/datafusion/example_datafusion.py index 506323dccb639..54721e90134e2 100644 --- a/tests/system/providers/google/cloud/datafusion/example_datafusion.py +++ b/tests/system/providers/google/cloud/datafusion/example_datafusion.py @@ -17,6 +17,7 @@ """ Example Airflow DAG that shows how to use DataFusion. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/datapipelines/example_datapipeline.py b/tests/system/providers/google/cloud/datapipelines/example_datapipeline.py index 519087734a646..2b84be9013359 100644 --- a/tests/system/providers/google/cloud/datapipelines/example_datapipeline.py +++ b/tests/system/providers/google/cloud/datapipelines/example_datapipeline.py @@ -19,6 +19,7 @@ """ Example Airflow DAG for testing Google DataPipelines Create Data Pipeline Operator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataplex/example_dataplex.py b/tests/system/providers/google/cloud/dataplex/example_dataplex.py index 9edf4e75f4ac8..0de2df886a0b0 100644 --- a/tests/system/providers/google/cloud/dataplex/example_dataplex.py +++ b/tests/system/providers/google/cloud/dataplex/example_dataplex.py @@ -17,6 +17,7 @@ """ Example Airflow DAG that shows how to use Dataplex. """ + from __future__ import annotations import datetime diff --git a/tests/system/providers/google/cloud/dataplex/example_dataplex_dp.py b/tests/system/providers/google/cloud/dataplex/example_dataplex_dp.py index aaf6669464fca..941839e3dc406 100644 --- a/tests/system/providers/google/cloud/dataplex/example_dataplex_dp.py +++ b/tests/system/providers/google/cloud/dataplex/example_dataplex_dp.py @@ -17,6 +17,7 @@ """ Example Airflow DAG that shows how to use Dataplex Scan Data. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataplex/example_dataplex_dq.py b/tests/system/providers/google/cloud/dataplex/example_dataplex_dq.py index b92a41128b564..c7340126f3f3c 100644 --- a/tests/system/providers/google/cloud/dataplex/example_dataplex_dq.py +++ b/tests/system/providers/google/cloud/dataplex/example_dataplex_dq.py @@ -17,6 +17,7 @@ """ Example Airflow DAG that shows how to use Dataplex Scan Data. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataprep/example_dataprep.py b/tests/system/providers/google/cloud/dataprep/example_dataprep.py index 1ac9d98082706..ca3037c866c81 100644 --- a/tests/system/providers/google/cloud/dataprep/example_dataprep.py +++ b/tests/system/providers/google/cloud/dataprep/example_dataprep.py @@ -23,6 +23,7 @@ For generating it please use instruction https://docs.trifacta.com/display/DP/Manage+API+Access+Tokens#:~:text=Enable%20individual%20access-,Generate%20New%20Token,-Via%20UI. """ + from __future__ import annotations import logging diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_batch.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_batch.py index 7d126fc28bdb8..9b300e4fcd9a4 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_batch.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_batch.py @@ -17,6 +17,7 @@ """ Example Airflow DAG for Dataproc batch operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_batch_deferrable.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_batch_deferrable.py index 4306219ee8fd9..540e1741d8e5d 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_batch_deferrable.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_batch_deferrable.py @@ -19,6 +19,7 @@ Example Airflow DAG for DataprocSubmitJobOperator with spark job in deferrable mode. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_batch_persistent.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_batch_persistent.py index 5c639e5ede0f3..1cf300afe7a20 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_batch_persistent.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_batch_persistent.py @@ -17,6 +17,7 @@ """ Example Airflow DAG for Dataproc batch operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_create_existing_stopped_cluster.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_create_existing_stopped_cluster.py index 6a77a146844c5..b5f377caf1be8 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_create_existing_stopped_cluster.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_create_existing_stopped_cluster.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocCreateClusterOperator in case of the cluster is already existing and stopped. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_deferrable.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_deferrable.py index a0c427b568757..2c68f122277dd 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_deferrable.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_deferrable.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocUpdateClusterOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_diagnose.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_diagnose.py index 5ed41d77dac5a..b1c1a44f90b0d 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_diagnose.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_diagnose.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocDiagnoseClusterOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_generator.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_generator.py index 8f4ddb6a10560..769af2d27ab56 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_generator.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_generator.py @@ -19,6 +19,7 @@ Example Airflow DAG testing Dataproc operators for managing a cluster and submitting jobs. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_start_stop.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_start_stop.py index 7dcb127cd62c2..cffd0c1c36091 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_start_stop.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_start_stop.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocStartClusterOperator and DataprocStopClusterOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_update.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_update.py index 643ac7bf82317..7ef850e789b3d 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_update.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_cluster_update.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocUpdateClusterOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_gke.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_gke.py index 564b33180a7fd..a9953621bdcb9 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_gke.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_gke.py @@ -25,6 +25,7 @@ Notice: optional kubernetes_namespace parameter in VIRTUAL_CLUSTER_CONFIG should be the same as GKE_NAMESPACE """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_hadoop.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_hadoop.py index 734dd5830b8da..8cc0413ec0dd7 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_hadoop.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_hadoop.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocSubmitJobOperator with hadoop job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_hive.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_hive.py index af3c54636b141..b2976d04d828a 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_hive.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_hive.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocSubmitJobOperator with hive job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_pig.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_pig.py index a7d27efdc8174..df8a3a49cddd7 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_pig.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_pig.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocSubmitJobOperator with pig job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_presto.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_presto.py index bd4503183053c..e34a17b72f665 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_presto.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_presto.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocSubmitJobOperator with presto job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_pyspark.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_pyspark.py index 93ee3e54ac93a..3b3ab05e9f5f9 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_pyspark.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_pyspark.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocSubmitJobOperator with pyspark job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_spark.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_spark.py index 3acda02d3cb09..3e9516a98f5aa 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_spark.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_spark.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocSubmitJobOperator with spark job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_async.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_async.py index 80ef2388f3a33..2e6148c53f84f 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_async.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_async.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocSubmitJobOperator with async spark job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_deferrable.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_deferrable.py index 336def4696b34..af737ec822b79 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_deferrable.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_deferrable.py @@ -19,6 +19,7 @@ Example Airflow DAG for DataprocSubmitJobOperator with spark job in deferrable mode. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_sql.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_sql.py index f50cc81b92dcb..b152251d6a14b 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_sql.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_sql.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocSubmitJobOperator with spark sql job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_sparkr.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_sparkr.py index 15c5aee0d3838..1317a6d390430 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_sparkr.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_sparkr.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocSubmitJobOperator with sparkr job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_trino.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_trino.py index 04032f351330b..4834f2c776049 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_trino.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_trino.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for DataprocSubmitJobOperator with trino job. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_workflow.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_workflow.py index 0736d16bdab82..26a05e13865b1 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_workflow.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_workflow.py @@ -17,6 +17,7 @@ """ Example Airflow DAG for Dataproc workflow operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc/example_dataproc_workflow_deferrable.py b/tests/system/providers/google/cloud/dataproc/example_dataproc_workflow_deferrable.py index 6500af4366b70..e67624cd0c880 100644 --- a/tests/system/providers/google/cloud/dataproc/example_dataproc_workflow_deferrable.py +++ b/tests/system/providers/google/cloud/dataproc/example_dataproc_workflow_deferrable.py @@ -17,6 +17,7 @@ """ Example Airflow DAG for Dataproc workflow operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore.py b/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore.py index 8b7208dd1e6c7..9c9d3b1d56e1b 100644 --- a/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore.py +++ b/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore.py @@ -19,6 +19,7 @@ Example Airflow DAG that show how to use various Dataproc Metastore operators to manage a service. """ + from __future__ import annotations import datetime diff --git a/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore_backup.py b/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore_backup.py index c2423feaae294..1dbfbf409040a 100644 --- a/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore_backup.py +++ b/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore_backup.py @@ -19,6 +19,7 @@ Airflow System Test DAG that verifies Dataproc Metastore operators for managing backups. """ + from __future__ import annotations import datetime diff --git a/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore_hive_partition_sensor.py b/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore_hive_partition_sensor.py index 24fec2c5eee01..4058a5544f467 100644 --- a/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore_hive_partition_sensor.py +++ b/tests/system/providers/google/cloud/dataproc_metastore/example_dataproc_metastore_hive_partition_sensor.py @@ -21,6 +21,7 @@ Note that Metastore service must be configured to use gRPC endpoints. """ + from __future__ import annotations import datetime diff --git a/tests/system/providers/google/cloud/datastore/example_datastore_commit.py b/tests/system/providers/google/cloud/datastore/example_datastore_commit.py index 6dba0709b1409..cedddb3c883a7 100644 --- a/tests/system/providers/google/cloud/datastore/example_datastore_commit.py +++ b/tests/system/providers/google/cloud/datastore/example_datastore_commit.py @@ -18,6 +18,7 @@ """ Airflow System Test DAG that verifies Datastore commit operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/datastore/example_datastore_query.py b/tests/system/providers/google/cloud/datastore/example_datastore_query.py index cc461da927e45..cd56b42284484 100644 --- a/tests/system/providers/google/cloud/datastore/example_datastore_query.py +++ b/tests/system/providers/google/cloud/datastore/example_datastore_query.py @@ -18,6 +18,7 @@ """ Airflow System Test DAG that verifies Datastore query operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/datastore/example_datastore_rollback.py b/tests/system/providers/google/cloud/datastore/example_datastore_rollback.py index 57d33879c7869..151e663225947 100644 --- a/tests/system/providers/google/cloud/datastore/example_datastore_rollback.py +++ b/tests/system/providers/google/cloud/datastore/example_datastore_rollback.py @@ -18,6 +18,7 @@ """ Airflow System Test DAG that verifies Datastore rollback operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_firestore.py b/tests/system/providers/google/cloud/gcs/example_firestore.py index b3eaac6c2392f..2f1952872a56a 100644 --- a/tests/system/providers/google/cloud/gcs/example_firestore.py +++ b/tests/system/providers/google/cloud/gcs/example_firestore.py @@ -22,6 +22,7 @@ and exports this database from Cloud Firestore to Cloud Storage. It then creates a table from the exported data in Bigquery and checks that the data is in it. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_gcs_acl.py b/tests/system/providers/google/cloud/gcs/example_gcs_acl.py index 057ab13c072f1..64f5a058201f0 100644 --- a/tests/system/providers/google/cloud/gcs/example_gcs_acl.py +++ b/tests/system/providers/google/cloud/gcs/example_gcs_acl.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Storage ACL (Access Control List) operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_gcs_copy_delete.py b/tests/system/providers/google/cloud/gcs/example_gcs_copy_delete.py index 88add5d281796..514fd80bb9bca 100644 --- a/tests/system/providers/google/cloud/gcs/example_gcs_copy_delete.py +++ b/tests/system/providers/google/cloud/gcs/example_gcs_copy_delete.py @@ -19,6 +19,7 @@ Example Airflow DAG for Google Cloud Storage operators for listing, copying and deleting bucket content. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_gcs_sensor.py b/tests/system/providers/google/cloud/gcs/example_gcs_sensor.py index a9c9b9cc8ed34..e7efb4a18e8b4 100644 --- a/tests/system/providers/google/cloud/gcs/example_gcs_sensor.py +++ b/tests/system/providers/google/cloud/gcs/example_gcs_sensor.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Storage sensors. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_gcs_to_bigquery.py b/tests/system/providers/google/cloud/gcs/example_gcs_to_bigquery.py index 732034f699766..f6a1ec982e915 100644 --- a/tests/system/providers/google/cloud/gcs/example_gcs_to_bigquery.py +++ b/tests/system/providers/google/cloud/gcs/example_gcs_to_bigquery.py @@ -18,6 +18,7 @@ """ Example DAG using GCSToBigQueryOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_gcs_to_bigquery_async.py b/tests/system/providers/google/cloud/gcs/example_gcs_to_bigquery_async.py index 92308f4a3987f..6773d68fba4ec 100644 --- a/tests/system/providers/google/cloud/gcs/example_gcs_to_bigquery_async.py +++ b/tests/system/providers/google/cloud/gcs/example_gcs_to_bigquery_async.py @@ -18,6 +18,7 @@ """ Example DAG using GCSToBigQueryOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_gcs_to_gcs.py b/tests/system/providers/google/cloud/gcs/example_gcs_to_gcs.py index 46077894031c6..6df909209578c 100644 --- a/tests/system/providers/google/cloud/gcs/example_gcs_to_gcs.py +++ b/tests/system/providers/google/cloud/gcs/example_gcs_to_gcs.py @@ -19,6 +19,7 @@ Example Airflow DAG for Google Cloud Storage GCSSynchronizeBucketsOperator and GCSToGCSOperator operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_gcs_to_gdrive.py b/tests/system/providers/google/cloud/gcs/example_gcs_to_gdrive.py index 94d9359f7af82..8e36a5f4e49f9 100644 --- a/tests/system/providers/google/cloud/gcs/example_gcs_to_gdrive.py +++ b/tests/system/providers/google/cloud/gcs/example_gcs_to_gdrive.py @@ -21,6 +21,7 @@ Using this operator requires the following additional scopes: https://www.googleapis.com/auth/drive """ + from __future__ import annotations import json diff --git a/tests/system/providers/google/cloud/gcs/example_gcs_transform.py b/tests/system/providers/google/cloud/gcs/example_gcs_transform.py index 740c63f0bcafc..ea1bd29854968 100644 --- a/tests/system/providers/google/cloud/gcs/example_gcs_transform.py +++ b/tests/system/providers/google/cloud/gcs/example_gcs_transform.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Storage GCSFileTransformOperator operator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_gcs_transform_timespan.py b/tests/system/providers/google/cloud/gcs/example_gcs_transform_timespan.py index e2bd48f211456..36c62075ff5f8 100644 --- a/tests/system/providers/google/cloud/gcs/example_gcs_transform_timespan.py +++ b/tests/system/providers/google/cloud/gcs/example_gcs_transform_timespan.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Storage GCSTimeSpanFileTransformOperator operator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_gcs_upload_download.py b/tests/system/providers/google/cloud/gcs/example_gcs_upload_download.py index 437cb4f87f619..a4b7b3ecc7e75 100644 --- a/tests/system/providers/google/cloud/gcs/example_gcs_upload_download.py +++ b/tests/system/providers/google/cloud/gcs/example_gcs_upload_download.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for testing interaction between Google Cloud Storage and local file system. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_mysql_to_gcs.py b/tests/system/providers/google/cloud/gcs/example_mysql_to_gcs.py index 94a77199cdb22..5b96b49c1d659 100644 --- a/tests/system/providers/google/cloud/gcs/example_mysql_to_gcs.py +++ b/tests/system/providers/google/cloud/gcs/example_mysql_to_gcs.py @@ -22,6 +22,7 @@ * AIRFLOW__API__GOOGLE_KEY_PATH - Path to service account key file. Note, you can skip this variable if you run this DAG in a Composer environment. """ + from __future__ import annotations import logging diff --git a/tests/system/providers/google/cloud/gcs/example_sftp_to_gcs.py b/tests/system/providers/google/cloud/gcs/example_sftp_to_gcs.py index 5b13ec79edd75..f249b48d40a7c 100644 --- a/tests/system/providers/google/cloud/gcs/example_sftp_to_gcs.py +++ b/tests/system/providers/google/cloud/gcs/example_sftp_to_gcs.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Storage to SFTP transfer operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/gcs/example_trino_to_gcs.py b/tests/system/providers/google/cloud/gcs/example_trino_to_gcs.py index d2b661a643971..acce24edbe7f7 100644 --- a/tests/system/providers/google/cloud/gcs/example_trino_to_gcs.py +++ b/tests/system/providers/google/cloud/gcs/example_trino_to_gcs.py @@ -18,6 +18,7 @@ """ Example DAG using TrinoToGCSOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine.py b/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine.py index 4f53fe5183a5c..de379be5b3c7f 100644 --- a/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine.py +++ b/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Kubernetes Engine. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_async.py b/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_async.py index 70c465a0c1992..a5f02a3d32a26 100644 --- a/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_async.py +++ b/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_async.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for asynchronous mode of Google Kubernetes Engine. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_job.py b/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_job.py index a118bda06ba60..1abf4d66611b9 100644 --- a/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_job.py +++ b/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_job.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Kubernetes Engine. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_kueue.py b/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_kueue.py index f5029472de54e..71a6b7b12dc91 100644 --- a/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_kueue.py +++ b/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_kueue.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Kubernetes Engine. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_resource.py b/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_resource.py index 9077a807531ac..2c19380d1f683 100644 --- a/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_resource.py +++ b/tests/system/providers/google/cloud/kubernetes_engine/example_kubernetes_engine_resource.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Kubernetes Engine. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/ml_engine/example_mlengine.py b/tests/system/providers/google/cloud/ml_engine/example_mlengine.py index 4ae63696f302b..6bed016d350d4 100644 --- a/tests/system/providers/google/cloud/ml_engine/example_mlengine.py +++ b/tests/system/providers/google/cloud/ml_engine/example_mlengine.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google ML Engine service. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/natural_language/example_natural_language.py b/tests/system/providers/google/cloud/natural_language/example_natural_language.py index ad8fb72014f10..ee527b80b2fdb 100644 --- a/tests/system/providers/google/cloud/natural_language/example_natural_language.py +++ b/tests/system/providers/google/cloud/natural_language/example_natural_language.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Natural Language service """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/pubsub/example_pubsub.py b/tests/system/providers/google/cloud/pubsub/example_pubsub.py index 3cb94f6d38489..45862238320b5 100644 --- a/tests/system/providers/google/cloud/pubsub/example_pubsub.py +++ b/tests/system/providers/google/cloud/pubsub/example_pubsub.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google PubSub services. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/pubsub/example_pubsub_deferrable.py b/tests/system/providers/google/cloud/pubsub/example_pubsub_deferrable.py index fb9dace2dba0f..e8e8d647a7bab 100644 --- a/tests/system/providers/google/cloud/pubsub/example_pubsub_deferrable.py +++ b/tests/system/providers/google/cloud/pubsub/example_pubsub_deferrable.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that uses Google PubSub services. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/spanner/example_spanner.py b/tests/system/providers/google/cloud/spanner/example_spanner.py index cb945b7d05b8f..bdd4d019a387d 100644 --- a/tests/system/providers/google/cloud/spanner/example_spanner.py +++ b/tests/system/providers/google/cloud/spanner/example_spanner.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that creates, updates, queries and deletes a Cloud Spanner instance. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/sql_to_sheets/example_sql_to_sheets.py b/tests/system/providers/google/cloud/sql_to_sheets/example_sql_to_sheets.py index f166dadfafd62..314f388c52606 100644 --- a/tests/system/providers/google/cloud/sql_to_sheets/example_sql_to_sheets.py +++ b/tests/system/providers/google/cloud/sql_to_sheets/example_sql_to_sheets.py @@ -58,6 +58,7 @@ DROP DATABASE test_db; ``` """ + from __future__ import annotations import json diff --git a/tests/system/providers/google/cloud/stackdriver/example_stackdriver.py b/tests/system/providers/google/cloud/stackdriver/example_stackdriver.py index d4c6fcfbf4107..b83f32bc62d44 100644 --- a/tests/system/providers/google/cloud/stackdriver/example_stackdriver.py +++ b/tests/system/providers/google/cloud/stackdriver/example_stackdriver.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Stackdriver service. """ + from __future__ import annotations import json diff --git a/tests/system/providers/google/cloud/storage_transfer/example_cloud_storage_transfer_service_aws.py b/tests/system/providers/google/cloud/storage_transfer/example_cloud_storage_transfer_service_aws.py index ba64050997414..1359dacccdeb6 100644 --- a/tests/system/providers/google/cloud/storage_transfer/example_cloud_storage_transfer_service_aws.py +++ b/tests/system/providers/google/cloud/storage_transfer/example_cloud_storage_transfer_service_aws.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that demonstrates interactions with Google Cloud Transfer. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/tasks/example_queue.py b/tests/system/providers/google/cloud/tasks/example_queue.py index 6030fc182ed04..a66b549898e05 100644 --- a/tests/system/providers/google/cloud/tasks/example_queue.py +++ b/tests/system/providers/google/cloud/tasks/example_queue.py @@ -22,6 +22,7 @@ Required setup: - GCP_APP_ENGINE_LOCATION: GCP Project's App Engine location `gcloud app describe | grep locationId`. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/tasks/example_tasks.py b/tests/system/providers/google/cloud/tasks/example_tasks.py index 24d3aff7f5cb2..d4d23f09f29d7 100644 --- a/tests/system/providers/google/cloud/tasks/example_tasks.py +++ b/tests/system/providers/google/cloud/tasks/example_tasks.py @@ -19,6 +19,7 @@ Example Airflow DAG that creates and deletes Queues and creates, gets, lists, runs and deletes Tasks in the Google Cloud Tasks service in the Google Cloud. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/transfers/example_gcs_to_sftp.py b/tests/system/providers/google/cloud/transfers/example_gcs_to_sftp.py index a1a58e0f3aa20..50c61384bcd58 100644 --- a/tests/system/providers/google/cloud/transfers/example_gcs_to_sftp.py +++ b/tests/system/providers/google/cloud/transfers/example_gcs_to_sftp.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Storage to SFTP transfer operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/transfers/example_gdrive_to_local.py b/tests/system/providers/google/cloud/transfers/example_gdrive_to_local.py index 12b491da5227d..7c14cace43345 100644 --- a/tests/system/providers/google/cloud/transfers/example_gdrive_to_local.py +++ b/tests/system/providers/google/cloud/transfers/example_gdrive_to_local.py @@ -21,6 +21,7 @@ Using this operator requires the following additional scopes: https://www.googleapis.com/auth/drive """ + from __future__ import annotations import logging diff --git a/tests/system/providers/google/cloud/transfers/example_postgres_to_gcs.py b/tests/system/providers/google/cloud/transfers/example_postgres_to_gcs.py index 33e70c51ff9e4..c3994f1462491 100644 --- a/tests/system/providers/google/cloud/transfers/example_postgres_to_gcs.py +++ b/tests/system/providers/google/cloud/transfers/example_postgres_to_gcs.py @@ -23,6 +23,7 @@ * AIRFLOW__API__GOOGLE_KEY_PATH - Path to service account key file. Note, you can skip this variable if you run this DAG in a Composer environment. """ + from __future__ import annotations import logging diff --git a/tests/system/providers/google/cloud/translate/example_translate.py b/tests/system/providers/google/cloud/translate/example_translate.py index 5a5ad1e943317..2949f54bf5823 100644 --- a/tests/system/providers/google/cloud/translate/example_translate.py +++ b/tests/system/providers/google/cloud/translate/example_translate.py @@ -19,6 +19,7 @@ Example Airflow DAG that translates text in Google Cloud Translate service in the Google Cloud. """ + from __future__ import annotations from datetime import datetime diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_forecasting_training.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_forecasting_training.py index de75840bf5a21..eb2fecedb4e4c 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_forecasting_training.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_forecasting_training.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Auto ML operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_image_training.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_image_training.py index e204cf8f06449..4de1f43dd8740 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_image_training.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_image_training.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Auto ML operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_list_training.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_list_training.py index f8cfc87324155..fcf67c5210fbc 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_list_training.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_list_training.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Auto ML operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_tabular_training.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_tabular_training.py index 2a967cba295b5..8c828bd4f21ad 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_tabular_training.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_tabular_training.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Auto ML operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_text_training.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_text_training.py index e5336b694315c..9a7e3e95ccdee 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_text_training.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_text_training.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Auto ML operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_video_training.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_video_training.py index 9ffe674045884..1cbf9a250b7b1 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_video_training.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_auto_ml_video_training.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Auto ML operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_batch_prediction_job.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_batch_prediction_job.py index d5dc423b32bd1..1b8c2e182ccdf 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_batch_prediction_job.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_batch_prediction_job.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Batch Prediction operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_container.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_container.py index 9e1459c07278c..72ae090e6e708 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_container.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_container.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Custom Jobs operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_job.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_job.py index 7d19a26604faa..fa876f7383688 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_job.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_job.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Custom Jobs operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_job_python_package.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_job_python_package.py index e11337711348e..867154a03d4c0 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_job_python_package.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_job_python_package.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Custom Jobs operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_dataset.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_dataset.py index 21b369f7c366f..e7f5d7d920acd 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_dataset.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_dataset.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Dataset operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_endpoint.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_endpoint.py index 1e2c348ee4799..297470be68db4 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_endpoint.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_endpoint.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Endpoint Service operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_generative_model.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_generative_model.py index 17000aef32956..101cedaf7e9e5 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_generative_model.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_generative_model.py @@ -19,6 +19,7 @@ """ Example Airflow DAG for Google Vertex AI Generative Model prompting. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_hyperparameter_tuning_job.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_hyperparameter_tuning_job.py index b4567590a17a0..d0cb1458430c3 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_hyperparameter_tuning_job.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_hyperparameter_tuning_job.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Hyperparameter Tuning Job operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_list_custom_jobs.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_list_custom_jobs.py index 7fab55ca0d5e9..f3f761586cc2f 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_list_custom_jobs.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_list_custom_jobs.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Custom Jobs operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_model_service.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_model_service.py index 5ddd6b6c295f0..003f7fe70d822 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_model_service.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_model_service.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Model Service operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_pipeline_job.py b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_pipeline_job.py index 2175d0b33e988..baf5b498b7cf4 100644 --- a/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_pipeline_job.py +++ b/tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_pipeline_job.py @@ -20,6 +20,7 @@ """ Example Airflow DAG for Google Vertex AI service testing Pipeline Job operations. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/leveldb/example_leveldb.py b/tests/system/providers/google/leveldb/example_leveldb.py index 31dd363f2c955..59fc0ed57e24e 100644 --- a/tests/system/providers/google/leveldb/example_leveldb.py +++ b/tests/system/providers/google/leveldb/example_leveldb.py @@ -18,6 +18,7 @@ """ Example use of LevelDB operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/marketing_platform/example_analytics.py b/tests/system/providers/google/marketing_platform/example_analytics.py index ce95f27297fe7..a3e27908aa75b 100644 --- a/tests/system/providers/google/marketing_platform/example_analytics.py +++ b/tests/system/providers/google/marketing_platform/example_analytics.py @@ -17,6 +17,7 @@ """ Example Airflow DAG that shows how to use Google Analytics 360. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/marketing_platform/example_analytics_admin.py b/tests/system/providers/google/marketing_platform/example_analytics_admin.py index 58c5b65795397..47c599aa8f011 100644 --- a/tests/system/providers/google/marketing_platform/example_analytics_admin.py +++ b/tests/system/providers/google/marketing_platform/example_analytics_admin.py @@ -32,6 +32,7 @@ 6. Associate the Google Ads account with a property, and save this property's id in the variable GA_GOOGLE_ADS_PROPERTY_ID. """ + from __future__ import annotations import json diff --git a/tests/system/providers/google/marketing_platform/example_campaign_manager.py b/tests/system/providers/google/marketing_platform/example_campaign_manager.py index 61e4253d75ac4..07d0e0d1f410a 100644 --- a/tests/system/providers/google/marketing_platform/example_campaign_manager.py +++ b/tests/system/providers/google/marketing_platform/example_campaign_manager.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that shows how to use CampaignManager. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/marketing_platform/example_search_ads.py b/tests/system/providers/google/marketing_platform/example_search_ads.py index 0f16e816c9cdc..d1e34c35ad9d8 100644 --- a/tests/system/providers/google/marketing_platform/example_search_ads.py +++ b/tests/system/providers/google/marketing_platform/example_search_ads.py @@ -18,6 +18,7 @@ """ Example Airflow DAG that shows how to use SearchAds. """ + from __future__ import annotations import os diff --git a/tests/system/providers/google/suite/example_local_to_drive.py b/tests/system/providers/google/suite/example_local_to_drive.py index 7a94fdfa6465c..819414741c2e6 100644 --- a/tests/system/providers/google/suite/example_local_to_drive.py +++ b/tests/system/providers/google/suite/example_local_to_drive.py @@ -21,6 +21,7 @@ Using this operator requires the following additional scopes: https://www.googleapis.com/auth/drive """ + from __future__ import annotations import json diff --git a/tests/system/providers/http/example_http.py b/tests/system/providers/http/example_http.py index 5c99c2bcba12f..13c908ef4a66d 100644 --- a/tests/system/providers/http/example_http.py +++ b/tests/system/providers/http/example_http.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example HTTP operator and sensor""" + from __future__ import annotations import json diff --git a/tests/system/providers/jdbc/example_jdbc_queries.py b/tests/system/providers/jdbc/example_jdbc_queries.py index c24c61acbfc6c..840bf4e0e183d 100644 --- a/tests/system/providers/jdbc/example_jdbc_queries.py +++ b/tests/system/providers/jdbc/example_jdbc_queries.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Example DAG demonstrating the usage of the JdbcOperator.""" + from __future__ import annotations import os diff --git a/tests/system/providers/microsoft/azure/example_azure_batch_operator.py b/tests/system/providers/microsoft/azure/example_azure_batch_operator.py index 435ef05060ab1..fa7dd4bc70368 100644 --- a/tests/system/providers/microsoft/azure/example_azure_batch_operator.py +++ b/tests/system/providers/microsoft/azure/example_azure_batch_operator.py @@ -22,6 +22,7 @@ * POOL_ID - The Pool ID in Batch accounts. """ + from __future__ import annotations import os diff --git a/tests/system/providers/microsoft/azure/example_azure_container_instances.py b/tests/system/providers/microsoft/azure/example_azure_container_instances.py index 9a7d8abac1cd4..0db79a71837b1 100644 --- a/tests/system/providers/microsoft/azure/example_azure_container_instances.py +++ b/tests/system/providers/microsoft/azure/example_azure_container_instances.py @@ -18,6 +18,7 @@ """ This is an example dag for using the AzureContainerInstancesOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/microsoft/azure/example_azure_cosmosdb.py b/tests/system/providers/microsoft/azure/example_azure_cosmosdb.py index b33186355457c..d496ff42d80e0 100644 --- a/tests/system/providers/microsoft/azure/example_azure_cosmosdb.py +++ b/tests/system/providers/microsoft/azure/example_azure_cosmosdb.py @@ -24,6 +24,7 @@ *Note: Make sure that connection `azure_cosmos_default` is properly set before running this example.* """ + from __future__ import annotations import os diff --git a/tests/system/providers/microsoft/azure/example_wasb_sensors.py b/tests/system/providers/microsoft/azure/example_wasb_sensors.py index a0961113f297d..a2f89fc2f881d 100644 --- a/tests/system/providers/microsoft/azure/example_wasb_sensors.py +++ b/tests/system/providers/microsoft/azure/example_wasb_sensors.py @@ -24,6 +24,7 @@ * BLOB_NAME - The name of the blob to match. * PREFIX - The blob with the specified prefix to match. """ + from __future__ import annotations import os diff --git a/tests/system/providers/microsoft/mssql/example_mssql.py b/tests/system/providers/microsoft/mssql/example_mssql.py index dd87b41e07a00..9154d3be36278 100644 --- a/tests/system/providers/microsoft/mssql/example_mssql.py +++ b/tests/system/providers/microsoft/mssql/example_mssql.py @@ -18,6 +18,7 @@ """ Example use of MsSql related operators. """ + from __future__ import annotations # [START mssql_operator_howto_guide] diff --git a/tests/system/providers/microsoft/winrm/example_winrm.py b/tests/system/providers/microsoft/winrm/example_winrm.py index 9e3276c579f2a..60a0149dc235a 100644 --- a/tests/system/providers/microsoft/winrm/example_winrm.py +++ b/tests/system/providers/microsoft/winrm/example_winrm.py @@ -18,6 +18,7 @@ """ This is an example dag for using the WinRMOperator. """ + from __future__ import annotations # -------------------------------------------------------------------------------- diff --git a/tests/system/providers/mysql/example_mysql.py b/tests/system/providers/mysql/example_mysql.py index 95845d922f414..7327d095f2907 100644 --- a/tests/system/providers/mysql/example_mysql.py +++ b/tests/system/providers/mysql/example_mysql.py @@ -18,6 +18,7 @@ """ Example use of MySql related operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/neo4j/example_neo4j.py b/tests/system/providers/neo4j/example_neo4j.py index b84c2d690d3f6..9422793405816 100644 --- a/tests/system/providers/neo4j/example_neo4j.py +++ b/tests/system/providers/neo4j/example_neo4j.py @@ -18,6 +18,7 @@ """ Example use of Neo4j related operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/papermill/conftest.py b/tests/system/providers/papermill/conftest.py index 98aa6ef8bbc2e..1ccc1510a489f 100644 --- a/tests/system/providers/papermill/conftest.py +++ b/tests/system/providers/papermill/conftest.py @@ -52,6 +52,6 @@ def remote_kernel(request): @pytest.fixture(scope="session", autouse=True) def airflow_conn(remote_kernel): - os.environ[ - "AIRFLOW_CONN_JUPYTER_KERNEL_DEFAULT" - ] = '{"host": "localhost", "extra": {"shell_port": 60316} }' + os.environ["AIRFLOW_CONN_JUPYTER_KERNEL_DEFAULT"] = ( + '{"host": "localhost", "extra": {"shell_port": 60316} }' + ) diff --git a/tests/system/providers/papermill/example_papermill.py b/tests/system/providers/papermill/example_papermill.py index 82d2e1b686a98..199fd6f64d289 100644 --- a/tests/system/providers/papermill/example_papermill.py +++ b/tests/system/providers/papermill/example_papermill.py @@ -20,6 +20,7 @@ it will create an output notebook "out-". All fields, including the keys in the parameters, are templated. """ + from __future__ import annotations import os diff --git a/tests/system/providers/papermill/example_papermill_remote_verify.py b/tests/system/providers/papermill/example_papermill_remote_verify.py index ba57e15454dd1..b4cf6249be241 100644 --- a/tests/system/providers/papermill/example_papermill_remote_verify.py +++ b/tests/system/providers/papermill/example_papermill_remote_verify.py @@ -20,6 +20,7 @@ it will create an output notebook "out-". All fields, including the keys in the parameters, are templated. """ + from __future__ import annotations import os diff --git a/tests/system/providers/papermill/example_papermill_verify.py b/tests/system/providers/papermill/example_papermill_verify.py index 64665e64a2e1e..af24dbdf8ff77 100644 --- a/tests/system/providers/papermill/example_papermill_verify.py +++ b/tests/system/providers/papermill/example_papermill_verify.py @@ -20,6 +20,7 @@ it will create an output notebook "out-". All fields, including the keys in the parameters, are templated. """ + from __future__ import annotations import os diff --git a/tests/system/providers/presto/example_gcs_to_presto.py b/tests/system/providers/presto/example_gcs_to_presto.py index f207f69871ce6..19b4a3a4fba5e 100644 --- a/tests/system/providers/presto/example_gcs_to_presto.py +++ b/tests/system/providers/presto/example_gcs_to_presto.py @@ -18,6 +18,7 @@ """ Example DAG using GCSToPrestoOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/redis/example_redis_publish.py b/tests/system/providers/redis/example_redis_publish.py index 4216b862d4a4a..5dbdb25abf277 100644 --- a/tests/system/providers/redis/example_redis_publish.py +++ b/tests/system/providers/redis/example_redis_publish.py @@ -24,6 +24,7 @@ redis using the RedisKeySensor. """ + from __future__ import annotations import os diff --git a/tests/system/providers/samba/example_gcs_to_samba.py b/tests/system/providers/samba/example_gcs_to_samba.py index 23df501f4ccd7..75037b7018abe 100644 --- a/tests/system/providers/samba/example_gcs_to_samba.py +++ b/tests/system/providers/samba/example_gcs_to_samba.py @@ -18,6 +18,7 @@ """ Example Airflow DAG for Google Cloud Storage to Samba transfer operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/slack/example_sql_to_slack.py b/tests/system/providers/slack/example_sql_to_slack.py index 288bac418b9a1..2e672df9aa686 100644 --- a/tests/system/providers/slack/example_sql_to_slack.py +++ b/tests/system/providers/slack/example_sql_to_slack.py @@ -18,6 +18,7 @@ """ Example DAG using SqlToSlackOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/slack/example_sql_to_slack_webhook.py b/tests/system/providers/slack/example_sql_to_slack_webhook.py index 7bcbb5a5af45d..97bb8ae46ed2d 100644 --- a/tests/system/providers/slack/example_sql_to_slack_webhook.py +++ b/tests/system/providers/slack/example_sql_to_slack_webhook.py @@ -18,6 +18,7 @@ """ Example DAG using SqlToSlackOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/snowflake/example_copy_into_snowflake.py b/tests/system/providers/snowflake/example_copy_into_snowflake.py index 1cc3902d1b0ee..e25112b95f3e4 100644 --- a/tests/system/providers/snowflake/example_copy_into_snowflake.py +++ b/tests/system/providers/snowflake/example_copy_into_snowflake.py @@ -18,6 +18,7 @@ """ Example use of Snowflake related operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/snowflake/example_snowflake.py b/tests/system/providers/snowflake/example_snowflake.py index 526eb662159b3..48e524e437877 100644 --- a/tests/system/providers/snowflake/example_snowflake.py +++ b/tests/system/providers/snowflake/example_snowflake.py @@ -18,6 +18,7 @@ """ Example use of Snowflake related operators. """ + from __future__ import annotations import os diff --git a/tests/system/providers/sqlite/example_sqlite.py b/tests/system/providers/sqlite/example_sqlite.py index 0fb11a5b15dc2..8722626822fe7 100644 --- a/tests/system/providers/sqlite/example_sqlite.py +++ b/tests/system/providers/sqlite/example_sqlite.py @@ -22,6 +22,7 @@ which when triggered, is performed on the connected sqlite database. The second task is similar but instead calls the SQL command from an external file. """ + from __future__ import annotations import os diff --git a/tests/system/providers/tableau/example_tableau.py b/tests/system/providers/tableau/example_tableau.py index 947e8d07b2bf9..c5f6995b62fe0 100644 --- a/tests/system/providers/tableau/example_tableau.py +++ b/tests/system/providers/tableau/example_tableau.py @@ -20,6 +20,7 @@ waits until it succeeds. The second does not wait since this is an asynchronous operation and we don't know when the operation actually finishes. That's why we have another task that checks only that. """ + from __future__ import annotations import os diff --git a/tests/system/providers/telegram/example_telegram.py b/tests/system/providers/telegram/example_telegram.py index f51f5fa7c0748..965a148284871 100644 --- a/tests/system/providers/telegram/example_telegram.py +++ b/tests/system/providers/telegram/example_telegram.py @@ -18,6 +18,7 @@ """ Example use of Telegram operator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/teradata/example_ssl_teradata.py b/tests/system/providers/teradata/example_ssl_teradata.py index f2a69fd5b13b2..600f1d6b89685 100644 --- a/tests/system/providers/teradata/example_ssl_teradata.py +++ b/tests/system/providers/teradata/example_ssl_teradata.py @@ -18,6 +18,7 @@ """ Example use of Teradata related operators. """ + from __future__ import annotations import datetime diff --git a/tests/system/providers/teradata/example_teradata.py b/tests/system/providers/teradata/example_teradata.py index d02458454f992..2e470a877a0da 100644 --- a/tests/system/providers/teradata/example_teradata.py +++ b/tests/system/providers/teradata/example_teradata.py @@ -18,6 +18,7 @@ """ Example use of Teradata related operators. """ + from __future__ import annotations import datetime diff --git a/tests/system/providers/teradata/example_teradata_to_teradata_transfer.py b/tests/system/providers/teradata/example_teradata_to_teradata_transfer.py index 8519691154cda..d4d4014ff4ff3 100644 --- a/tests/system/providers/teradata/example_teradata_to_teradata_transfer.py +++ b/tests/system/providers/teradata/example_teradata_to_teradata_transfer.py @@ -24,6 +24,7 @@ It creates sample my_users table at source and destination, sets up sample data at source and then runs transfer operator to copy data to corresponding table on destination server. """ + from __future__ import annotations import datetime diff --git a/tests/system/providers/trino/example_gcs_to_trino.py b/tests/system/providers/trino/example_gcs_to_trino.py index d4e475f7000f2..e970e4d146718 100644 --- a/tests/system/providers/trino/example_gcs_to_trino.py +++ b/tests/system/providers/trino/example_gcs_to_trino.py @@ -18,6 +18,7 @@ """ Example DAG using GCSToTrinoOperator. """ + from __future__ import annotations import os diff --git a/tests/system/providers/trino/example_trino.py b/tests/system/providers/trino/example_trino.py index d3c928af764e9..2174c0f47b437 100644 --- a/tests/system/providers/trino/example_trino.py +++ b/tests/system/providers/trino/example_trino.py @@ -18,6 +18,7 @@ """ Example DAG using TrinoOperator. """ + from __future__ import annotations from datetime import datetime diff --git a/tests/test_utils/get_all_tests.py b/tests/test_utils/get_all_tests.py index 10993ce000d27..5081243c9e93a 100644 --- a/tests/test_utils/get_all_tests.py +++ b/tests/test_utils/get_all_tests.py @@ -19,6 +19,7 @@ """ Gets all tests cases from xunit file. """ + from __future__ import annotations import sys diff --git a/tests/test_utils/remote_user_api_auth_backend.py b/tests/test_utils/remote_user_api_auth_backend.py index b86a404fd1529..b7714e5192e6a 100644 --- a/tests/test_utils/remote_user_api_auth_backend.py +++ b/tests/test_utils/remote_user_api_auth_backend.py @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. """Default authentication backend - everything is allowed""" + from __future__ import annotations import logging diff --git a/tests/utils/log/test_json_formatter.py b/tests/utils/log/test_json_formatter.py index 53bba7e64db51..b69ff9861a54c 100644 --- a/tests/utils/log/test_json_formatter.py +++ b/tests/utils/log/test_json_formatter.py @@ -18,6 +18,7 @@ """ Module for all tests airflow.utils.log.json_formatter.JSONFormatter """ + from __future__ import annotations import json diff --git a/tests/utils/test_orm_event_handlers.py b/tests/utils/test_orm_event_handlers.py index 816b41fca2228..7464c335aceb3 100644 --- a/tests/utils/test_orm_event_handlers.py +++ b/tests/utils/test_orm_event_handlers.py @@ -18,6 +18,7 @@ """These tests ensure compatibility with the deprecation of `sqlalchemy.orm.mapper()` in SQLAlchemy 2.0.0.b1. See also: https://docs.sqlalchemy.org/en/21/orm/mapping_styles.html#orm-imperative-mapping """ + from __future__ import annotations import warnings diff --git a/tests/utils/test_task_group.py b/tests/utils/test_task_group.py index ad5d355d87500..5bd7577a56c0a 100644 --- a/tests/utils/test_task_group.py +++ b/tests/utils/test_task_group.py @@ -1144,8 +1144,7 @@ def test_decorator_unknown_args(): with pytest.raises(TypeError): @task_group_decorator(b=2) - def tg(): - ... + def tg(): ... def test_decorator_multiple_use_task(): @@ -1539,12 +1538,10 @@ def test_task_group_arrow_with_setup_group(): with TaskGroup("group_1") as g1: @setup - def setup_1(): - ... + def setup_1(): ... @setup - def setup_2(): - ... + def setup_2(): ... s1 = setup_1() s2 = setup_2() @@ -1552,19 +1549,16 @@ def setup_2(): with TaskGroup("group_2") as g2: @teardown - def teardown_1(): - ... + def teardown_1(): ... @teardown - def teardown_2(): - ... + def teardown_2(): ... t1 = teardown_1() t2 = teardown_2() @task_decorator - def work(): - ... + def work(): ... w1 = work() g1 >> w1 >> g2 @@ -1602,16 +1596,13 @@ def test_task_group_arrow_with_setup_group_deeper_setup(): with TaskGroup("group_1") as g1: @setup - def setup_1(): - ... + def setup_1(): ... @setup - def setup_2(): - ... + def setup_2(): ... @teardown - def teardown_0(): - ... + def teardown_0(): ... s1 = setup_1() s2 = setup_2() @@ -1621,19 +1612,16 @@ def teardown_0(): with TaskGroup("group_2") as g2: @teardown - def teardown_1(): - ... + def teardown_1(): ... @teardown - def teardown_2(): - ... + def teardown_2(): ... t1 = teardown_1() t2 = teardown_2() @task_decorator - def work(): - ... + def work(): ... w1 = work() g1 >> w1 >> g2