You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "fritz-astronomer (via GitHub)" <gi...@apache.org> on 2025/09/09 20:33:53 UTC

[I] Params(type=...) throws error when triggering DAG [airflow]

fritz-astronomer opened a new issue, #55440:
URL: https://github.com/apache/airflow/issues/55440

   ### Apache Airflow version
   
   3.0.6
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   `Param(type=...`, and triggering a DAG Run, no longer seems to work with:
   ```
       "No source code available for <class 'type'>"
   ```
   
   # Minimum Example:
   ```python
   from airflow.sdk import DAG, Param
   
   with DAG("foo", params={"foo": Param("NOTSET", type=str)}):
      pass
   ```
   which seems to align with the docs. 
   https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/params.html
   
   # Full error logs
   ```python
   192.168.165.1:58942 - "POST /api/v2/dags/orbiter/dagRuns HTTP/1.1" 500 Internal Server Error
       Exception in ASGI application
    (most recent call last):
     File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 409, in run_asgi
       result = await app(  # type: ignore[func-returns-value]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
       await super().__call__(scope, receive, send)
     File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
       await self.middleware_stack(scope, receive, send)
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
       raise exc
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
       await self.app(scope, receive, _send)
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/gzip.py", line 29, in __call__
       await responder(scope, receive, send)
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/gzip.py", line 130, in __call__
       await super().__call__(scope, receive, send)
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/gzip.py", line 46, in __call__
       await self.app(scope, receive, self.send_with_compression)
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in __call__
       await self.simple_response(scope, receive, send, request_headers=headers)
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 144, in simple_response
       await self.app(scope, receive, send)
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 182, in __call__
       with recv_stream, send_stream, collapse_excgroups():
                                      ^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
       self.gen.throw(value)
     File "/usr/local/lib/python3.12/site-packages/starlette/_utils.py", line 83, in collapse_excgroups
       raise exc
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 184, in __call__
       response = await self.dispatch_func(request, call_next)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/api_fastapi/auth/managers/simple/middleware.py", line 34, in dispatch
       return await call_next(request)
              ^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 159, in call_next
       raise app_exc
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 144, in coro
       await self.app(scope, receive_or_disconnect, send_no_error)
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 182, in __call__
       with recv_stream, send_stream, collapse_excgroups():
                                      ^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
       self.gen.throw(value)
     File "/usr/local/lib/python3.12/site-packages/starlette/_utils.py", line 83, in collapse_excgroups
       raise exc
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 184, in __call__
       response = await self.dispatch_func(request, call_next)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/api_fastapi/core_api/middleware.py", line 28, in dispatch
       response = await call_next(request)
                  ^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 159, in call_next
       raise app_exc
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 144, in coro
       await self.app(scope, receive_or_disconnect, send_no_error)
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 182, in __call__
       with recv_stream, send_stream, collapse_excgroups():
                                      ^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
       self.gen.throw(value)
     File "/usr/local/lib/python3.12/site-packages/starlette/_utils.py", line 83, in collapse_excgroups
       raise exc
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 184, in __call__
       response = await self.dispatch_func(request, call_next)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/astronomer/runtime/plugin.py", line 90, in dispatch
       response = await call_next(request)
                  ^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 159, in call_next
       raise app_exc
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 144, in coro
       await self.app(scope, receive_or_disconnect, send_no_error)
     File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
       await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
     File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
       raise exc
     File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
       await app(scope, receive, sender)
     File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 716, in __call__
       await self.middleware_stack(scope, receive, send)
     File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 736, in app
       await route.handle(scope, receive, send)
     File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 290, in handle
       await self.app(scope, receive, send)
     File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 78, in app
       await wrap_app_handling_exceptions(app, request)(scope, receive, send)
     File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
       raise exc
     File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
       await app(scope, receive, sender)
     File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 75, in app
       response = await f(request)
                  ^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 302, in app
       raw_response = await run_endpoint_function(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 215, in run_endpoint_function
       return await run_in_threadpool(dependant.call, **values)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/starlette/concurrency.py", line 38, in run_in_threadpool
       return await anyio.to_thread.run_sync(func)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/anyio/to_thread.py", line 56, in run_sync
       return await get_async_backend().run_sync_in_worker_thread(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_thread
       return await future
              ^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 967, in run
       result = context.run(func, *args)
                ^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/api_fastapi/core_api/routes/public/dag_run.py", line 405, in trigger_dag_run
       dag_run = dag.create_dagrun(
                 ^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/utils/session.py", line 99, in wrapper
       return func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/models/dag.py", line 1584, in create_dagrun
       copied_params.update(conf)
     File "/usr/local/lib/python3.12/site-packages/airflow/sdk/definitions/param.py", line 234, in update
       super().update(*args, **kwargs)
     File "<frozen _collections_abc>", line 982, in update
     File "/usr/local/lib/python3.12/site-packages/airflow/sdk/definitions/param.py", line 203, in __setitem__
       param.resolve(value=value, suppress_exception=self.suppress_exception)
     File "/usr/local/lib/python3.12/site-packages/airflow/sdk/definitions/param.py", line 98, in resolve
       jsonschema.validate(final_val, self.schema, format_checker=FormatChecker())
     File "/usr/local/lib/python3.12/site-packages/jsonschema/validators.py", line 1328, in validate
       cls.check_schema(schema)
     File "/usr/local/lib/python3.12/site-packages/jsonschema/validators.py", line 317, in check_schema
       raise exceptions.SchemaError.create_from(error)
       
    "No source code available for <class 'type'>" is not valid under any of the given schemas
    validating 'anyOf' in metaschema['allOf'][3]['properties']['type']:
       {'anyOf': [{'$ref': '#/$defs/simpleTypes'},
                  {'type': 'array',
                   'items': {'$ref': '#/$defs/simpleTypes'},
                   'minItems': 1,
                   'uniqueItems': True}]}
    schema['type']:
       "No source code available for <class 'type'>"
   ```
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   .
   
   ### Operating System
   
   astro dev / debian
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Params(type=...) throws error when triggering DAG [airflow]

Posted by "fritz-astronomer (via GitHub)" <gi...@apache.org>.
fritz-astronomer commented on issue #55440:
URL: https://github.com/apache/airflow/issues/55440#issuecomment-3272185708

   Whoops. User error.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Params(type=...) throws error when triggering DAG [airflow]

Posted by "fritz-astronomer (via GitHub)" <gi...@apache.org>.
fritz-astronomer closed issue #55440: Params(type=...) throws error when triggering DAG
URL: https://github.com/apache/airflow/issues/55440


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org