Open Debetux opened 6 years ago
+1
It's been over six months, and this issue is still open. As a user who would dearly love to see this get fixed - can anyone please look into this? Any idea when we can expect to see a fix be pushed in an update?
+1
What's the status on this? I'm surprised to see this doesn't work.
@Miserlou What is missing for merging #1331 ? :) Thanks a lot!
It's been eight months since I dropped my last comment into this issue, and I've had to essentially monkey-patch the async file for all this time.
This seems to me like an issue related to supporting both Python2 and Python3's understanding of strings simultaneously. Python2 is reaching the end of its life this year, and so it's unreasonable for there to be broken functionality in Python3 in the interest of supporting old code. Python2 users should expect to be pinning versions left and right.
When can we expect this problem to be solved?
I'm having the same issue, any advice for how to get this working @relwell ?
@RoryOfByrne here's a gist of my workaround: https://gist.github.com/relwell/3eb9d68526ba8eadb41b3b1399e747a9
you would import that file instead of the normal zappa_async module.
Brilliant, thank you @relwell . Am I right in thinking that the only change is removing .encode('utf-8')
- here? I'm working on my own patch right now and that's the change I'm making.
I think so, @RoryOfByrne. It's been a while since I inspected the solution.
+1
Also bumped into the same problem here. @relwell approach wasn't a fit for me, as it is not so easy to apply his monkey-patch on the env I'm working with, although it worked just fine. I declared the boto3 session manually, used a fixed ARN for the publish request and hard-coded the dict that zappa builds before sending to SNS.
import boto3
message = {
"task_path": "module.my_async_method",
"capture_response": False,
"response_id": None,
"args": ["myarg1", "myarg2"],
"kwargs": {},
"command": "zappa.asynchronous.route_sns_task"
}
message = json.dumps(message)
aws_session = boto3.Session()
client = aws_session.client('sns')
client.publish(
TargetArn="arn:aws:sns:zone:123123123:sns-topic-name",
Message=message
)
It is basically the same as _send function from zappa but without the payload size exception and SNS message Id response. I hope the problem is solved soon so I can properly make SNS calls 😄
Im also hitting this issue... hopefully it gets fixed soon?
Context
I want to invoke a task which use @task_sns.
E.g. code:
This code produces this error:
Expected Behavior
Invoking the task should not fail. Message argument sent to botocore must be a string, not bytes.
Actual Behavior
We can't invoke the task using a SNS channel, because botocore expect a string, not bytes.
Possible Fix
Steps to Reproduce
zappa invoke dev main.my_endpoint
Your Environment
pip freeze
:zappa_settings.py
: