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

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   **API server:**
   
   File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 76, 
in app
       await wrap_app_handling_exceptions(app, request)(scope, receive, send)
     File 
"/usr/local/lib/python3.9/site-packages/starlette/_exception_handler.py", line 
53, in wrapped_app
       raise exc
     File 
"/usr/local/lib/python3.9/site-packages/starlette/_exception_handler.py", line 
42, in wrapped_app
       await app(scope, receive, sender)
     File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 
73, in app
       response = await f(request)
     File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 
301, in app
       raw_response = await run_endpoint_function(
     File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 
212, in run_endpoint_function
       return await dependant.call(**values)
     File 
"/usr/local/lib/python3.9/site-packages/cadwyn/structure/versions.py", line 
475, in decorator
       response = await self._convert_endpoint_response_to_version(
     File 
"/usr/local/lib/python3.9/site-packages/cadwyn/structure/versions.py", line 
521, in _convert_endpoint_response_to_version
       response_or_response_body: Union[FastapiResponse, object] = await 
run_in_threadpool(
     File "/usr/local/lib/python3.9/site-packages/starlette/concurrency.py", 
line 37, in run_in_threadpool
       return await anyio.to_thread.run_sync(func)
     File "/usr/local/lib/python3.9/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.9/site-packages/anyio/_backends/_asyncio.py", 
line 2470, in run_sync_in_worker_thread
       return await future
     File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", 
line 967, in run
       result = context.run(func, *args)
     File "/usr/local/lib/python3.9/site-packages/cadwyn/schema_generation.py", 
line 504, in __call__
       return self._original_callable(*args, **kwargs)
     File 
"/opt/airflow/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py",
 line 311, in ti_update_state
       TI.register_asset_changes_in_db(
     File "/opt/airflow/airflow-core/src/airflow/utils/session.py", line 98, in 
wrapper
       return func(*args, **kwargs)
     File "/opt/airflow/airflow-core/src/airflow/models/taskinstance.py", line 
2826, in register_asset_changes_in_db
       raise 
AirflowInactiveAssetAddedToAssetAliasException(bad_alias_asset_keys)
   airflow.exceptions.AirflowInactiveAssetAddedToAssetAliasException: The 
following assets accessed by an AssetAlias are inactive: Asset(name='b', 
uri='b')
   
   
   **Celery worker:**
   File "/usr/local/lib/python3.9/site-packages/tenacity/__init__.py", line 
475, in __call__
       do = self.iter(retry_state=retry_state)
     File "/usr/local/lib/python3.9/site-packages/tenacity/__init__.py", line 
376, in iter
       result = action(retry_state)
     File "/usr/local/lib/python3.9/site-packages/tenacity/__init__.py", line 
418, in exc_check
       raise retry_exc.reraise()
     File "/usr/local/lib/python3.9/site-packages/tenacity/__init__.py", line 
185, in reraise
       raise self.last_attempt.result()
     File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 439, in 
result
       return self.__get_result()
     File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 391, in 
__get_result
       raise self._exception
     File "/usr/local/lib/python3.9/site-packages/tenacity/__init__.py", line 
478, in __call__
       result = fn(*args, **kwargs)
     File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 539, in 
request
       return super().request(*args, **kwargs)
     File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 827, 
in request
       return self.send(request, auth=auth, follow_redirects=follow_redirects)
     File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 914, 
in send
       response = self._send_handling_auth(
     File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 942, 
in _send_handling_auth
       response = self._send_handling_redirects(
     File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 999, 
in _send_handling_redirects
       raise exc
     File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 982, 
in _send_handling_redirects
       hook(response)
     File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 108, in 
raise_on_4xx_5xx
       return get_json_error(response) or response.raise_for_status()
     File "/opt/airflow/task-sdk/src/airflow/sdk/api/client.py", line 104, in 
get_json_error
       raise err
   httpx.HTTPError: Server returned error
   
   
![Image](https://github.com/user-attachments/assets/5e416352-8649-4047-b4c6-7b925fd4491e)
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Use the below Dag:
   
   ```python
   from airflow.decorators import dag, task
   from airflow.datasets import Dataset, DatasetAlias
   from airflow.sdk.definitions.asset.metadata import Metadata
   from pendulum import datetime
   
   my_alias_name = "alias-dataset-1"
   
   
   @dag(
       dag_display_name="example_dataset_alias_mapped",
       start_date=datetime(2024, 8, 1),
       schedule=None,
       catchup=False,
       tags=["datasets"],
   )
   def dataset_alias_dynamic_test():
       @task
       def upstream_task():
           return ["a", "b"]
   
       @task(outlets=[DatasetAlias(my_alias_name)])
       def use_metadata(name):
           print("NAME: ", name)
           yield Metadata(
               Dataset(name),
               alias=DatasetAlias(my_alias_name),
               extra={}  # extra is NOT optional
           )
   
       use_metadata.expand(name=upstream_task())
   
   
   dataset_alias_dynamic_test()
   ``` 
   
   ### Operating System
   
   Linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### 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: [email protected]

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

Reply via email to