E100Beta commented on issue #20974: URL: https://github.com/apache/airflow/issues/20974#issuecomment-1674514640
@uranusjr if I try calling `get_current_context()` in a `@task.virtualenv` task, it errors with `Current context was requested but no context was found! Are you running within an airflow task?`. Also, a couple of other context keys produce errors, for example trying to get `dag` and `dag_run` into context results in error of form ``` _pickle.PicklingError: Can't pickle <function get_cursor at 0x7f5cd799edd0>: it's not the same object as unusual_prefix_9372134610754e1f69b75b4d3bc27874c16554d8_process_messages.get_cursor ``` (where get_cursor is first task in my dag). I am currently trying to find a way to do `xcom_push` from virtualenv task, that is how I came across this issue. Is there a way to do it besides task return values and somehow getting `ti` to work inside virtualenv? -- 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]
