Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode values from python callback for C++ #10103

Merged
merged 3 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
7 changes: 6 additions & 1 deletion python/cudf_kafka/cudf_kafka/_lib/kafka.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ from cudf_kafka._lib.kafka cimport kafka_consumer
# To avoid including <python.h> in libcudf_kafka
# we introduce this wrapper in Cython
cdef map[string, string] oauth_callback_wrapper(void *ctx):
return (<object>(ctx))()
resp = (<object>(ctx))()
cdef map[string, string] c_resp
c_resp[str.encode("token")] = str.encode(resp["token"])
c_resp[str.encode("token_expiration_in_epoch")] \
= str(resp["token_expiration_in_epoch"]).encode()
return c_resp
jdye64 marked this conversation as resolved.
Show resolved Hide resolved


cdef class KafkaDatasource(Datasource):
Expand Down