This is an automated email from the ASF dual-hosted git repository.

ash pushed a commit to branch task-sdk-first-code
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 8d30d0d80fdaf4411e2b06efb30266695b71ae94
Author: Ash Berlin-Taylor <[email protected]>
AuthorDate: Tue Oct 29 12:13:13 2024 +0000

    fix some tests [skip ci]
---
 airflow/api_connexion/schemas/dag_schema.py        |  1 -
 .../api_fastapi/core_api/openapi/v1-generated.yaml |  4 ---
 airflow/api_fastapi/core_api/serializers/dags.py   |  1 -
 airflow/cli/commands/dag_command.py                |  1 -
 airflow/models/dag.py                              |  2 +-
 airflow/ui/openapi-gen/requests/schemas.gen.ts     |  5 ----
 airflow/ui/openapi-gen/requests/types.gen.ts       |  1 -
 tests/api_connexion/endpoints/test_dag_endpoint.py | 32 ----------------------
 tests/api_connexion/schemas/test_dag_schema.py     |  5 ----
 .../core_api/routes/public/test_dags.py            |  1 -
 tests/serialization/test_pydantic_models.py        |  5 ++--
 11 files changed, 4 insertions(+), 54 deletions(-)

diff --git a/airflow/api_connexion/schemas/dag_schema.py 
b/airflow/api_connexion/schemas/dag_schema.py
index 4fb1dd6ae4b..f22812abd11 100644
--- a/airflow/api_connexion/schemas/dag_schema.py
+++ b/airflow/api_connexion/schemas/dag_schema.py
@@ -56,7 +56,6 @@ class DAGSchema(SQLAlchemySchema):
     last_parsed_time = auto_field(dump_only=True)
     last_pickled = auto_field(dump_only=True)
     last_expired = auto_field(dump_only=True)
-    pickle_id = auto_field(dump_only=True)
     default_view = auto_field(dump_only=True)
     fileloc = auto_field(dump_only=True)
     file_token = fields.Method("get_token", dump_only=True)
diff --git a/airflow/api_fastapi/core_api/openapi/v1-generated.yaml 
b/airflow/api_fastapi/core_api/openapi/v1-generated.yaml
index ae5fc9e1177..96353f083f1 100644
--- a/airflow/api_fastapi/core_api/openapi/v1-generated.yaml
+++ b/airflow/api_fastapi/core_api/openapi/v1-generated.yaml
@@ -1913,9 +1913,6 @@ components:
           - type: boolean
           - type: 'null'
           title: Is Paused Upon Creation
-        orientation:
-          type: string
-          title: Orientation
         params:
           anyOf:
           - type: object
@@ -1985,7 +1982,6 @@ components:
       - start_date
       - end_date
       - is_paused_upon_creation
-      - orientation
       - params
       - render_template_as_native_obj
       - template_search_path
diff --git a/airflow/api_fastapi/core_api/serializers/dags.py 
b/airflow/api_fastapi/core_api/serializers/dags.py
index c6294324c7e..6e2c3933e17 100644
--- a/airflow/api_fastapi/core_api/serializers/dags.py
+++ b/airflow/api_fastapi/core_api/serializers/dags.py
@@ -116,7 +116,6 @@ class DAGDetailsResponse(DAGResponse):
     start_date: datetime | None
     end_date: datetime | None
     is_paused_upon_creation: bool | None
-    orientation: str
     params: abc.MutableMapping | None
     render_template_as_native_obj: bool
     template_search_path: Iterable[str] | None
diff --git a/airflow/cli/commands/dag_command.py 
b/airflow/cli/commands/dag_command.py
index 89c5fd477f0..92d1825dc62 100644
--- a/airflow/cli/commands/dag_command.py
+++ b/airflow/cli/commands/dag_command.py
@@ -227,7 +227,6 @@ def _get_dagbag_dag_details(dag: DAG) -> dict:
         "last_parsed_time": None,
         "last_pickled": None,
         "last_expired": None,
-        "pickle_id": dag.pickle_id,
         "default_view": dag.default_view,
         "fileloc": dag.fileloc,
         "file_token": None,
diff --git a/airflow/models/dag.py b/airflow/models/dag.py
index b9620e52202..851d2a51293 100644
--- a/airflow/models/dag.py
+++ b/airflow/models/dag.py
@@ -314,7 +314,7 @@ def _convert_max_consecutive_failed_dag_runs(val: int) -> 
int:
 
 
 @functools.total_ordering
[email protected](hash=False, repr=False, eq=False)
[email protected](hash=False, repr=False, eq=False, slots=False)
 class DAG(TaskSDKDag, LoggingMixin):
     """
     A dag (directed acyclic graph) is a collection of tasks with directional 
dependencies.
diff --git a/airflow/ui/openapi-gen/requests/schemas.gen.ts 
b/airflow/ui/openapi-gen/requests/schemas.gen.ts
index 3982407c5f1..4716167708a 100644
--- a/airflow/ui/openapi-gen/requests/schemas.gen.ts
+++ b/airflow/ui/openapi-gen/requests/schemas.gen.ts
@@ -517,10 +517,6 @@ export const $DAGDetailsResponse = {
       ],
       title: "Is Paused Upon Creation",
     },
-    orientation: {
-      type: "string",
-      title: "Orientation",
-    },
     params: {
       anyOf: [
         {
@@ -619,7 +615,6 @@ export const $DAGDetailsResponse = {
     "start_date",
     "end_date",
     "is_paused_upon_creation",
-    "orientation",
     "params",
     "render_template_as_native_obj",
     "template_search_path",
diff --git a/airflow/ui/openapi-gen/requests/types.gen.ts 
b/airflow/ui/openapi-gen/requests/types.gen.ts
index a3b1d8e6bef..002e7ae9cac 100644
--- a/airflow/ui/openapi-gen/requests/types.gen.ts
+++ b/airflow/ui/openapi-gen/requests/types.gen.ts
@@ -95,7 +95,6 @@ export type DAGDetailsResponse = {
   start_date: string | null;
   end_date: string | null;
   is_paused_upon_creation: boolean | null;
-  orientation: string;
   params: {
     [key: string]: unknown;
   } | null;
diff --git a/tests/api_connexion/endpoints/test_dag_endpoint.py 
b/tests/api_connexion/endpoints/test_dag_endpoint.py
index ecb0052a8a0..5249944ea11 100644
--- a/tests/api_connexion/endpoints/test_dag_endpoint.py
+++ b/tests/api_connexion/endpoints/test_dag_endpoint.py
@@ -190,7 +190,6 @@ class TestGetDag(TestDagEndpoint):
             "last_parsed_time": None,
             "timetable_description": None,
             "has_import_errors": False,
-            "pickle_id": None,
         } == response.json
 
     @conf_vars({("webserver", "secret_key"): "mysecret"})
@@ -230,7 +229,6 @@ class TestGetDag(TestDagEndpoint):
             "last_parsed_time": None,
             "timetable_description": None,
             "has_import_errors": False,
-            "pickle_id": None,
         } == response.json
 
     def test_should_respond_404(self):
@@ -331,7 +329,6 @@ class TestGetDagDetails(TestDagEndpoint):
                     "value": 1,
                 }
             },
-            "pickle_id": None,
             "render_template_as_native_obj": False,
             "timetable_summary": "2 2 * * *",
             "start_date": "2020-06-15T00:00:00+00:00",
@@ -393,7 +390,6 @@ class TestGetDagDetails(TestDagEndpoint):
                     "value": 1,
                 }
             },
-            "pickle_id": None,
             "render_template_as_native_obj": False,
             "timetable_summary": "2 2 * * *",
             "start_date": "2020-06-15T00:00:00+00:00",
@@ -443,7 +439,6 @@ class TestGetDagDetails(TestDagEndpoint):
             "orientation": "LR",
             "owners": [],
             "params": {},
-            "pickle_id": None,
             "render_template_as_native_obj": False,
             "timetable_summary": "2 2 * * *",
             "start_date": "2020-06-15T00:00:00+00:00",
@@ -493,7 +488,6 @@ class TestGetDagDetails(TestDagEndpoint):
             "orientation": "LR",
             "owners": [],
             "params": {},
-            "pickle_id": None,
             "render_template_as_native_obj": False,
             "timetable_summary": "2 2 * * *",
             "start_date": None,
@@ -552,7 +546,6 @@ class TestGetDagDetails(TestDagEndpoint):
                     "value": 1,
                 }
             },
-            "pickle_id": None,
             "render_template_as_native_obj": False,
             "timetable_summary": "2 2 * * *",
             "start_date": "2020-06-15T00:00:00+00:00",
@@ -612,7 +605,6 @@ class TestGetDagDetails(TestDagEndpoint):
                     "value": 1,
                 }
             },
-            "pickle_id": None,
             "render_template_as_native_obj": False,
             "timetable_summary": "2 2 * * *",
             "start_date": "2020-06-15T00:00:00+00:00",
@@ -712,7 +704,6 @@ class TestGetDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
                 {
                     "dag_id": "TEST_DAG_2",
@@ -739,7 +730,6 @@ class TestGetDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
             ],
             "total_entries": 2,
@@ -778,7 +768,6 @@ class TestGetDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 }
             ],
             "total_entries": 1,
@@ -818,7 +807,6 @@ class TestGetDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
                 {
                     "dag_id": "TEST_DAG_DELETED_1",
@@ -845,7 +833,6 @@ class TestGetDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
             ],
             "total_entries": 2,
@@ -1001,7 +988,6 @@ class TestGetDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 }
             ],
             "total_entries": 1,
@@ -1040,7 +1026,6 @@ class TestGetDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 }
             ],
             "total_entries": 1,
@@ -1079,7 +1064,6 @@ class TestGetDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
                 {
                     "dag_id": "TEST_DAG_UNPAUSED_1",
@@ -1106,7 +1090,6 @@ class TestGetDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
             ],
             "total_entries": 2,
@@ -1195,7 +1178,6 @@ class TestPatchDag(TestDagEndpoint):
             "last_parsed_time": None,
             "timetable_description": None,
             "has_import_errors": False,
-            "pickle_id": None,
         }
         assert response.json == expected_response
         _check_last_log(
@@ -1293,7 +1275,6 @@ class TestPatchDag(TestDagEndpoint):
             "last_parsed_time": None,
             "timetable_description": None,
             "has_import_errors": False,
-            "pickle_id": None,
         }
         assert response.json == expected_response
 
@@ -1387,7 +1368,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
                 {
                     "dag_id": "TEST_DAG_2",
@@ -1414,7 +1394,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
             ],
             "total_entries": 2,
@@ -1466,7 +1445,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
                 {
                     "dag_id": "TEST_DAG_2",
@@ -1493,7 +1471,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
             ],
             "total_entries": 2,
@@ -1585,7 +1562,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 }
             ],
             "total_entries": 1,
@@ -1633,7 +1609,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
                 {
                     "dag_id": "TEST_DAG_DELETED_1",
@@ -1660,7 +1635,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
             ],
             "total_entries": 2,
@@ -1858,7 +1832,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
                 {
                     "dag_id": "TEST_DAG_2",
@@ -1885,7 +1858,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
             ],
             "total_entries": 2,
@@ -1933,7 +1905,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
                 {
                     "dag_id": "TEST_DAG_10",
@@ -1960,7 +1931,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
             ],
             "total_entries": 2,
@@ -2010,7 +1980,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
                 {
                     "dag_id": "TEST_DAG_1",
@@ -2037,7 +2006,6 @@ class TestPatchDags(TestDagEndpoint):
                     "last_parsed_time": None,
                     "timetable_description": None,
                     "has_import_errors": False,
-                    "pickle_id": None,
                 },
             ],
             "total_entries": 2,
diff --git a/tests/api_connexion/schemas/test_dag_schema.py 
b/tests/api_connexion/schemas/test_dag_schema.py
index 1576f9cf3d6..4a6829a5c83 100644
--- a/tests/api_connexion/schemas/test_dag_schema.py
+++ b/tests/api_connexion/schemas/test_dag_schema.py
@@ -72,7 +72,6 @@ def test_serialize_test_dag_schema(url_safe_serializer):
         "last_parsed_time": None,
         "timetable_description": None,
         "has_import_errors": None,
-        "pickle_id": None,
     } == serialized_dag
 
 
@@ -108,7 +107,6 @@ def 
test_serialize_test_dag_collection_schema(url_safe_serializer):
                 "last_parsed_time": None,
                 "timetable_description": None,
                 "has_import_errors": None,
-                "pickle_id": None,
             },
             {
                 "dag_id": "test_dag_id_b",
@@ -135,7 +133,6 @@ def 
test_serialize_test_dag_collection_schema(url_safe_serializer):
                 "last_parsed_time": None,
                 "timetable_description": None,
                 "has_import_errors": None,
-                "pickle_id": None,
             },
         ],
         "total_entries": 2,
@@ -190,7 +187,6 @@ def 
test_serialize_test_dag_detail_schema(url_safe_serializer):
         "timezone": UTC_JSON_REPR,
         "max_active_runs": 16,
         "max_consecutive_failed_dag_runs": 0,
-        "pickle_id": None,
         "end_date": None,
         "is_paused_upon_creation": None,
         "render_template_as_native_obj": False,
@@ -254,7 +250,6 @@ def 
test_serialize_test_dag_with_asset_schedule_detail_schema(url_safe_serialize
         "timezone": UTC_JSON_REPR,
         "max_active_runs": 16,
         "max_consecutive_failed_dag_runs": 0,
-        "pickle_id": None,
         "end_date": None,
         "is_paused_upon_creation": None,
         "render_template_as_native_obj": False,
diff --git a/tests/api_fastapi/core_api/routes/public/test_dags.py 
b/tests/api_fastapi/core_api/routes/public/test_dags.py
index 72f4f70179f..0e9b7a40858 100644
--- a/tests/api_fastapi/core_api/routes/public/test_dags.py
+++ b/tests/api_fastapi/core_api/routes/public/test_dags.py
@@ -320,7 +320,6 @@ class TestDagDetails(TestDagEndpoint):
             "next_dagrun_create_after": None,
             "next_dagrun_data_interval_end": None,
             "next_dagrun_data_interval_start": None,
-            "orientation": "LR",
             "owners": ["airflow"],
             "params": {
                 "foo": {
diff --git a/tests/serialization/test_pydantic_models.py 
b/tests/serialization/test_pydantic_models.py
index aac83ec28da..7bfc7eda32a 100644
--- a/tests/serialization/test_pydantic_models.py
+++ b/tests/serialization/test_pydantic_models.py
@@ -81,11 +81,10 @@ def test_serializing_pydantic_task_instance(session, 
create_task_instance):
 def test_deserialize_ti_mapped_op_reserialized_with_refresh_from_task(session, 
dag_maker):
     op_class_dict_expected = {
         "_needs_expansion": True,
-        "_task_type": "_PythonDecoratedOperator",
+        "task_type": "_PythonDecoratedOperator",
         "downstream_task_ids": [],
         "start_from_trigger": False,
         "start_trigger_args": None,
-        "_operator_name": "@task",
         "ui_fgcolor": "#000",
         "ui_color": "#ffefeb",
         "template_fields": ["templates_dict", "op_args", "op_kwargs"],
@@ -128,6 +127,8 @@ def 
test_deserialize_ti_mapped_op_reserialized_with_refresh_from_task(session, d
     assert desered.task.__class__ == MappedOperator
 
     assert desered.task.operator_class == op_class_dict_expected
+    assert desered.task.task_type == "_PythonDecoratedOperator"
+    assert desered.task.operator_name == "@task"
 
     desered.refresh_from_task(deser_task)
 

Reply via email to