Owen-CH-Leung commented on PR #38777:
URL: https://github.com/apache/airflow/pull/38777#issuecomment-2040225265

   FYI when executing pytest for the first time, `RemovedInAirflow3Warning` is 
raised for these 2 tests, and they are actually coming from the use of 
`SubDagOperator` in `example_subdag_operator` (I believe this will cause 
multiple unit test to raise the same deprecation warning)
   
   Given `SubDagOperator` will be deprecated, shall we just remove this example 
dag file ?
   
   ```
   
tests/providers/cncf/kubernetes/operators/test_spark_kubernetes.py::test_spark_kubernetes_operator
 ========================= AIRFLOW ==========================
   Home of the user: /root
   Airflow home /root/airflow
   Initializing the DB - first time after entering the container.
   You can force re-initialization the database by adding --with-db-init switch 
to run-tests.
   [2024-04-05T16:28:20.020+0000] {db.py:1682} INFO - Dropping tables that exist
   [2024-04-05T16:28:20.348+0000] {migration.py:216} INFO - Context impl 
PostgresqlImpl.
   [2024-04-05T16:28:20.348+0000] {migration.py:219} INFO - Will assume 
transactional DDL.
   [2024-04-05T16:28:20.359+0000] {migration.py:216} INFO - Context impl 
PostgresqlImpl.
   [2024-04-05T16:28:20.359+0000] {migration.py:219} INFO - Will assume 
transactional DDL.
   INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
   INFO  [alembic.runtime.migration] Will assume transactional DDL.
   INFO  [alembic.runtime.migration] Running stamp_revision  -> 677fdbb7fc54
   ERROR [airflow.models.dagbag.DagBag] Failed to import: 
/opt/airflow/tests/dags/test_clear_subdag.py
   Traceback (most recent call last):
     File "/opt/airflow/airflow/models/dagbag.py", line 346, in parse
       loader.exec_module(new_module)
     File "<frozen importlib._bootstrap_external>", line 940, in exec_module
     File "<frozen importlib._bootstrap>", line 241, in 
_call_with_frames_removed
     File "/opt/airflow/tests/dags/test_clear_subdag.py", line 66, in <module>
       daily_job = create_subdag_opt(main_dag=dag)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/airflow/tests/dags/test_clear_subdag.py", line 41, in 
create_subdag_opt
       return SubDagOperator(
              ^^^^^^^^^^^^^^^
     File "/opt/airflow/airflow/models/baseoperator.py", line 488, in 
apply_defaults
       result = func(self, **kwargs, default_args=default_args)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/airflow/airflow/utils/session.py", line 79, in wrapper
       return func(*args, session=session, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/airflow/airflow/operators/subdag.py", line 100, in __init__
       warnings.warn(
   airflow.exceptions.RemovedInAirflow3Warning: This class is deprecated. 
Please use `airflow.utils.task_group.TaskGroup`.
   
   ``` 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to