Skip to content
Discussion options

You must be logged in to vote

The issue that you are executing top-level code on a templated string so b64e(json.dumps(message_raw).encode("utf-8")) evaluates the literal string "{{ ds }}" rather than the rendered value that you are expecting. Templated strings are not rendered/evaluated until the task begins to execute.

If you need enforce the encoding on the messages, you can try defining a user_defined_macros or user_defined_filters to use with the Jinja templating.

user_defined_macros (dict) – a dictionary of macros that will be exposed in your jinja templates. For example, passing dict(foo='bar') to this argument allows you to {{ foo }} in all jinja templates related to this DAG. Note that you can pass any type…

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by CyberHippo
Comment options

You must be logged in to vote
4 replies
@alexwu0911
Comment options

@CyberHippo
Comment options

@atorres-eqrx
Comment options

@CyberHippo
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants