diff --git a/.github/workflows/basic-tests.yml b/.github/workflows/basic-tests.yml index 9828a14993581c..db84bae38e2e2a 100644 --- a/.github/workflows/basic-tests.yml +++ b/.github/workflows/basic-tests.yml @@ -52,12 +52,6 @@ on: # yamllint disable-line rule:truthy description: "Whether to run only latest version checks (true/false)" required: true type: string - enable-aip-44: - description: "Whether to enable AIP-44 (true/false)" - required: true - type: string -env: - AIRFLOW_ENABLE_AIP_44: "${{ inputs.enable-aip-44 }}" jobs: run-breeze-tests: timeout-minutes: 10 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bff966cc670e8..adf8202633e455 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -173,7 +173,6 @@ jobs: skip-pre-commits: ${{needs.build-info.outputs.skip-pre-commits}} canary-run: ${{needs.build-info.outputs.canary-run}} latest-versions-only: ${{needs.build-info.outputs.latest-versions-only}} - enable-aip-44: "false" build-ci-images: name: > diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index 7828e50ed7e954..dda6b1c67710ab 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -99,8 +99,8 @@ on: # yamllint disable-line rule:truthy required: false default: "false" type: string - enable-aip-44: - description: "Whether to enable AIP-44 or not (true/false)" + database-isolation: + description: "Whether to enable database isolattion or not (true/false)" required: false default: "true" type: string @@ -129,8 +129,6 @@ jobs: backend-version: "${{fromJSON(inputs.backend-versions)}}" exclude: "${{fromJSON(inputs.excludes)}}" env: - # yamllint disable rule:line-length - AIRFLOW_ENABLE_AIP_44: "${{ inputs.enable-aip-44 }}" BACKEND: "${{ inputs.backend }}" BACKEND_VERSION: "${{ matrix.backend-version }}" DB_RESET: "true" diff --git a/.github/workflows/special-tests.yml b/.github/workflows/special-tests.yml index 000b5aa3d958b9..e6da4923d9d91a 100644 --- a/.github/workflows/special-tests.yml +++ b/.github/workflows/special-tests.yml @@ -171,8 +171,8 @@ jobs: run-coverage: ${{ inputs.run-coverage }} debug-resources: ${{ inputs.debug-resources }} - tests-in-progress-disabled: - name: "In progress disabled test" + tests-database-isolation: + name: "Database isolatoin test" uses: ./.github/workflows/run-unit-tests.yml permissions: contents: read @@ -180,9 +180,9 @@ jobs: secrets: inherit with: runs-on-as-json-default: ${{ inputs.runs-on-as-json-default }} - enable-aip-44: "false" - test-name: "InProgressDisabled-Postgres" - test-scope: "All" + database-isolation: "true" + test-name: "DatabaseIsolation-Postgres" + test-scope: "DB" backend: "postgres" image-tag: ${{ inputs.image-tag }} python-versions: "['${{ inputs.default-python-version }}']" diff --git a/airflow/api_internal/endpoints/rpc_api_endpoint.py b/airflow/api_internal/endpoints/rpc_api_endpoint.py index abf42b23f0c2d3..4d6fc150b085e1 100644 --- a/airflow/api_internal/endpoints/rpc_api_endpoint.py +++ b/airflow/api_internal/endpoints/rpc_api_endpoint.py @@ -131,7 +131,6 @@ def initialize_method_map() -> dict[str, Callable]: DagRun.get_previous_scheduled_dagrun, DagRun.fetch_task_instance, DagRun._get_log_template, - DagRun._get_task_instances, RenderedTaskInstanceFields._update_runtime_evaluated_template_fields, SerializedDagModel.get_serialized_dag, SerializedDagModel.remove_deleted_dags, diff --git a/airflow/api_internal/internal_api_call.py b/airflow/api_internal/internal_api_call.py index 7ad56c876f3601..3bc964e401f4e5 100644 --- a/airflow/api_internal/internal_api_call.py +++ b/airflow/api_internal/internal_api_call.py @@ -30,7 +30,7 @@ from airflow.configuration import conf from airflow.exceptions import AirflowConfigException, AirflowException -from airflow.settings import _ENABLE_AIP_44, force_traceback_session_for_untrusted_components +from airflow.settings import force_traceback_session_for_untrusted_components from airflow.typing_compat import ParamSpec from airflow.utils.jwt_signer import JWTSigner @@ -55,8 +55,6 @@ def set_use_database_access(component: str): This mode is needed for "trusted" components like Scheduler, Webserver, Internal Api server """ InternalApiConfig._use_internal_api = False - if not _ENABLE_AIP_44: - raise RuntimeError("The AIP_44 is not enabled so you cannot use it. ") logger.info( "DB isolation mode. But this is a trusted component and DB connection is set. " "Using database direct access when running %s.", @@ -65,8 +63,6 @@ def set_use_database_access(component: str): @staticmethod def set_use_internal_api(component: str, allow_tests_to_use_db: bool = False): - if not _ENABLE_AIP_44: - raise RuntimeError("The AIP_44 is not enabled so you cannot use it. ") internal_api_url = conf.get("core", "internal_api_url") url_conf = urlparse(internal_api_url) api_path = url_conf.path diff --git a/airflow/cli/cli_config.py b/airflow/cli/cli_config.py index abefb5cd631bb3..05507912fa0be3 100644 --- a/airflow/cli/cli_config.py +++ b/airflow/cli/cli_config.py @@ -31,7 +31,6 @@ from airflow import settings from airflow.cli.commands.legacy_commands import check_legacy_command from airflow.configuration import conf -from airflow.settings import _ENABLE_AIP_44 from airflow.utils.cli import ColorMode from airflow.utils.module_loading import import_string from airflow.utils.state import DagRunState, JobState @@ -2096,34 +2095,30 @@ class GroupCommand(NamedTuple): func=lazy_load_command("airflow.cli.commands.standalone_command.standalone"), args=(), ), -] - -if _ENABLE_AIP_44: - core_commands.append( - ActionCommand( - name="internal-api", - help="Start a Airflow Internal API instance", - func=lazy_load_command("airflow.cli.commands.internal_api_command.internal_api"), - args=( - ARG_INTERNAL_API_PORT, - ARG_INTERNAL_API_WORKERS, - ARG_INTERNAL_API_WORKERCLASS, - ARG_INTERNAL_API_WORKER_TIMEOUT, - ARG_INTERNAL_API_HOSTNAME, - ARG_PID, - ARG_DAEMON, - ARG_STDOUT, - ARG_STDERR, - ARG_INTERNAL_API_ACCESS_LOGFILE, - ARG_INTERNAL_API_ERROR_LOGFILE, - ARG_INTERNAL_API_ACCESS_LOGFORMAT, - ARG_LOG_FILE, - ARG_SSL_CERT, - ARG_SSL_KEY, - ARG_DEBUG, - ), + ActionCommand( + name="internal-api", + help="Start a Airflow Internal API instance", + func=lazy_load_command("airflow.cli.commands.internal_api_command.internal_api"), + args=( + ARG_INTERNAL_API_PORT, + ARG_INTERNAL_API_WORKERS, + ARG_INTERNAL_API_WORKERCLASS, + ARG_INTERNAL_API_WORKER_TIMEOUT, + ARG_INTERNAL_API_HOSTNAME, + ARG_PID, + ARG_DAEMON, + ARG_STDOUT, + ARG_STDERR, + ARG_INTERNAL_API_ACCESS_LOGFILE, + ARG_INTERNAL_API_ERROR_LOGFILE, + ARG_INTERNAL_API_ACCESS_LOGFORMAT, + ARG_LOG_FILE, + ARG_SSL_CERT, + ARG_SSL_KEY, + ARG_DEBUG, ), - ) + ), +] def _remove_dag_id_opt(command: ActionCommand): diff --git a/airflow/serialization/serialized_objects.py b/airflow/serialization/serialized_objects.py index 1513a50d385144..689e8bb6cafbd2 100644 --- a/airflow/serialization/serialized_objects.py +++ b/airflow/serialization/serialized_objects.py @@ -68,7 +68,7 @@ from airflow.serialization.pydantic.job import JobPydantic from airflow.serialization.pydantic.taskinstance import TaskInstancePydantic from airflow.serialization.pydantic.tasklog import LogTemplatePydantic -from airflow.settings import _ENABLE_AIP_44, DAGS_FOLDER, json +from airflow.settings import DAGS_FOLDER, json from airflow.task.priority_strategy import ( PriorityWeightStrategy, airflow_priority_weight_strategies, @@ -615,11 +615,6 @@ def serialize( :meta private: """ - if use_pydantic_models and not _ENABLE_AIP_44: - raise RuntimeError( - "Setting use_pydantic_models = True requires AIP-44 (in progress) feature flag to be true. " - "This parameter will be removed eventually when new serialization is used by AIP-44" - ) if cls._is_primitive(var): # enum.IntEnum is an int instance, it causes json dumps error so we use its value. if isinstance(var, enum.Enum): @@ -732,7 +727,7 @@ def serialize( obj = cls.serialize(v, strict=strict, use_pydantic_models=use_pydantic_models) d[str(k)] = obj return cls._encode(d, type_=DAT.TASK_CONTEXT) - elif use_pydantic_models and _ENABLE_AIP_44: + elif use_pydantic_models: def _pydantic_model_dump(model_cls: type[BaseModel], var: Any) -> dict[str, Any]: return model_cls.model_validate(var).model_dump(mode="json") # type: ignore[attr-defined] @@ -764,11 +759,6 @@ def deserialize(cls, encoded_var: Any, use_pydantic_models=False) -> Any: :meta private: """ # JSON primitives (except for dict) are not encoded. - if use_pydantic_models and not _ENABLE_AIP_44: - raise RuntimeError( - "Setting use_pydantic_models = True requires AIP-44 (in progress) feature flag to be true. " - "This parameter will be removed eventually when new serialization is used by AIP-44" - ) if cls._is_primitive(encoded_var): return encoded_var elif isinstance(encoded_var, list): @@ -849,7 +839,7 @@ def deserialize(cls, encoded_var: Any, use_pydantic_models=False) -> Any: return DagCallbackRequest.from_json(var) elif type_ == DAT.SLA_CALLBACK_REQUEST: return SlaCallbackRequest.from_json(var) - elif use_pydantic_models and _ENABLE_AIP_44: + elif use_pydantic_models: return _type_to_class[type_][0].model_validate(var) elif type_ == DAT.ARG_NOT_SET: return NOTSET diff --git a/airflow/settings.py b/airflow/settings.py index eb4053f50e194f..e15ac4f49a80f3 100644 --- a/airflow/settings.py +++ b/airflow/settings.py @@ -790,13 +790,3 @@ def is_usage_data_collection_enabled() -> bool: AIRFLOW_MOVED_TABLE_PREFIX = "_airflow_moved" DAEMON_UMASK: str = conf.get("core", "daemon_umask", fallback="0o077") - -# AIP-44: internal_api (experimental) -# This feature is not complete yet, so we disable it by default. -_ENABLE_AIP_44: bool = os.environ.get("AIRFLOW_ENABLE_AIP_44", "false").lower() in { - "true", - "t", - "yes", - "y", - "1", -} diff --git a/airflow/www/app.py b/airflow/www/app.py index e093e66cfd8819..c426182adabeee 100644 --- a/airflow/www/app.py +++ b/airflow/www/app.py @@ -33,7 +33,6 @@ from airflow.exceptions import AirflowConfigException, RemovedInAirflow3Warning from airflow.logging_config import configure_logging from airflow.models import import_all_models -from airflow.settings import _ENABLE_AIP_44 from airflow.utils.json import AirflowJsonProvider from airflow.www.extensions.init_appbuilder import init_appbuilder from airflow.www.extensions.init_appbuilder_links import init_appbuilder_links @@ -172,8 +171,6 @@ def create_app(config=None, testing=False): init_error_handlers(flask_app) init_api_connexion(flask_app) if conf.getboolean("webserver", "run_internal_api", fallback=False): - if not _ENABLE_AIP_44: - raise RuntimeError("The AIP_44 is not enabled so you cannot use it.") init_api_internal(flask_app) init_api_experimental(flask_app) init_api_auth_provider(flask_app) diff --git a/dev/breeze/src/airflow_breeze/commands/testing_commands.py b/dev/breeze/src/airflow_breeze/commands/testing_commands.py index 51ca4bea5d6368..539e47c3689f64 100644 --- a/dev/breeze/src/airflow_breeze/commands/testing_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/testing_commands.py @@ -196,6 +196,7 @@ def _run_test( skip_provider_tests=shell_params.skip_provider_tests, skip_db_tests=shell_params.skip_db_tests, run_db_tests_only=shell_params.run_db_tests_only, + run_database_isolation_tests_only=shell_params.database_isolation, backend=shell_params.backend, use_xdist=shell_params.use_xdist, enable_coverage=shell_params.enable_coverage, @@ -958,6 +959,7 @@ def helm_tests( skip_provider_tests=True, skip_db_tests=False, run_db_tests_only=False, + run_database_isolation_tests_only=False, backend="none", use_xdist=use_xdist, enable_coverage=False, diff --git a/dev/breeze/src/airflow_breeze/params/shell_params.py b/dev/breeze/src/airflow_breeze/params/shell_params.py index a0504ee7a3df3a..b9cc37a5f10ae6 100644 --- a/dev/breeze/src/airflow_breeze/params/shell_params.py +++ b/dev/breeze/src/airflow_breeze/params/shell_params.py @@ -481,7 +481,6 @@ def env_variables_for_docker_commands(self) -> dict[str, str]: _set_var(_env, "AIRFLOW_CONSTRAINTS_LOCATION", self.airflow_constraints_location) _set_var(_env, "AIRFLOW_CONSTRAINTS_MODE", self.airflow_constraints_mode) _set_var(_env, "AIRFLOW_CONSTRAINTS_REFERENCE", self.airflow_constraints_reference) - _set_var(_env, "AIRFLOW_ENABLE_AIP_44", None, "true") _set_var(_env, "AIRFLOW_ENV", "development") _set_var(_env, "AIRFLOW_EXTRAS", self.airflow_extras) _set_var(_env, "AIRFLOW_SKIP_CONSTRAINTS", self.airflow_skip_constraints) diff --git a/dev/breeze/src/airflow_breeze/utils/run_tests.py b/dev/breeze/src/airflow_breeze/utils/run_tests.py index fe099efbc024a5..a499bfbc0b1ac2 100644 --- a/dev/breeze/src/airflow_breeze/utils/run_tests.py +++ b/dev/breeze/src/airflow_breeze/utils/run_tests.py @@ -301,6 +301,7 @@ def generate_args_for_pytest( skip_provider_tests: bool, skip_db_tests: bool, run_db_tests_only: bool, + run_database_isolation_tests_only: bool, backend: str, use_xdist: bool, enable_coverage: bool, @@ -360,6 +361,8 @@ def generate_args_for_pytest( args.append("--skip-db-tests") if run_db_tests_only: args.append("--run-db-tests-only") + if run_database_isolation_tests_only: + args.append("--run-database-isolation-tests-only") if test_type != "System": args.append(f"--ignore={SYSTEM_TESTS}") if test_type != "Integration": diff --git a/scripts/ci/docker-compose/devcontainer.env b/scripts/ci/docker-compose/devcontainer.env index 2b7cddb47eb6a5..927369ccbb64d7 100644 --- a/scripts/ci/docker-compose/devcontainer.env +++ b/scripts/ci/docker-compose/devcontainer.env @@ -17,7 +17,6 @@ HOME= AIRFLOW_CI_IMAGE="ghcr.io/apache/airflow/main/ci/python3.8:latest" ANSWER= -AIRFLOW_ENABLE_AIP_44="true" AIRFLOW_ENV="development" PYTHON_MAJOR_MINOR_VERSION="3.8" AIRFLOW_EXTRAS= diff --git a/tests/api_internal/endpoints/test_rpc_api_endpoint.py b/tests/api_internal/endpoints/test_rpc_api_endpoint.py index 8a519db814c44b..19e67eda2a7fbc 100644 --- a/tests/api_internal/endpoints/test_rpc_api_endpoint.py +++ b/tests/api_internal/endpoints/test_rpc_api_endpoint.py @@ -30,7 +30,6 @@ from airflow.operators.empty import EmptyOperator from airflow.serialization.pydantic.taskinstance import TaskInstancePydantic from airflow.serialization.serialized_objects import BaseSerialization -from airflow.settings import _ENABLE_AIP_44 from airflow.utils.jwt_signer import JWTSigner from airflow.utils.state import State from airflow.www import app @@ -69,7 +68,6 @@ def equals(a, b) -> bool: return a == b -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") class TestRpcApiEndpoint: @pytest.fixture(autouse=True) def setup_attrs(self, minimal_app_for_internal_api: Flask) -> Generator: diff --git a/tests/api_internal/test_internal_api_call.py b/tests/api_internal/test_internal_api_call.py index d779b504ea479a..784c0b4d4c9c4a 100644 --- a/tests/api_internal/test_internal_api_call.py +++ b/tests/api_internal/test_internal_api_call.py @@ -32,7 +32,6 @@ from airflow.models.taskinstance import TaskInstance from airflow.operators.empty import EmptyOperator from airflow.serialization.serialized_objects import BaseSerialization -from airflow.settings import _ENABLE_AIP_44 from airflow.utils.state import State from tests.test_utils.config import conf_vars @@ -61,7 +60,6 @@ def reset_init_api_config(): settings.SQL_ALCHEMY_CONN = old_conn -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") class TestInternalApiConfig: @conf_vars( { @@ -97,7 +95,6 @@ def test_force_database_direct_access(self): assert InternalApiConfig.get_use_internal_api() is False -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") class TestInternalApiCall: @staticmethod @internal_api_call diff --git a/tests/cli/commands/test_internal_api_command.py b/tests/cli/commands/test_internal_api_command.py index 99992e62668618..e9cc3397556b99 100644 --- a/tests/cli/commands/test_internal_api_command.py +++ b/tests/cli/commands/test_internal_api_command.py @@ -30,7 +30,6 @@ from airflow.cli import cli_parser from airflow.cli.commands import internal_api_command from airflow.cli.commands.internal_api_command import GunicornMonitor -from airflow.settings import _ENABLE_AIP_44 from tests.cli.commands._common_cli_classes import _ComonCLIGunicornTestClass from tests.test_utils.config import conf_vars @@ -84,7 +83,6 @@ def test_ready_prefix_on_cmdline_dead_process(self): @pytest.mark.db_test -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") class TestCliInternalAPI(_ComonCLIGunicornTestClass): main_process_regexp = r"airflow internal-api" diff --git a/tests/conftest.py b/tests/conftest.py index 7acb731d0059e5..f41b46c70e621c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -117,7 +117,6 @@ os.environ["AIRFLOW__CORE__UNIT_TEST_MODE"] = "True" os.environ["AWS_DEFAULT_REGION"] = os.environ.get("AWS_DEFAULT_REGION") or "us-east-1" os.environ["CREDENTIALS_DIR"] = os.environ.get("CREDENTIALS_DIR") or "/files/airflow-breeze-config/keys" -os.environ["AIRFLOW_ENABLE_AIP_44"] = os.environ.get("AIRFLOW_ENABLE_AIP_44") or "true" if platform.system() == "Darwin": # mocks from unittest.mock work correctly in subprocesses only if they are created by "fork" method @@ -235,9 +234,9 @@ def set_db_isolation_mode(): InternalApiConfig.set_use_internal_api("tests", allow_tests_to_use_db=True) -def skip_if_database_isolation_mode(item): +def skip_if_database_isolation(item): if os.environ.get("RUN_TESTS_WITH_DATABASE_ISOLATION", "false").lower() == "true": - for _ in item.iter_markers(name="skip_if_database_isolation_mode"): + for _ in item.iter_markers(name="skip_if_database_isolation"): pytest.skip("This test is skipped because it is not allowed in database isolation mode.") @@ -464,7 +463,7 @@ def pytest_configure(config: pytest.Config) -> None: "external_python_operator: external python operator tests are 'long', we should run them separately", ) config.addinivalue_line("markers", "enable_redact: do not mock redact secret masker") - config.addinivalue_line("markers", "skip_if_database_isolation_mode: skip if DB isolation is enabled") + config.addinivalue_line("markers", "skip_if_database_isolation: skip if DB isolation is enabled") os.environ["_AIRFLOW__SKIP_DATABASE_EXECUTOR_COMPATIBILITY_CHECK"] = "1" @@ -704,7 +703,7 @@ def pytest_runtest_setup(item): skip_if_platform_doesnt_match(marker) for marker in item.iter_markers(name="backend"): skip_if_wrong_backend(marker, item) - skip_if_database_isolation_mode(item) + skip_if_database_isolation(item) selected_backend = item.config.option.backend if selected_backend: skip_if_not_marked_with_backend(selected_backend, item) diff --git a/tests/core/test_settings.py b/tests/core/test_settings.py index d05344bfa91d89..e4ff05492fdc89 100644 --- a/tests/core/test_settings.py +++ b/tests/core/test_settings.py @@ -31,7 +31,7 @@ from airflow.api_internal.internal_api_call import InternalApiConfig from airflow.configuration import conf from airflow.exceptions import AirflowClusterPolicyViolation, AirflowConfigException -from airflow.settings import _ENABLE_AIP_44, TracebackSession, is_usage_data_collection_enabled +from airflow.settings import TracebackSession, is_usage_data_collection_enabled from airflow.utils.session import create_session from tests.test_utils.config import conf_vars @@ -301,7 +301,6 @@ def test_encoding_absent_in_v2(is_v1, mock_conf): assert "encoding" not in engine_args -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") @conf_vars( { ("core", "database_access_isolation"): "true", @@ -326,7 +325,6 @@ def test_get_traceback_session_if_aip_44_enabled(clear_internal_api): session.execute() -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") @conf_vars( { ("core", "database_access_isolation"): "true", diff --git a/tests/dag_processing/test_processor.py b/tests/dag_processing/test_processor.py index 0893072d0b5e62..52c44e9b203f9c 100644 --- a/tests/dag_processing/test_processor.py +++ b/tests/dag_processing/test_processor.py @@ -113,7 +113,7 @@ def _process_file(self, file_path, dag_directory, session): dag_file_processor.process_file(file_path, [], False) - @pytest.mark.skip_if_database_isolation_mode + @pytest.mark.skip_if_database_isolation @mock.patch("airflow.dag_processing.processor.DagFileProcessor._get_dagbag") def test_dag_file_processor_sla_miss_callback(self, mock_get_dagbag, create_dummy_dag, get_test_dag): """ @@ -150,7 +150,7 @@ def test_dag_file_processor_sla_miss_callback(self, mock_get_dagbag, create_dumm assert sla_callback.called - @pytest.mark.skip_if_database_isolation_mode + @pytest.mark.skip_if_database_isolation @mock.patch("airflow.dag_processing.processor.DagFileProcessor._get_dagbag") def test_dag_file_processor_sla_miss_callback_invalid_sla(self, mock_get_dagbag, create_dummy_dag): """ @@ -183,7 +183,7 @@ def test_dag_file_processor_sla_miss_callback_invalid_sla(self, mock_get_dagbag, DagFileProcessor.manage_slas(dag_folder=dag.fileloc, dag_id="test_sla_miss", session=session) sla_callback.assert_not_called() - @pytest.mark.skip_if_database_isolation_mode + @pytest.mark.skip_if_database_isolation @mock.patch("airflow.dag_processing.processor.DagFileProcessor._get_dagbag") def test_dag_file_processor_sla_miss_callback_sent_notification(self, mock_get_dagbag, create_dummy_dag): """ @@ -229,7 +229,7 @@ def test_dag_file_processor_sla_miss_callback_sent_notification(self, mock_get_d sla_callback.assert_not_called() - @pytest.mark.skip_if_database_isolation_mode + @pytest.mark.skip_if_database_isolation @mock.patch("airflow.dag_processing.processor.Stats.incr") @mock.patch("airflow.dag_processing.processor.DagFileProcessor._get_dagbag") def test_dag_file_processor_sla_miss_doesnot_raise_integrity_error( @@ -277,7 +277,7 @@ def test_dag_file_processor_sla_miss_doesnot_raise_integrity_error( # ti is successful thereby trying to insert a duplicate record. DagFileProcessor.manage_slas(dag_folder=dag.fileloc, dag_id="test_sla_miss", session=session) - @pytest.mark.skip_if_database_isolation_mode + @pytest.mark.skip_if_database_isolation @mock.patch("airflow.dag_processing.processor.Stats.incr") @mock.patch("airflow.dag_processing.processor.DagFileProcessor._get_dagbag") def test_dag_file_processor_sla_miss_continue_checking_the_task_instances_after_recording_missing_sla( @@ -324,7 +324,7 @@ def test_dag_file_processor_sla_miss_continue_checking_the_task_instances_after_ assert sla_miss_count == 2 mock_stats_incr.assert_called_with("sla_missed", tags={"dag_id": "test_sla_miss", "task_id": "dummy"}) - @pytest.mark.skip_if_database_isolation_mode + @pytest.mark.skip_if_database_isolation @patch.object(DagFileProcessor, "logger") @mock.patch("airflow.dag_processing.processor.Stats.incr") @mock.patch("airflow.dag_processing.processor.DagFileProcessor._get_dagbag") @@ -383,7 +383,7 @@ def test_dag_file_processor_sla_miss_callback_exception( tags={"dag_id": f"test_sla_miss_{i}", "func_name": sla_callback.__name__}, ) - @pytest.mark.skip_if_database_isolation_mode + @pytest.mark.skip_if_database_isolation @mock.patch("airflow.dag_processing.processor.send_email") @mock.patch("airflow.dag_processing.processor.DagFileProcessor._get_dagbag") def test_dag_file_processor_only_collect_emails_from_sla_missed_tasks( @@ -419,7 +419,7 @@ def test_dag_file_processor_only_collect_emails_from_sla_missed_tasks( assert email1 in send_email_to assert email2 not in send_email_to - @pytest.mark.skip_if_database_isolation_mode + @pytest.mark.skip_if_database_isolation @patch.object(DagFileProcessor, "logger") @mock.patch("airflow.dag_processing.processor.Stats.incr") @mock.patch("airflow.utils.email.send_email") @@ -471,7 +471,7 @@ def test_dag_file_processor_sla_miss_email_exception( ) mock_stats_incr.assert_called_once_with("sla_email_notification_failure", tags={"dag_id": dag_id}) - @pytest.mark.skip_if_database_isolation_mode + @pytest.mark.skip_if_database_isolation @mock.patch("airflow.dag_processing.processor.DagFileProcessor._get_dagbag") def test_dag_file_processor_sla_miss_deleted_task(self, mock_get_dagbag, create_dummy_dag): """ diff --git a/tests/serialization/test_pydantic_models.py b/tests/serialization/test_pydantic_models.py index c9d8b486616218..49a550cedfce15 100644 --- a/tests/serialization/test_pydantic_models.py +++ b/tests/serialization/test_pydantic_models.py @@ -40,7 +40,6 @@ from airflow.serialization.pydantic.job import JobPydantic from airflow.serialization.pydantic.taskinstance import TaskInstancePydantic from airflow.serialization.serialized_objects import BaseSerialization -from airflow.settings import _ENABLE_AIP_44 from airflow.utils import timezone from airflow.utils.state import State from airflow.utils.types import AttributeRemoved, DagRunType @@ -51,7 +50,6 @@ pytest.importorskip("pydantic", minversion="2.0.0") -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") def test_serializing_pydantic_task_instance(session, create_task_instance): dag_id = "test-dag" ti = create_task_instance(dag_id=dag_id, session=session) @@ -72,7 +70,6 @@ def test_serializing_pydantic_task_instance(session, create_task_instance): assert deserialized_model.next_kwargs == {"foo": "bar"} -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") def test_deserialize_ti_mapped_op_reserialized_with_refresh_from_task(session, dag_maker): op_class_dict_expected = { "_needs_expansion": True, @@ -148,7 +145,6 @@ def target(val=None): assert desered.task.downstream_task_ids == set() -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") def test_serializing_pydantic_dagrun(session, create_task_instance): dag_id = "test-dag" ti = create_task_instance(dag_id=dag_id, session=session) @@ -211,7 +207,6 @@ def test_serializing_pydantic_local_task_job(session, create_task_instance): assert deserialized_model.state == State.RUNNING -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") def test_serializing_pydantic_dataset_event(session, create_task_instance, create_dummy_dag): ds1 = DatasetModel(id=1, uri="one", extra={"foo": "bar"}) ds2 = DatasetModel(id=2, uri="two") diff --git a/tests/serialization/test_serialized_objects.py b/tests/serialization/test_serialized_objects.py index 52275ed88894be..3166165543fe42 100644 --- a/tests/serialization/test_serialized_objects.py +++ b/tests/serialization/test_serialized_objects.py @@ -51,7 +51,6 @@ from airflow.serialization.pydantic.taskinstance import TaskInstancePydantic from airflow.serialization.pydantic.tasklog import LogTemplatePydantic from airflow.serialization.serialized_objects import BaseSerialization -from airflow.settings import _ENABLE_AIP_44 from airflow.triggers.base import BaseTrigger from airflow.utils import timezone from airflow.utils.context import OutletEventAccessor, OutletEventAccessors @@ -313,7 +312,6 @@ def test_backcompat_deserialize_connection(conn_uri): } -@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled") @pytest.mark.parametrize( "input, pydantic_class, encoded_type, cmp_func", [ @@ -396,8 +394,6 @@ def test_serialize_deserialize_pydantic(input, pydantic_class, encoded_type, cmp def test_all_pydantic_models_round_trip(): pytest.importorskip("pydantic", minversion="2.0.0") - if not _ENABLE_AIP_44: - pytest.skip("AIP-44 is disabled") classes = set() mods_folder = REPO_ROOT / "airflow/serialization/pydantic" for p in mods_folder.iterdir():