x3x3n0m0rph commented on issue #42502:
URL: https://github.com/apache/airflow/issues/42502#issuecomment-3566924720
Possible workaround, if you cannot update your deps to retrieve this fix and
have to set on 1.6.0 of provider (just like me). Just mention the producer
function with global reference as described. There are many problems with such
solution but it works
```python
def fire_event_function():
message = {
"sample": "field"
}
# Return an iterable of (key, value) tuples as expected by
ProduceToTopicOperator
return [(None, json.dumps(message, ensure_ascii=False).encode("utf-8"))]
fire_layer_event = ProduceToTopicOperator(
# ....
producer_function=f"{fire_event_function.__module__}.{fire_event_function.__qualname__}",
producer_function_kwargs={
"layer_id": "{{ ti.xcom_pull(task_ids='create_common_layer') }}",
"domain": "ABCD"
}
)
```
--
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]